mirror of
https://github.com/socialwifi/RouterOS-api.git
synced 2025-09-01 07:30:13 +02:00
Add info on new login.
parent
feb51d2221
commit
816c705ef1
1 changed files with 18 additions and 4 deletions
|
@ -7,22 +7,36 @@ import routeros_api
|
||||||
connection = routeros_api.RouterOsApiPool('IP', username='admin', password='')
|
connection = routeros_api.RouterOsApiPool('IP', username='admin', password='')
|
||||||
api = connection.get_api()
|
api = connection.get_api()
|
||||||
```
|
```
|
||||||
|
### Connect Options
|
||||||
### Proposed SSL Options (pending merge of PR)
|
`routeros_api.RouterOsApiPool(host, username='admin', password='', port=8728)`
|
||||||
`routeros_api.RouterOsApiPool(host, username='admin', password='', port=8728, use_ssl=False, ssl_verify=True, ssl_verify_hostname=True, ca_cert=None)`
|
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
* host - String - Hostname or IP of device
|
* host - String - Hostname or IP of device
|
||||||
|
|
||||||
Optional Parameters
|
Optional Parameters:
|
||||||
* username - String - Login username - Default 'admin'
|
* username - String - Login username - Default 'admin'
|
||||||
* password - String - Login password - Default empty string
|
* password - String - Login password - Default empty string
|
||||||
* port - Integer - TCP Port for API - Default 8728
|
* port - Integer - TCP Port for API - Default 8728
|
||||||
|
|
||||||
|
### 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)`
|
||||||
|
|
||||||
|
New Optional Parameters
|
||||||
* use_ssl - Boolean - Use SSL or not? - Default **False**
|
* use_ssl - Boolean - Use SSL or not? - Default **False**
|
||||||
* ssl_verify - Boolean - Verify the SSL certificate? - Default **True**
|
* ssl_verify - Boolean - Verify the SSL certificate? - Default **True**
|
||||||
* ssl_verify_hostname - Boolean - Verify the SSL certificate hostname matches? - 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**
|
* ca_cert - String - Location of CA file if required - Default **None**
|
||||||
|
|
||||||
|
### Proposed New Login Options (pending merge of PR)
|
||||||
|
RouterOS Versions >v6.43 now use a different login method. The disadvantage is that it passes the password in plain text. The best auto-detection also sends the password in plain text at the start, even if the device doesn't support it. Therefore you can disable the new login method manually if you know the device you are connecting to uses <v6.43.
|
||||||
|
|
||||||
|
The proper solution is to use SSL only for API connectivity.
|
||||||
|
|
||||||
|
`routeros_api.RouterOsApiPool(host, username='admin', password='', port=8728, force_old_login=False)`
|
||||||
|
|
||||||
|
New Optional Parameters
|
||||||
|
* force_old_login - Boolean - Disable the new login method? - Default **False**
|
||||||
|
|
||||||
## Execute Commands
|
## Execute Commands
|
||||||
`api.get_binary_resource('/').call('<resource>',{ <dict of params> })`
|
`api.get_binary_resource('/').call('<resource>',{ <dict of params> })`
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue