TACACS
Import OPBNOS API
from opbclient import opb_api as opbapi
Initialize client
Use the appropriate JSON file that corresponds to the targetted device name. This JSON file should contain request body parameters corresponding to any potential configuration/post requests.
node = opbapi.connect_to('SN2010')
Configure TACACS Global Config
In order to configure port information, the API, configTACACSglobal(), must be invoked with input parameter, 'dt'. 'dt' accepts all request body inputs in a dictionary format.
node.configTACACSglobal(dt = {"auth_type": "pap","timeout": 8,"passkey": "support"})
The below table has a list of attributes that pertain to this particular API:
Attribute | Values | Description |
---|---|---|
"auth_type" | "pap" | indicates authorization type (password authorization protocol) |
"timeout" | int | indicates timeout value |
"passkey" | "support" | server user credential string |
Configure TACACS Server
In order to configure TACACS server information, the API, configTACACSserver(), must be invoked with input parameter, 'dt'. 'dt' accepts all request body inputs in a dictionary format.
node.configTACACSserver(dt = {"host": "10.4.4.11","timeout": 8,"priority": 1,"auth_type": "pap","passkey": "support"})
The below table has a list of attributes that pertain to this particular API:
Attribute | Values | Description |
---|---|---|
"host" | "10.X.X.XX" | host id |
"timeout" | int | indicates timeout value |
"priority" | int | indicates priority |
"auth_type" | "pap" | indicates authorization type (password authorization protocol) |
"passkey" | "support" | server user credential string |
Get Tacacs Server
node.execute(['show tacacs-server'])
b'{"10.4.4.11": {"tcp_port": "49", "timeout": "8", "priority": "1", "passkey": "support", "auth_type": "pap"}, "global": {}}'
Deletre TACACS Server
In order to delete the Tacacs Server Config
node.deleteTACACSserver(host="10.4.4.11")
Status : 200 -> Response : b'{"Info": "TACACS server deleted successfully"}'