mirror of
https://github.com/socialwifi/RouterOS-api.git
synced 2025-08-30 22:59:55 +02:00
Add info on proposed SSL options.
parent
4044e525a5
commit
feb51d2221
1 changed files with 23 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
|||
## Connection
|
||||
```
|
||||
#! /usr/bin/python`
|
||||
#!/usr/bin/python
|
||||
|
||||
import routeros_api
|
||||
|
||||
|
@ -8,9 +8,29 @@ connection = routeros_api.RouterOsApiPool('IP', username='admin', password='')
|
|||
api = connection.get_api()
|
||||
```
|
||||
|
||||
## Execute Commands Example:
|
||||
`api.get_binary_resource('/').call('tool/fetch',{ 'url': "https://dummy.url" })`
|
||||
### Proposed SSL Options (pending merge of PR)
|
||||
`routeros_api.RouterOsApiPool(host, username='admin', password='', port=8728, use_ssl=False, ssl_verify=True, ssl_verify_hostname=True, ca_cert=None)`
|
||||
|
||||
Parameters:
|
||||
* host - String - Hostname or IP of device
|
||||
|
||||
Optional Parameters
|
||||
* username - String - Login username - Default 'admin'
|
||||
* password - String - Login password - Default empty string
|
||||
* port - Integer - TCP Port for API - Default 8728
|
||||
* use_ssl - Boolean - Use SSL or not? - Default **False**
|
||||
* ssl_verify - Boolean - Verify the SSL certificate? - Default **True**
|
||||
* ssl_verify_hostname - Boolean - Verify the SSL certificate hostname matches? - Default **True**
|
||||
* ca_cert - String - Location of CA file if required - Default **None**
|
||||
|
||||
## Execute Commands
|
||||
`api.get_binary_resource('/').call('<resource>',{ <dict of params> })`
|
||||
|
||||
Call this with a resource and parameters as name/value pairs.
|
||||
|
||||
### Examples
|
||||
`api.get_binary_resource('/').call('tool/fetch',{ 'url': "https://dummy.url" })`
|
||||
`api.get_binary_resource('/').call('ping', { 'address': '192.168.56.1', 'count': '4' })`
|
||||
|
||||
## Fetch List/Resource
|
||||
`list = api.get_resource('/command') `
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue