show cdp global
show cdp global
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 cdp global",
"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": {
"type": "cli_show",
"version": "1.0",
"sid": "eoc",
"outputs": {
"output": {
"input": "show cdp global",
"msg": "Success",
"code": "200",
"body": {
"cdp_global_enabled": "enabled",
"refresh_time": "60",
"ttl": 180,
"v2_advertisement": "enabled",
"deviceid_format": "DeviceID TLV in System-Name(Default) Format"
}
}
}
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show cdp global command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show cdp neighbors interface e7/2
show cdp neighbors interface e7/2
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 cdp neighbors interface e7/2",
"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": {
"type": "cli_show",
"version": "1.0",
"sid": "eoc",
"outputs": {
"output": {
"input": "show cdp neighbors interface e7/2",
"msg": "Success",
"code": "200",
"body": {
"neigh_count": 1,
"TABLE_cdp_neighbor_brief_info": {
"ROW_cdp_neighbor_brief_info": {
"ifindex": 439353856,
"device_id": "EOR-2(FGE18330EZZ)",
"intf_id": "Ethernet7/2",
"ttl": 171,
"capability": [
"router",
"switch",
"IGMP_cnd_filtering",
"Supports-STP-Dispute"
],
"platform_id": "N9K-C9508",
"port_id": "Ethernet1/36"
}
}
}
}
}
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show cdp neighbors interface e7/2 command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show cdp neighbors interface e7/2 detail
show cdp neighbors interface e7/2 detail
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 cdp neighbors interface e7/2 detail",
"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": {
"type": "cli_show",
"version": "1.0",
"sid": "eoc",
"outputs": {
"output": {
"input": "show cdp neighbors interface e7/2 detail",
"msg": "Success",
"code": "200",
"body": {
"TABLE_cdp_neighbor_detail_info": {
"ROW_cdp_neighbor_detail_info": {
"ifindex": 439353856,
"device_id": "EOR-2(FGE18330EZZ)",
"sysname": "EOR-2",
"numaddr": 1,
"v4addr": "6.6.8.2",
"platform_id": "N9K-C9508",
"capability": [
"router",
"switch",
"IGMP_cnd_filtering",
"Supports-STP-Dispute"
],
"intf_id": "Ethernet7/2",
"port_id": "Ethernet1/36",
"ttl": 133,
"version": "Cisco Nexus Operating System (NX-OS) Software, Version 9.2(2)",
"version_no": "v2",
"nativevlan": 1,
"duplexmode": "full",
"mtu": 1500,
"syslocation": "Bldg14-CCC09",
"num_mgmtaddr": 1,
"v4mgmtaddr": "172.31.145.253"
}
}
}
}
}
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show cdp neighbors interface e7/2 detail command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show cdp traffic interface ethernet 7/2
show cdp traffic interface ethernet 7/2
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 cdp traffic interface ethernet 7/2 ",
"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": {
"type": "cli_show",
"version": "1.0",
"sid": "eoc",
"outputs": {
"output": {
"input": "show cdp traffic interface ethernet 7/2 ",
"msg": "Success",
"code": "200",
"body": {
"intf_id": "Ethernet7/2",
"total_input_packets": "385",
"valid_cdp_packets": "385",
"input_v1_packets": "0",
"input_v2_packets": "385",
"invalid_cdp_packets": "0",
"unsupported_version": "0",
"checksum_errors": "0",
"malformed_packets": "0",
"total_output_packets": "386",
"output_v1_packets": "0",
"output_v2_packets": "386",
"send_errors": "0"
}
}
}
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show cdp traffic interface ethernet 7/2 command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|