diff --git a/How-to-use.md b/How-to-use.md index 0dbd1a2..e7d5d41 100644 --- a/How-to-use.md +++ b/How-to-use.md @@ -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('',{ })` + +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') `