show tacacs-server
show tacacs-server
import json
"""
Modify these please
"""
url='http://<IP_Address>/ins'
switchuser='<User_ID>'
switchpassword='<Password>'
myheaders={'content-type':'application/json'}
payload={
"ins_api":{
"version": "1.0",
"type": "cli_show",
"chunk": "0",
"sid": "1",
"input": "show tacacs-server",
"output_format": "json"
}
response = requests.post(url,data=json.dumps(payload), headers=myheaders,auth=(switchuser,switchpassword)).json()
output = json.dumps(response, indent=4, sort_keys=True)
{
"ins_api": {
"outputs": {
"output": {
"body": {
"TABLE_server": {
"ROW_server": {
"port": "49",
"secretKey": "********",
"server_ip": "172.31.200.255"
}
},
"global_deadtime": "0",
"global_source_intf": "any available",
"global_timeout": "5",
"server_count": "1"
},
"code": "200",
"input": "show tacacs-server",
"msg": "Success"
}
},
"sid": "eoc",
"type": "cli_show",
"version": "1.0"
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show tacacs-server command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 7.0(3)I7(4).
| CLI Output |
|---|
|
show tacacs-server directed-request
show tacacs-server directed-request
import json
"""
Modify these please
"""
url='http://<IP_Address>/ins'
switchuser='<User_ID>'
switchpassword='<Password>'
myheaders={'content-type':'application/json'}
payload={
"ins_api":{
"version": "1.0",
"type": "cli_show",
"chunk": "0",
"sid": "1",
"input": "show tacacs-server directed-request",
"output_format": "json"
}
response = requests.post(url,data=json.dumps(payload), headers=myheaders,auth=(switchuser,switchpassword)).json()
output = json.dumps(response, indent=4, sort_keys=True)
{
"ins_api": {
"outputs": {
"output": {
"body": {
"tacacs_directedRequest_status": "enabled"
},
"code": "200",
"input": "show tacacs-server directed-request",
"msg": "Success"
}
},
"sid": "eoc",
"type": "cli_show",
"version": "1.0"
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show tacacs-server directed-request command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 7.0(3)I7(4).
| CLI Output |
|---|
|
show tacacs-server groups
show tacacs-server groups
import json
"""
Modify these please
"""
url='http://<IP_Address>/ins'
switchuser='<User_ID>'
switchpassword='<Password>'
myheaders={'content-type':'application/json'}
payload={
"ins_api":{
"version": "1.0",
"type": "cli_show",
"chunk": "0",
"sid": "1",
"input": "show tacacs-server groups",
"output_format": "json"
}
response = requests.post(url,data=json.dumps(payload), headers=myheaders,auth=(switchuser,switchpassword)).json()
output = json.dumps(response, indent=4, sort_keys=True)
{
"ins_api": {
"outputs": {
"output": {
"body": {
"TABLE_group": {
"ROW_group": {
"TABLE_server": {
"ROW_server": {
"port": "49",
"server_ip": "172.31.200.255"
}
},
"dead_time": "0",
"group_name": "tacacs-group",
"vrf_name": "management"
}
},
"num_of_groups": "1"
},
"code": "200",
"input": "show tacacs-server groups",
"msg": "Success"
}
},
"sid": "eoc",
"type": "cli_show",
"version": "1.0"
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show tacacs-server groups command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 7.0(3)I7(4).
| CLI Output |
|---|
|
show tacacs-server sorted
show tacacs-server sorted
import json
"""
Modify these please
"""
url='http://<IP_Address>/ins'
switchuser='<User_ID>'
switchpassword='<Password>'
myheaders={'content-type':'application/json'}
payload={
"ins_api":{
"version": "1.0",
"type": "cli_show",
"chunk": "0",
"sid": "1",
"input": "show tacacs-server sorted",
"output_format": "json"
}
response = requests.post(url,data=json.dumps(payload), headers=myheaders,auth=(switchuser,switchpassword)).json()
output = json.dumps(response, indent=4, sort_keys=True)
{
"ins_api": {
"outputs": {
"output": {
"body": {
"TABLE_server": {
"ROW_server": {
"port": "49",
"secretKey": "********",
"server_ip": "172.31.200.255"
}
},
"global_deadtime": "0",
"global_source_intf": "any available",
"global_timeout": "5",
"server_count": "1"
},
"code": "200",
"input": "show tacacs-server sorted",
"msg": "Success"
}
},
"sid": "eoc",
"type": "cli_show",
"version": "1.0"
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show tacacs-server sorted command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 7.0(3)I7(4).
| CLI Output |
|---|
|
show tacacs-server statistics 172.31.200.255
show tacacs-server statistics 172.31.200.255
import json
"""
Modify these please
"""
url='http://<IP_Address>/ins'
switchuser='<User_ID>'
switchpassword='<Password>'
myheaders={'content-type':'application/json'}
payload={
"ins_api":{
"version": "1.0",
"type": "cli_show",
"chunk": "0",
"sid": "1",
"input": "show tacacs-server statistics 172.31.200.255",
"output_format": "json"
}
response = requests.post(url,data=json.dumps(payload), headers=myheaders,auth=(switchuser,switchpassword)).json()
output = json.dumps(response, indent=4, sort_keys=True)
{
"ins_api": {
"outputs": {
"output": {
"body": {
"acct_statistics": {
"acct_failed_transactions": "0",
"acct_req_sent": "0",
"acct_req_timedout": "0",
"acct_resp_error": "0",
"acct_resp_no_match": "0",
"acct_resp_not_processed": "0",
"acct_succ_transactions": "0"
},
"auth_statistics": {
"auth_failed_transactions": "0",
"auth_req_sent": "0",
"auth_req_timedout": "0",
"auth_resp_error": "0",
"auth_resp_no_match": "0",
"auth_resp_not_processed": "0",
"auth_succ_transactions": "0"
},
"autho_statistics": {
"autho_failed_transactions": "0",
"autho_req_sent": "0",
"autho_req_timedout": "0",
"autho_resp_error": "0",
"autho_resp_no_match": "0",
"autho_resp_not_processed": "0",
"autho_succ_transactions": "0"
},
"server_state": "not monitored"
},
"code": "200",
"input": "show tacacs-server statistics 172.31.200.255",
"msg": "Success"
}
},
"sid": "eoc",
"type": "cli_show",
"version": "1.0"
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show tacacs-server statistics 172.31.200.255 command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 7.0(3)I7(4).
| CLI Output |
|---|
|