Cisco Nexus 9000 Series NX-API CLI Reference, Release 7(x)
NX-OS 7(x)
- Cisco Nexus 9000 Series NX-API CLI Reference, Release 7.x
- About NX-API CLI
- Access-List Commands
- BFD Commands
- BGP Commands
- CDP Commands
- DHCP Commands
- Diagnostic Commands
- Environment Commands
- Flow Commands
- Hardware Commands
- Interface Commands
- Inventory Commands
- LLDP Commands
- Module Commands
- NVE Commands
- RADIUS Commands
- SNMP Commands
- System Commands
- TACACS Commands
- Version Commands
show bfd clients
Python
Copy
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 bfd clients",
"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-bfdClients": {
"client_name": [
"bgp",
"eth_port_channel"
],
"num_sess": [
"12",
"1"
]
},
"header": "1"
},
"code": "200",
"input": "show bfd clients",
"msg": "Success"
}
},
"sid": "eoc",
"type": "cli_show",
"version": "1.0"
}
}