show bgp ip unicast
show bgp ip unicast
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 bgp ip unicast",
"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_vrf": {
"ROW_vrf": {
"TABLE_afi": {
"ROW_afi": {
"TABLE_safi": {
"ROW_safi": {
"TABLE_rd": {
"ROW_rd": {
"TABLE_prefix": {
"ROW_prefix": [
{
"TABLE_path": {
"ROW_path": [
{
"aspath": "",
"best": "bestpath",
"bestcode": ">",
"ipnexthop": "0.0.0.0",
"localpref": "100",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "valid",
"statuscode": "*",
"type": "local",
"typecode": "l",
"weight": "32768"
},
{
"aspath": "65059",
"best": "non-bestpath",
"bestcode": {},
"ipnexthop": "10.100.157.1",
"localpref": "",
"metric": "",
"origin": "i",
"pathnr": "1",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
},
{
"aspath": "65059",
"best": "non-bestpath",
"bestcode": "&",
"ipnexthop": "10.100.157.9",
"localpref": "110",
"metric": "",
"origin": "i",
"pathnr": "2",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
}
]
},
"ipprefix": "7.57.0.0/16"
},
{
"TABLE_path": {
"ROW_path": [
{
"aspath": "65059",
"best": "non-bestpath",
"bestcode": "&",
"ipnexthop": "10.100.157.1",
"localpref": "",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
},
{
"aspath": "65059",
"best": "bestpath",
"bestcode": ">",
"ipnexthop": "10.100.157.9",
"localpref": "110",
"metric": "",
"origin": "i",
"pathnr": "1",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
}
]
},
"ipprefix": "7.57.255.1/32"
},
{
"TABLE_path": {
"ROW_path": [
{
"aspath": "",
"best": "bestpath",
"bestcode": ">",
"ipnexthop": "0.0.0.0",
"localpref": "100",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "valid",
"statuscode": "*",
"type": "local",
"typecode": "l",
"weight": "32768"
},
{
"aspath": "65059",
"best": "non-bestpath",
"bestcode": {},
"ipnexthop": "10.100.157.1",
"localpref": "",
"metric": "",
"origin": "i",
"pathnr": "1",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
},
{
"aspath": "65059",
"best": "non-bestpath",
"bestcode": "&",
"ipnexthop": "10.100.157.9",
"localpref": "110",
"metric": "",
"origin": "i",
"pathnr": "2",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
}
]
},
"ipprefix": "10.57.0.0/16"
},
{
"TABLE_path": {
"ROW_path": [
{
"aspath": "65059",
"best": "non-bestpath",
"bestcode": "&",
"ipnexthop": "10.100.157.1",
"localpref": "",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
},
{
"aspath": "65059",
"best": "bestpath",
"bestcode": ">",
"ipnexthop": "10.100.157.9",
"localpref": "110",
"metric": "",
"origin": "i",
"pathnr": "1",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
}
]
},
"ipprefix": "10.57.50.0/24"
},
{
"TABLE_path": {
"ROW_path": [
{
"aspath": "",
"best": "bestpath",
"bestcode": ">",
"ipnexthop": "0.0.0.0",
"localpref": "100",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "valid",
"statuscode": "*",
"type": "local",
"typecode": "l",
"weight": "32768"
},
{
"aspath": "65059",
"best": "non-bestpath",
"bestcode": {},
"ipnexthop": "10.100.157.1",
"localpref": "",
"metric": "",
"origin": "i",
"pathnr": "1",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
},
{
"aspath": "65059",
"best": "non-bestpath",
"bestcode": "&",
"ipnexthop": "10.100.157.9",
"localpref": "110",
"metric": "",
"origin": "i",
"pathnr": "2",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
}
]
},
"ipprefix": "10.100.90.128/30"
},
{
"TABLE_path": {
"ROW_path": [
{
"aspath": "",
"best": "bestpath",
"bestcode": ">",
"ipnexthop": "0.0.0.0",
"localpref": "100",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "valid",
"statuscode": "*",
"type": "local",
"typecode": "l",
"weight": "32768"
},
{
"aspath": "65059",
"best": "non-bestpath",
"bestcode": {},
"ipnexthop": "10.100.157.1",
"localpref": "",
"metric": "",
"origin": "i",
"pathnr": "1",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
},
{
"aspath": "65059",
"best": "non-bestpath",
"bestcode": "&",
"ipnexthop": "10.100.157.9",
"localpref": "110",
"metric": "",
"origin": "i",
"pathnr": "2",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
}
]
},
"ipprefix": "10.100.157.0/30"
},
{
"TABLE_path": {
"ROW_path": [
{
"aspath": "",
"best": "bestpath",
"bestcode": ">",
"ipnexthop": "0.0.0.0",
"localpref": "100",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "valid",
"statuscode": "*",
"type": "local",
"typecode": "l",
"weight": "32768"
},
{
"aspath": "65059",
"best": "non-bestpath",
"bestcode": {},
"ipnexthop": "10.100.157.1",
"localpref": "",
"metric": "",
"origin": "i",
"pathnr": "1",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
},
{
"aspath": "65059",
"best": "non-bestpath",
"bestcode": "&",
"ipnexthop": "10.100.157.9",
"localpref": "110",
"metric": "",
"origin": "i",
"pathnr": "2",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
}
]
},
"ipprefix": "10.100.157.8/30"
},
{
"TABLE_path": {
"ROW_path": {
"aspath": "",
"best": "non-bestpath",
"bestcode": {},
"ipnexthop": "0.0.0.0",
"localpref": "100",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "",
"statuscode": {},
"type": "local",
"typecode": "l",
"weight": "32768"
}
},
"ipprefix": "10.100.166.4/30"
},
{
"TABLE_path": {
"ROW_path": [
{
"aspath": "65059",
"best": "non-bestpath",
"bestcode": "&",
"ipnexthop": "10.100.157.1",
"localpref": "",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
},
{
"aspath": "65059",
"best": "bestpath",
"bestcode": ">",
"ipnexthop": "10.100.157.9",
"localpref": "110",
"metric": "",
"origin": "i",
"pathnr": "1",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
}
]
},
"ipprefix": "33.33.33.33/32"
}
]
}
}
},
"af-name": "IPv4 Unicast",
"router-id": "7.57.255.2",
"safi": "1",
"table-version": "42"
}
},
"afi": "1"
}
},
"vrf-name-out": "default"
}
}
},
"code": "200",
"input": "show bgp ip unicast",
"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 bgp ip unicast command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 6.0(2)A8(8).
| CLI Output |
|---|
|
show bgp ip unicast neighbors
show bgp ip unicast neighbors
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 bgp ip unicast neighbors",
"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_neighbor": {
"ROW_neighbor": [
{
"TABLE_peraf": {
"ROW_peraf": {
"TABLE_persaf": {
"ROW_persaf": {
"firstupdrecv": "never",
"firstupdsent": "never",
"lastupdrecv": "never",
"lastupdsent": "never",
"neighbortableversion": "0",
"per-safi": "1",
"pfxbytes": "0",
"pfxrecvd": "0",
"pfxsent": "0",
"srpermitted": "FALSE",
"tableversion": "42",
"thirdpartynexthop": "FALSE"
}
},
"per-afi": "1"
}
},
"bytesrecvd": "0",
"bytessent": "0",
"capabilitiesrecvd": "0",
"capabilitiessent": "0",
"connattempts": "10374",
"connsdropped": "0",
"connsestablished": "0",
"description": "REX",
"elapsedtime": "1w5d",
"firstkeepalive": "FALSE",
"holdtime": "3",
"index": "1",
"keepaliverecvd": "0",
"keepalivesent": "0",
"keepalivetime": "1",
"lastread": "never",
"lastwrite": "never",
"link": "ibgp",
"localas": "",
"msgrecvd": "0",
"msgsent": "0",
"neighbor": "10.40.100.57",
"notificationsrcvd": "0",
"notificationssent": "0",
"notifsrecvd": "0",
"notifssent": "0",
"opensrecvd": "0",
"openssent": "0",
"peerresetreason": "No error",
"peerresettime": "never",
"recvbufbytes": "0",
"remote-id": "0.0.0.0",
"remoteas": "65057",
"remove-privateas": "FALSE",
"resetreason": "No error",
"resettime": "never",
"restarttime": "00:00:54",
"rtrefreshrecvd": "0",
"rtrefreshsent": "0",
"sentbytesoutstanding": "0",
"sourceif": "loopback0",
"state": "Idle",
"up": "FALSE",
"updatesrecvd": "0",
"updatessent": "0",
"version": "4"
},
{
"TABLE_inpolicy": {
"ROW_inpolicy": {
"inpolicyhandle": "TRUE",
"inpolicyname": "RM-MIL-IN",
"inpolicynr": "2",
"inpolicytype": "route-map"
}
},
"TABLE_outpolicy": {
"ROW_outpolicy": {
"outpolicyhandle": "TRUE",
"outpolicyname": "RM-MIL-OUT",
"outpolicynr": "2",
"outpolicytype": "route-map"
}
},
"TABLE_peraf": {
"ROW_peraf": {
"TABLE_persaf": {
"ROW_persaf": {
"firstupdrecv": "never",
"firstupdsent": "never",
"lastupdrecv": "never",
"lastupdsent": "never",
"neighbortableversion": "0",
"per-safi": "1",
"pfxbytes": "0",
"pfxrecvd": "0",
"pfxsent": "0",
"sendcommunity": "TRUE",
"sendextcommunity": "TRUE",
"srpermitted": "TRUE",
"tableversion": "42"
}
},
"per-afi": "1"
}
},
"bytesrecvd": "0",
"bytessent": "0",
"capabilitiesrecvd": "0",
"capabilitiessent": "0",
"connattempts": "14486",
"connsdropped": "0",
"connsestablished": "0",
"elapsedtime": "1w5d",
"firstkeepalive": "FALSE",
"holdtime": "3",
"index": "2",
"keepaliverecvd": "0",
"keepalivesent": "0",
"keepalivetime": "1",
"lastread": "never",
"lastwrite": "never",
"link": "ebgp",
"localas": "",
"msgrecvd": "0",
"msgsent": "0",
"neighbor": "10.100.90.130",
"notificationsrcvd": "0",
"notificationssent": "0",
"notifsrecvd": "0",
"notifssent": "0",
"opensrecvd": "0",
"openssent": "0",
"peerresetreason": "No error",
"peerresettime": "never",
"recvbufbytes": "0",
"remote-id": "0.0.0.0",
"remoteas": "300",
"remove-privateas": "FALSE",
"resetreason": "No error",
"resettime": "never",
"restarttime": "00:00:18",
"rtrefreshrecvd": "0",
"rtrefreshsent": "0",
"sentbytesoutstanding": "0",
"state": "Idle",
"up": "FALSE",
"updatesrecvd": "0",
"updatessent": "0",
"version": "4"
},
{
"TABLE_addpathscapaf": {
"ROW_addpathscapaf": {
"TABLE_addpathscapsaf": {
"ROW_addpathscapsaf": {
"addpathscap-safi": "1",
"addpathsrecvcap-adv": "TRUE",
"addpathsrecvcap-recv": "FALSE",
"addpathssendcap-adv": "TRUE",
"addpathssendcap-recv": "FALSE"
}
},
"addpathscap-afi": "1"
}
},
"TABLE_af": {
"ROW_af": {
"TABLE_saf": {
"ROW_saf": {
"af-advertised": "TRUE",
"af-name": "IPv4 Unicast",
"af-recvd": "TRUE",
"af-safi": "1"
}
},
"af-afi": "1"
}
},
"TABLE_graf": {
"ROW_graf": {
"TABLE_grsaf": {
"ROW_grsaf": {
"gr-adv": "TRUE",
"gr-af-name": "IPv4 Unicast",
"gr-fwd": "FALSE",
"gr-recv": "TRUE",
"gr-safi": "1"
}
},
"gr-afi": "1"
}
},
"TABLE_peraf": {
"ROW_peraf": {
"TABLE_persaf": {
"ROW_persaf": {
"firstupdrecv": "P12DT14H37M53S",
"firstupdsent": "P12DT14H37M53S",
"lastgrEORtime": "PT1S",
"lastupdrecv": "P12DT14H37M42S",
"lastupdsent": "P12DT14H37M49S",
"neighbortableversion": "42",
"per-safi": "1",
"pfxbytes": "448",
"pfxrecvd": "8",
"pfxsent": "5",
"sendcommunity": "TRUE",
"sendextcommunity": "TRUE",
"srpermitted": "TRUE",
"tableversion": "42"
}
},
"per-afi": "1"
}
},
"bytesrecvd": "20459058",
"bytessent": "20428294",
"capabilitiesrecvd": "0",
"capabilitiessent": "0",
"capaddpathsadvertised": "TRUE",
"capaddpathsrecvd": "FALSE",
"capas4advertised": "TRUE",
"capas4recvd": "TRUE",
"capgradvertised": "TRUE",
"capgrrecvd": "TRUE",
"capmpadvertised": "TRUE",
"capmprecvd": "TRUE",
"capolddynamicadvertised": "TRUE",
"capolddynamicrecvd": "TRUE",
"capoldrradvertised": "TRUE",
"capoldrrrecvd": "TRUE",
"caprefreshadvertised": "TRUE",
"caprefreshrecvd": "TRUE",
"caprradvertised": "TRUE",
"caprrrecvd": "TRUE",
"capsnegotiated": "FALSE",
"connectedif": "Ethernet1/2",
"connsdropped": "0",
"connsestablished": "1",
"elapsedtime": "1w5d",
"fd": "49",
"firstkeepalive": "FALSE",
"grrecvdrestarttime": "120",
"grrestarttime": "120",
"grstaletime": "300",
"holdtime": "3",
"index": "3",
"ipv6nhencodcapaf": "IPv4 Unicast",
"keepalive": "0.993740",
"keepaliverecvd": "1076785",
"keepalivesent": "1075165",
"keepalivetime": "1",
"lastread": "0.769899",
"lastwrite": "00:00:01",
"link": "ebgp",
"localaddr": "10.100.157.2",
"localas": "",
"localport": "179",
"msgrecvd": "1076789",
"msgsent": "1075170",
"neighbor": "10.100.157.1",
"notificationsrcvd": "0",
"notificationssent": "0",
"notifsrecvd": "0",
"notifssent": "0",
"opensrecvd": "1",
"openssent": "1",
"peerresetreason": "No error",
"peerresettime": "never",
"recvbufbytes": "0",
"remote-id": "7.57.255.1",
"remoteaddr": "10.100.157.1",
"remoteas": "65059",
"remoteport": "14258",
"remove-privateas": "FALSE",
"resetreason": "No error",
"resettime": "never",
"rtrefreshrecvd": "0",
"rtrefreshsent": "0",
"sentbytesoutstanding": "19",
"state": "Established",
"up": "TRUE",
"updatesrecvd": "3",
"updatessent": "4",
"version": "4"
},
{
"TABLE_addpathscapaf": {
"ROW_addpathscapaf": {
"TABLE_addpathscapsaf": {
"ROW_addpathscapsaf": {
"addpathscap-safi": "1",
"addpathsrecvcap-adv": "TRUE",
"addpathsrecvcap-recv": "FALSE",
"addpathssendcap-adv": "TRUE",
"addpathssendcap-recv": "FALSE"
}
},
"addpathscap-afi": "1"
}
},
"TABLE_af": {
"ROW_af": {
"TABLE_saf": {
"ROW_saf": {
"af-advertised": "TRUE",
"af-name": "IPv4 Unicast",
"af-recvd": "TRUE",
"af-safi": "1"
}
},
"af-afi": "1"
}
},
"TABLE_graf": {
"ROW_graf": {
"TABLE_grsaf": {
"ROW_grsaf": {
"gr-adv": "TRUE",
"gr-af-name": "IPv4 Unicast",
"gr-fwd": "FALSE",
"gr-recv": "TRUE",
"gr-safi": "1"
}
},
"gr-afi": "1"
}
},
"TABLE_inpolicy": {
"ROW_inpolicy": {
"inpolicyhandle": "TRUE",
"inpolicyname": "RM-LSL-IN",
"inpolicynr": "2",
"inpolicytype": "route-map"
}
},
"TABLE_outpolicy": {
"ROW_outpolicy": {
"outpolicyhandle": "TRUE",
"outpolicyname": "RM-LSL-OUT",
"outpolicynr": "2",
"outpolicytype": "route-map"
}
},
"TABLE_peraf": [
{
"ROW_peraf": {
"TABLE_persaf": {
"ROW_persaf": {
"firstupdrecv": "P12DT14H37M54S",
"firstupdsent": "P12DT14H37M54S",
"lastupdrecv": "P12DT14H37M42S",
"lastupdsent": "P12DT14H37M49S",
"neighbortableversion": "42",
"per-safi": "1",
"pfxbytes": "448",
"pfxrecvd": "8",
"pfxsent": "5",
"sendcommunity": "TRUE",
"sendextcommunity": "TRUE",
"srpermitted": "TRUE",
"tableversion": "42"
}
},
"per-afi": "1"
}
},
{
"ROW_peraf": {
"TABLE_persaf": {
"ROW_persaf": {
"lastgrEORtime": "PT1S"
}
}
}
}
],
"bytesrecvd": "20459058",
"bytessent": "20428427",
"capabilitiesrecvd": "0",
"capabilitiessent": "0",
"capaddpathsadvertised": "TRUE",
"capaddpathsrecvd": "FALSE",
"capas4advertised": "TRUE",
"capas4recvd": "TRUE",
"capgradvertised": "TRUE",
"capgrrecvd": "TRUE",
"capmpadvertised": "TRUE",
"capmprecvd": "TRUE",
"capolddynamicadvertised": "TRUE",
"capolddynamicrecvd": "TRUE",
"capoldrradvertised": "TRUE",
"capoldrrrecvd": "TRUE",
"caprefreshadvertised": "TRUE",
"caprefreshrecvd": "TRUE",
"caprradvertised": "TRUE",
"caprrrecvd": "TRUE",
"capsnegotiated": "FALSE",
"connectedif": "Ethernet1/4",
"connsdropped": "0",
"connsestablished": "1",
"elapsedtime": "1w5d",
"fd": "45",
"firstkeepalive": "FALSE",
"grrecvdrestarttime": "120",
"grrestarttime": "120",
"grstaletime": "300",
"holdtime": "3",
"index": "4",
"ipv6nhencodcapaf": "IPv4 Unicast",
"keepalive": "0.993353",
"keepaliverecvd": "1076785",
"keepalivesent": "1075165",
"keepalivetime": "1",
"lastread": "0.770285",
"lastwrite": "00:00:01",
"link": "ebgp",
"localaddr": "10.100.157.10",
"localas": "",
"localport": "179",
"msgrecvd": "1076789",
"msgsent": "1075172",
"neighbor": "10.100.157.9",
"notificationsrcvd": "0",
"notificationssent": "0",
"notifsrecvd": "0",
"notifssent": "0",
"opensrecvd": "1",
"openssent": "1",
"peerresetreason": "No error",
"peerresettime": "never",
"recvbufbytes": "0",
"remote-id": "7.57.255.1",
"remoteaddr": "10.100.157.9",
"remoteas": "65059",
"remoteport": "14083",
"remove-privateas": "FALSE",
"resetreason": "No error",
"resettime": "never",
"rtrefreshrecvd": "0",
"rtrefreshsent": "0",
"sentbytesoutstanding": "19",
"state": "Established",
"up": "TRUE",
"updatesrecvd": "3",
"updatessent": "6",
"version": "4"
},
{
"TABLE_peraf": {
"ROW_peraf": {
"TABLE_persaf": {
"ROW_persaf": {
"firstupdrecv": "never",
"firstupdsent": "never",
"lastupdrecv": "never",
"lastupdsent": "never",
"neighbortableversion": "0",
"per-safi": "1",
"pfxbytes": "0",
"pfxrecvd": "0",
"pfxsent": "0",
"srpermitted": "FALSE",
"tableversion": "42"
}
},
"per-afi": "1"
}
},
"bytesrecvd": "0",
"bytessent": "0",
"capabilitiesrecvd": "0",
"capabilitiessent": "0",
"connattempts": "14454",
"connsdropped": "0",
"connsestablished": "0",
"elapsedtime": "1w5d",
"firstkeepalive": "FALSE",
"holdtime": "3",
"index": "5",
"keepaliverecvd": "0",
"keepalivesent": "0",
"keepalivetime": "1",
"lastread": "never",
"lastwrite": "never",
"link": "ebgp",
"localas": "",
"msgrecvd": "0",
"msgsent": "0",
"neighbor": "89.1.1.10",
"notificationsrcvd": "0",
"notificationssent": "0",
"notifsrecvd": "0",
"notifssent": "0",
"opensrecvd": "0",
"openssent": "0",
"peerresetreason": "No error",
"peerresettime": "never",
"recvbufbytes": "0",
"remote-id": "0.0.0.0",
"remoteas": "1001",
"remove-privateas": "FALSE",
"resetreason": "No error",
"resettime": "never",
"restarttime": "00:00:06",
"rtrefreshrecvd": "0",
"rtrefreshsent": "0",
"sentbytesoutstanding": "0",
"state": "Idle",
"up": "FALSE",
"updatesrecvd": "0",
"updatessent": "0",
"version": "4"
},
{
"TABLE_peraf": {
"ROW_peraf": {
"TABLE_persaf": {
"ROW_persaf": {
"firstupdrecv": "never",
"firstupdsent": "never",
"lastupdrecv": "never",
"lastupdsent": "never",
"neighbortableversion": "0",
"per-safi": "1",
"pfxbytes": "0",
"pfxrecvd": "0",
"pfxsent": "0",
"srpermitted": "FALSE",
"tableversion": "42"
}
},
"per-afi": "1"
}
},
"bytesrecvd": "0",
"bytessent": "0",
"capabilitiesrecvd": "0",
"capabilitiessent": "0",
"connattempts": "14472",
"connsdropped": "0",
"connsestablished": "0",
"elapsedtime": "1w5d",
"firstkeepalive": "FALSE",
"holdtime": "3",
"index": "6",
"keepaliverecvd": "0",
"keepalivesent": "0",
"keepalivetime": "1",
"lastread": "never",
"lastwrite": "never",
"link": "ebgp",
"localas": "",
"msgrecvd": "0",
"msgsent": "0",
"neighbor": "89.1.2.10",
"notificationsrcvd": "0",
"notificationssent": "0",
"notifsrecvd": "0",
"notifssent": "0",
"opensrecvd": "0",
"openssent": "0",
"peerresetreason": "No error",
"peerresettime": "never",
"recvbufbytes": "0",
"remote-id": "0.0.0.0",
"remoteas": "1002",
"remove-privateas": "FALSE",
"resetreason": "No error",
"resettime": "never",
"restarttime": "00:00:01",
"rtrefreshrecvd": "0",
"rtrefreshsent": "0",
"sentbytesoutstanding": "0",
"state": "Idle",
"up": "FALSE",
"updatesrecvd": "0",
"updatessent": "0",
"version": "4"
},
{
"TABLE_peraf": {
"ROW_peraf": {
"TABLE_persaf": {
"ROW_persaf": {
"firstupdrecv": "never",
"firstupdsent": "never",
"lastupdrecv": "never",
"lastupdsent": "never",
"neighbortableversion": "0",
"per-safi": "1",
"pfxbytes": "0",
"pfxrecvd": "0",
"pfxsent": "0",
"srpermitted": "FALSE",
"tableversion": "42"
}
},
"per-afi": "1"
}
},
"bytesrecvd": "0",
"bytessent": "0",
"capabilitiesrecvd": "0",
"capabilitiessent": "0",
"connattempts": "14450",
"connsdropped": "0",
"connsestablished": "0",
"elapsedtime": "1w5d",
"firstkeepalive": "FALSE",
"holdtime": "3",
"index": "7",
"keepaliverecvd": "0",
"keepalivesent": "0",
"keepalivetime": "1",
"lastread": "never",
"lastwrite": "never",
"link": "ebgp",
"localas": "",
"msgrecvd": "0",
"msgsent": "0",
"neighbor": "89.1.3.10",
"notificationsrcvd": "0",
"notificationssent": "0",
"notifsrecvd": "0",
"notifssent": "0",
"opensrecvd": "0",
"openssent": "0",
"peerresetreason": "No error",
"peerresettime": "never",
"recvbufbytes": "0",
"remote-id": "0.0.0.0",
"remoteas": "1003",
"remove-privateas": "FALSE",
"resetreason": "No error",
"resettime": "never",
"restarttime": "00:01:27",
"rtrefreshrecvd": "0",
"rtrefreshsent": "0",
"sentbytesoutstanding": "0",
"state": "Idle",
"up": "FALSE",
"updatesrecvd": "0",
"updatessent": "0",
"version": "4"
},
{
"TABLE_peraf": {
"ROW_peraf": {
"TABLE_persaf": {
"ROW_persaf": {
"firstupdrecv": "never",
"firstupdsent": "never",
"lastupdrecv": "never",
"lastupdsent": "never",
"neighbortableversion": "0",
"per-safi": "1",
"pfxbytes": "0",
"pfxrecvd": "0",
"pfxsent": "0",
"srpermitted": "FALSE",
"tableversion": "42"
}
},
"per-afi": "1"
}
},
"bytesrecvd": "0",
"bytessent": "0",
"capabilitiesrecvd": "0",
"capabilitiessent": "0",
"connattempts": "14461",
"connsdropped": "0",
"connsestablished": "0",
"elapsedtime": "1w5d",
"firstkeepalive": "FALSE",
"holdtime": "3",
"index": "8",
"keepaliverecvd": "0",
"keepalivesent": "0",
"keepalivetime": "1",
"lastread": "never",
"lastwrite": "never",
"link": "ebgp",
"localas": "",
"msgrecvd": "0",
"msgsent": "0",
"neighbor": "89.1.4.10",
"notificationsrcvd": "0",
"notificationssent": "0",
"notifsrecvd": "0",
"notifssent": "0",
"opensrecvd": "0",
"openssent": "0",
"peerresetreason": "No error",
"peerresettime": "never",
"recvbufbytes": "0",
"remote-id": "0.0.0.0",
"remoteas": "1004",
"remove-privateas": "FALSE",
"resetreason": "No error",
"resettime": "never",
"restarttime": "00:00:27",
"rtrefreshrecvd": "0",
"rtrefreshsent": "0",
"sentbytesoutstanding": "0",
"state": "Idle",
"up": "FALSE",
"updatesrecvd": "0",
"updatessent": "0",
"version": "4"
}
]
}
},
"code": "200",
"input": "show bgp ip unicast neighbors",
"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 bgp ip unicast neighbors command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 6.0(2)A8(8).
| CLI Output |
|---|
|
show bgp ip unicast neighbors vrf default
show bgp ip unicast neighbors vrf default
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 bgp ip unicast neighbors vrf default",
"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_neighbor": {
"ROW_neighbor": [
{
"TABLE_peraf": {
"ROW_peraf": {
"TABLE_persaf": {
"ROW_persaf": {
"firstupdrecv": "never",
"firstupdsent": "never",
"lastupdrecv": "never",
"lastupdsent": "never",
"neighbortableversion": "0",
"per-safi": "1",
"pfxbytes": "0",
"pfxrecvd": "0",
"pfxsent": "0",
"srpermitted": "FALSE",
"tableversion": "42",
"thirdpartynexthop": "FALSE"
}
},
"per-afi": "1"
}
},
"bytesrecvd": "0",
"bytessent": "0",
"capabilitiesrecvd": "0",
"capabilitiessent": "0",
"connattempts": "10374",
"connsdropped": "0",
"connsestablished": "0",
"description": "REX",
"elapsedtime": "1w5d",
"firstkeepalive": "FALSE",
"holdtime": "3",
"index": "1",
"keepaliverecvd": "0",
"keepalivesent": "0",
"keepalivetime": "1",
"lastread": "never",
"lastwrite": "never",
"link": "ibgp",
"localas": "",
"msgrecvd": "0",
"msgsent": "0",
"neighbor": "10.40.100.57",
"notificationsrcvd": "0",
"notificationssent": "0",
"notifsrecvd": "0",
"notifssent": "0",
"opensrecvd": "0",
"openssent": "0",
"peerresetreason": "No error",
"peerresettime": "never",
"recvbufbytes": "0",
"remote-id": "0.0.0.0",
"remoteas": "65057",
"remove-privateas": "FALSE",
"resetreason": "No error",
"resettime": "never",
"restarttime": "00:00:50",
"rtrefreshrecvd": "0",
"rtrefreshsent": "0",
"sentbytesoutstanding": "0",
"sourceif": "loopback0",
"state": "Idle",
"up": "FALSE",
"updatesrecvd": "0",
"updatessent": "0",
"version": "4"
},
{
"TABLE_inpolicy": {
"ROW_inpolicy": {
"inpolicyhandle": "TRUE",
"inpolicyname": "RM-MIL-IN",
"inpolicynr": "2",
"inpolicytype": "route-map"
}
},
"TABLE_outpolicy": {
"ROW_outpolicy": {
"outpolicyhandle": "TRUE",
"outpolicyname": "RM-MIL-OUT",
"outpolicynr": "2",
"outpolicytype": "route-map"
}
},
"TABLE_peraf": {
"ROW_peraf": {
"TABLE_persaf": {
"ROW_persaf": {
"firstupdrecv": "never",
"firstupdsent": "never",
"lastupdrecv": "never",
"lastupdsent": "never",
"neighbortableversion": "0",
"per-safi": "1",
"pfxbytes": "0",
"pfxrecvd": "0",
"pfxsent": "0",
"sendcommunity": "TRUE",
"sendextcommunity": "TRUE",
"srpermitted": "TRUE",
"tableversion": "42"
}
},
"per-afi": "1"
}
},
"bytesrecvd": "0",
"bytessent": "0",
"capabilitiesrecvd": "0",
"capabilitiessent": "0",
"connattempts": "14486",
"connsdropped": "0",
"connsestablished": "0",
"elapsedtime": "1w5d",
"firstkeepalive": "FALSE",
"holdtime": "3",
"index": "2",
"keepaliverecvd": "0",
"keepalivesent": "0",
"keepalivetime": "1",
"lastread": "never",
"lastwrite": "never",
"link": "ebgp",
"localas": "",
"msgrecvd": "0",
"msgsent": "0",
"neighbor": "10.100.90.130",
"notificationsrcvd": "0",
"notificationssent": "0",
"notifsrecvd": "0",
"notifssent": "0",
"opensrecvd": "0",
"openssent": "0",
"peerresetreason": "No error",
"peerresettime": "never",
"recvbufbytes": "0",
"remote-id": "0.0.0.0",
"remoteas": "300",
"remove-privateas": "FALSE",
"resetreason": "No error",
"resettime": "never",
"restarttime": "00:00:15",
"rtrefreshrecvd": "0",
"rtrefreshsent": "0",
"sentbytesoutstanding": "0",
"state": "Idle",
"up": "FALSE",
"updatesrecvd": "0",
"updatessent": "0",
"version": "4"
},
{
"TABLE_addpathscapaf": {
"ROW_addpathscapaf": {
"TABLE_addpathscapsaf": {
"ROW_addpathscapsaf": {
"addpathscap-safi": "1",
"addpathsrecvcap-adv": "TRUE",
"addpathsrecvcap-recv": "FALSE",
"addpathssendcap-adv": "TRUE",
"addpathssendcap-recv": "FALSE"
}
},
"addpathscap-afi": "1"
}
},
"TABLE_af": {
"ROW_af": {
"TABLE_saf": {
"ROW_saf": {
"af-advertised": "TRUE",
"af-name": "IPv4 Unicast",
"af-recvd": "TRUE",
"af-safi": "1"
}
},
"af-afi": "1"
}
},
"TABLE_graf": {
"ROW_graf": {
"TABLE_grsaf": {
"ROW_grsaf": {
"gr-adv": "TRUE",
"gr-af-name": "IPv4 Unicast",
"gr-fwd": "FALSE",
"gr-recv": "TRUE",
"gr-safi": "1"
}
},
"gr-afi": "1"
}
},
"TABLE_peraf": {
"ROW_peraf": {
"TABLE_persaf": {
"ROW_persaf": {
"firstupdrecv": "P12DT14H37M56S",
"firstupdsent": "P12DT14H37M56S",
"lastgrEORtime": "PT1S",
"lastupdrecv": "P12DT14H37M46S",
"lastupdsent": "P12DT14H37M52S",
"neighbortableversion": "42",
"per-safi": "1",
"pfxbytes": "448",
"pfxrecvd": "8",
"pfxsent": "5",
"sendcommunity": "TRUE",
"sendextcommunity": "TRUE",
"srpermitted": "TRUE",
"tableversion": "42"
}
},
"per-afi": "1"
}
},
"bytesrecvd": "20459134",
"bytessent": "20428370",
"capabilitiesrecvd": "0",
"capabilitiessent": "0",
"capaddpathsadvertised": "TRUE",
"capaddpathsrecvd": "FALSE",
"capas4advertised": "TRUE",
"capas4recvd": "TRUE",
"capgradvertised": "TRUE",
"capgrrecvd": "TRUE",
"capmpadvertised": "TRUE",
"capmprecvd": "TRUE",
"capolddynamicadvertised": "TRUE",
"capolddynamicrecvd": "TRUE",
"capoldrradvertised": "TRUE",
"capoldrrrecvd": "TRUE",
"caprefreshadvertised": "TRUE",
"caprefreshrecvd": "TRUE",
"caprradvertised": "TRUE",
"caprrrecvd": "TRUE",
"capsnegotiated": "FALSE",
"connectedif": "Ethernet1/2",
"connsdropped": "0",
"connsestablished": "1",
"elapsedtime": "1w5d",
"fd": "49",
"firstkeepalive": "FALSE",
"grrecvdrestarttime": "120",
"grrestarttime": "120",
"grstaletime": "300",
"holdtime": "3",
"index": "3",
"ipv6nhencodcapaf": "IPv4 Unicast",
"keepalive": "0.636240",
"keepaliverecvd": "1076789",
"keepalivesent": "1075168",
"keepalivetime": "1",
"lastread": "0.126538",
"lastwrite": "0.363238",
"link": "ebgp",
"localaddr": "10.100.157.2",
"localas": "",
"localport": "179",
"msgrecvd": "1076793",
"msgsent": "1075173",
"neighbor": "10.100.157.1",
"notificationsrcvd": "0",
"notificationssent": "0",
"notifsrecvd": "0",
"notifssent": "0",
"opensrecvd": "1",
"openssent": "1",
"peerresetreason": "No error",
"peerresettime": "never",
"recvbufbytes": "0",
"remote-id": "7.57.255.1",
"remoteaddr": "10.100.157.1",
"remoteas": "65059",
"remoteport": "14258",
"remove-privateas": "FALSE",
"resetreason": "No error",
"resettime": "never",
"rtrefreshrecvd": "0",
"rtrefreshsent": "0",
"sentbytesoutstanding": "0",
"state": "Established",
"up": "TRUE",
"updatesrecvd": "3",
"updatessent": "4",
"version": "4"
},
{
"TABLE_addpathscapaf": {
"ROW_addpathscapaf": {
"TABLE_addpathscapsaf": {
"ROW_addpathscapsaf": {
"addpathscap-safi": "1",
"addpathsrecvcap-adv": "TRUE",
"addpathsrecvcap-recv": "FALSE",
"addpathssendcap-adv": "TRUE",
"addpathssendcap-recv": "FALSE"
}
},
"addpathscap-afi": "1"
}
},
"TABLE_af": {
"ROW_af": {
"TABLE_saf": {
"ROW_saf": {
"af-advertised": "TRUE",
"af-name": "IPv4 Unicast",
"af-recvd": "TRUE",
"af-safi": "1"
}
},
"af-afi": "1"
}
},
"TABLE_graf": {
"ROW_graf": {
"TABLE_grsaf": {
"ROW_grsaf": {
"gr-adv": "TRUE",
"gr-af-name": "IPv4 Unicast",
"gr-fwd": "FALSE",
"gr-recv": "TRUE",
"gr-safi": "1"
}
},
"gr-afi": "1"
}
},
"TABLE_inpolicy": {
"ROW_inpolicy": {
"inpolicyhandle": "TRUE",
"inpolicyname": "RM-LSL-IN",
"inpolicynr": "2",
"inpolicytype": "route-map"
}
},
"TABLE_outpolicy": {
"ROW_outpolicy": {
"outpolicyhandle": "TRUE",
"outpolicyname": "RM-LSL-OUT",
"outpolicynr": "2",
"outpolicytype": "route-map"
}
},
"TABLE_peraf": [
{
"ROW_peraf": {
"TABLE_persaf": {
"ROW_persaf": {
"firstupdrecv": "P12DT14H37M57S",
"firstupdsent": "P12DT14H37M57S",
"lastupdrecv": "P12DT14H37M46S",
"lastupdsent": "P12DT14H37M52S",
"neighbortableversion": "42",
"per-safi": "1",
"pfxbytes": "448",
"pfxrecvd": "8",
"pfxsent": "5",
"sendcommunity": "TRUE",
"sendextcommunity": "TRUE",
"srpermitted": "TRUE",
"tableversion": "42"
}
},
"per-afi": "1"
}
},
{
"ROW_peraf": {
"TABLE_persaf": {
"ROW_persaf": {
"lastgrEORtime": "PT1S"
}
}
}
}
],
"bytesrecvd": "20459134",
"bytessent": "20428503",
"capabilitiesrecvd": "0",
"capabilitiessent": "0",
"capaddpathsadvertised": "TRUE",
"capaddpathsrecvd": "FALSE",
"capas4advertised": "TRUE",
"capas4recvd": "TRUE",
"capgradvertised": "TRUE",
"capgrrecvd": "TRUE",
"capmpadvertised": "TRUE",
"capmprecvd": "TRUE",
"capolddynamicadvertised": "TRUE",
"capolddynamicrecvd": "TRUE",
"capoldrradvertised": "TRUE",
"capoldrrrecvd": "TRUE",
"caprefreshadvertised": "TRUE",
"caprefreshrecvd": "TRUE",
"caprradvertised": "TRUE",
"caprrrecvd": "TRUE",
"capsnegotiated": "FALSE",
"connectedif": "Ethernet1/4",
"connsdropped": "0",
"connsestablished": "1",
"elapsedtime": "1w5d",
"fd": "45",
"firstkeepalive": "FALSE",
"grrecvdrestarttime": "120",
"grrestarttime": "120",
"grstaletime": "300",
"holdtime": "3",
"index": "4",
"ipv6nhencodcapaf": "IPv4 Unicast",
"keepalive": "0.635827",
"keepaliverecvd": "1076789",
"keepalivesent": "1075168",
"keepalivetime": "1",
"lastread": "0.126939",
"lastwrite": "0.363369",
"link": "ebgp",
"localaddr": "10.100.157.10",
"localas": "",
"localport": "179",
"msgrecvd": "1076793",
"msgsent": "1075175",
"neighbor": "10.100.157.9",
"notificationsrcvd": "0",
"notificationssent": "0",
"notifsrecvd": "0",
"notifssent": "0",
"opensrecvd": "1",
"openssent": "1",
"peerresetreason": "No error",
"peerresettime": "never",
"recvbufbytes": "0",
"remote-id": "7.57.255.1",
"remoteaddr": "10.100.157.9",
"remoteas": "65059",
"remoteport": "14083",
"remove-privateas": "FALSE",
"resetreason": "No error",
"resettime": "never",
"rtrefreshrecvd": "0",
"rtrefreshsent": "0",
"sentbytesoutstanding": "0",
"state": "Established",
"up": "TRUE",
"updatesrecvd": "3",
"updatessent": "6",
"version": "4"
},
{
"TABLE_peraf": {
"ROW_peraf": {
"TABLE_persaf": {
"ROW_persaf": {
"firstupdrecv": "never",
"firstupdsent": "never",
"lastupdrecv": "never",
"lastupdsent": "never",
"neighbortableversion": "0",
"per-safi": "1",
"pfxbytes": "0",
"pfxrecvd": "0",
"pfxsent": "0",
"srpermitted": "FALSE",
"tableversion": "42"
}
},
"per-afi": "1"
}
},
"bytesrecvd": "0",
"bytessent": "0",
"capabilitiesrecvd": "0",
"capabilitiessent": "0",
"connattempts": "14454",
"connsdropped": "0",
"connsestablished": "0",
"elapsedtime": "1w5d",
"firstkeepalive": "FALSE",
"holdtime": "3",
"index": "5",
"keepaliverecvd": "0",
"keepalivesent": "0",
"keepalivetime": "1",
"lastread": "never",
"lastwrite": "never",
"link": "ebgp",
"localas": "",
"msgrecvd": "0",
"msgsent": "0",
"neighbor": "89.1.1.10",
"notificationsrcvd": "0",
"notificationssent": "0",
"notifsrecvd": "0",
"notifssent": "0",
"opensrecvd": "0",
"openssent": "0",
"peerresetreason": "No error",
"peerresettime": "never",
"recvbufbytes": "0",
"remote-id": "0.0.0.0",
"remoteas": "1001",
"remove-privateas": "FALSE",
"resetreason": "No error",
"resettime": "never",
"restarttime": "00:00:03",
"rtrefreshrecvd": "0",
"rtrefreshsent": "0",
"sentbytesoutstanding": "0",
"state": "Idle",
"up": "FALSE",
"updatesrecvd": "0",
"updatessent": "0",
"version": "4"
},
{
"TABLE_peraf": {
"ROW_peraf": {
"TABLE_persaf": {
"ROW_persaf": {
"firstupdrecv": "never",
"firstupdsent": "never",
"lastupdrecv": "never",
"lastupdsent": "never",
"neighbortableversion": "0",
"per-safi": "1",
"pfxbytes": "0",
"pfxrecvd": "0",
"pfxsent": "0",
"srpermitted": "FALSE",
"tableversion": "42"
}
},
"per-afi": "1"
}
},
"bytesrecvd": "0",
"bytessent": "0",
"capabilitiesrecvd": "0",
"capabilitiessent": "0",
"connattempts": "14473",
"connsdropped": "0",
"connsestablished": "0",
"elapsedtime": "1w5d",
"firstkeepalive": "FALSE",
"holdtime": "3",
"index": "6",
"keepaliverecvd": "0",
"keepalivesent": "0",
"keepalivetime": "1",
"lastread": "never",
"lastwrite": "never",
"link": "ebgp",
"localas": "",
"msgrecvd": "0",
"msgsent": "0",
"neighbor": "89.1.2.10",
"notificationsrcvd": "0",
"notificationssent": "0",
"notifsrecvd": "0",
"notifssent": "0",
"opensrecvd": "0",
"openssent": "0",
"peerresetreason": "No error",
"peerresettime": "never",
"recvbufbytes": "0",
"remote-id": "0.0.0.0",
"remoteas": "1002",
"remove-privateas": "FALSE",
"resetreason": "No error",
"resettime": "never",
"restarttime": "00:01:21",
"rtrefreshrecvd": "0",
"rtrefreshsent": "0",
"sentbytesoutstanding": "0",
"state": "Idle",
"up": "FALSE",
"updatesrecvd": "0",
"updatessent": "0",
"version": "4"
},
{
"TABLE_peraf": {
"ROW_peraf": {
"TABLE_persaf": {
"ROW_persaf": {
"firstupdrecv": "never",
"firstupdsent": "never",
"lastupdrecv": "never",
"lastupdsent": "never",
"neighbortableversion": "0",
"per-safi": "1",
"pfxbytes": "0",
"pfxrecvd": "0",
"pfxsent": "0",
"srpermitted": "FALSE",
"tableversion": "42"
}
},
"per-afi": "1"
}
},
"bytesrecvd": "0",
"bytessent": "0",
"capabilitiesrecvd": "0",
"capabilitiessent": "0",
"connattempts": "14450",
"connsdropped": "0",
"connsestablished": "0",
"elapsedtime": "1w5d",
"firstkeepalive": "FALSE",
"holdtime": "3",
"index": "7",
"keepaliverecvd": "0",
"keepalivesent": "0",
"keepalivetime": "1",
"lastread": "never",
"lastwrite": "never",
"link": "ebgp",
"localas": "",
"msgrecvd": "0",
"msgsent": "0",
"neighbor": "89.1.3.10",
"notificationsrcvd": "0",
"notificationssent": "0",
"notifsrecvd": "0",
"notifssent": "0",
"opensrecvd": "0",
"openssent": "0",
"peerresetreason": "No error",
"peerresettime": "never",
"recvbufbytes": "0",
"remote-id": "0.0.0.0",
"remoteas": "1003",
"remove-privateas": "FALSE",
"resetreason": "No error",
"resettime": "never",
"restarttime": "00:01:24",
"rtrefreshrecvd": "0",
"rtrefreshsent": "0",
"sentbytesoutstanding": "0",
"state": "Idle",
"up": "FALSE",
"updatesrecvd": "0",
"updatessent": "0",
"version": "4"
},
{
"TABLE_peraf": {
"ROW_peraf": {
"TABLE_persaf": {
"ROW_persaf": {
"firstupdrecv": "never",
"firstupdsent": "never",
"lastupdrecv": "never",
"lastupdsent": "never",
"neighbortableversion": "0",
"per-safi": "1",
"pfxbytes": "0",
"pfxrecvd": "0",
"pfxsent": "0",
"srpermitted": "FALSE",
"tableversion": "42"
}
},
"per-afi": "1"
}
},
"bytesrecvd": "0",
"bytessent": "0",
"capabilitiesrecvd": "0",
"capabilitiessent": "0",
"connattempts": "14461",
"connsdropped": "0",
"connsestablished": "0",
"elapsedtime": "1w5d",
"firstkeepalive": "FALSE",
"holdtime": "3",
"index": "8",
"keepaliverecvd": "0",
"keepalivesent": "0",
"keepalivetime": "1",
"lastread": "never",
"lastwrite": "never",
"link": "ebgp",
"localas": "",
"msgrecvd": "0",
"msgsent": "0",
"neighbor": "89.1.4.10",
"notificationsrcvd": "0",
"notificationssent": "0",
"notifsrecvd": "0",
"notifssent": "0",
"opensrecvd": "0",
"openssent": "0",
"peerresetreason": "No error",
"peerresettime": "never",
"recvbufbytes": "0",
"remote-id": "0.0.0.0",
"remoteas": "1004",
"remove-privateas": "FALSE",
"resetreason": "No error",
"resettime": "never",
"restarttime": "00:00:23",
"rtrefreshrecvd": "0",
"rtrefreshsent": "0",
"sentbytesoutstanding": "0",
"state": "Idle",
"up": "FALSE",
"updatesrecvd": "0",
"updatessent": "0",
"version": "4"
}
]
}
},
"code": "200",
"input": "show bgp ip unicast neighbors vrf default",
"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 bgp ip unicast neighbors vrf default command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 6.0(2)A8(8).
| CLI Output |
|---|
|
show bgp ip unicast nexthop 10.100.157.1
show bgp ip unicast nexthop 10.100.157.1
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 bgp ip unicast nexthop 10.100.157.1",
"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_vrf": {
"ROW_vrf": {
"TABLE_afi": {
"ROW_afi": {
"TABLE_safi": {
"ROW_safi": {
"TABLE_prefix": {
"ROW_prefix": [
{
"TABLE_path": {
"ROW_path": {
"aspath": "65059",
"best": "non-bestpath",
"bestcode": {},
"ipnexthop-out": "10.100.157.1",
"localpref": "",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
}
},
"ipprefix": "7.57.0.0/16"
},
{
"TABLE_path": {
"ROW_path": {
"aspath": "65059",
"best": "non-bestpath",
"bestcode": "&",
"ipnexthop-out": "10.100.157.1",
"localpref": "",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
}
},
"ipprefix": "7.57.255.1/32"
},
{
"TABLE_path": {
"ROW_path": {
"aspath": "65059",
"best": "non-bestpath",
"bestcode": {},
"ipnexthop-out": "10.100.157.1",
"localpref": "",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
}
},
"ipprefix": "10.57.0.0/16"
},
{
"TABLE_path": {
"ROW_path": {
"aspath": "65059",
"best": "non-bestpath",
"bestcode": "&",
"ipnexthop-out": "10.100.157.1",
"localpref": "",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
}
},
"ipprefix": "10.57.50.0/24"
},
{
"TABLE_path": {
"ROW_path": {
"aspath": "65059",
"best": "non-bestpath",
"bestcode": {},
"ipnexthop-out": "10.100.157.1",
"localpref": "",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
}
},
"ipprefix": "10.100.90.128/30"
},
{
"TABLE_path": {
"ROW_path": {
"aspath": "65059",
"best": "non-bestpath",
"bestcode": {},
"ipnexthop-out": "10.100.157.1",
"localpref": "",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
}
},
"ipprefix": "10.100.157.0/30"
},
{
"TABLE_path": {
"ROW_path": {
"aspath": "65059",
"best": "non-bestpath",
"bestcode": {},
"ipnexthop-out": "10.100.157.1",
"localpref": "",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
}
},
"ipprefix": "10.100.157.8/30"
},
{
"TABLE_path": {
"ROW_path": {
"aspath": "65059",
"best": "non-bestpath",
"bestcode": "&",
"ipnexthop-out": "10.100.157.1",
"localpref": "",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
}
},
"ipprefix": "33.33.33.33/32"
}
]
},
"af-name": "IPv4 Unicast",
"router-id": "7.57.255.2",
"safi": "1",
"table-version": "42"
}
},
"afi": "1"
}
},
"vrf-name-out": "default"
}
}
},
"code": "200",
"input": "show bgp ip unicast nexthop 10.100.157.1",
"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 bgp ip unicast nexthop 10.100.157.1 command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 6.0(2)A8(8).
| CLI Output |
|---|
|
show bgp ip unicast nexthop 10.100.157.1 vrf default
show bgp ip unicast nexthop 10.100.157.1 vrf default
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 bgp ip unicast nexthop 10.100.157.1 vrf default",
"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_vrf": {
"ROW_vrf": {
"TABLE_afi": {
"ROW_afi": {
"TABLE_safi": {
"ROW_safi": {
"TABLE_prefix": {
"ROW_prefix": [
{
"TABLE_path": {
"ROW_path": {
"aspath": "65059",
"best": "non-bestpath",
"bestcode": {},
"ipnexthop-out": "10.100.157.1",
"localpref": "",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
}
},
"ipprefix": "7.57.0.0/16"
},
{
"TABLE_path": {
"ROW_path": {
"aspath": "65059",
"best": "non-bestpath",
"bestcode": "&",
"ipnexthop-out": "10.100.157.1",
"localpref": "",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
}
},
"ipprefix": "7.57.255.1/32"
},
{
"TABLE_path": {
"ROW_path": {
"aspath": "65059",
"best": "non-bestpath",
"bestcode": {},
"ipnexthop-out": "10.100.157.1",
"localpref": "",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
}
},
"ipprefix": "10.57.0.0/16"
},
{
"TABLE_path": {
"ROW_path": {
"aspath": "65059",
"best": "non-bestpath",
"bestcode": "&",
"ipnexthop-out": "10.100.157.1",
"localpref": "",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
}
},
"ipprefix": "10.57.50.0/24"
},
{
"TABLE_path": {
"ROW_path": {
"aspath": "65059",
"best": "non-bestpath",
"bestcode": {},
"ipnexthop-out": "10.100.157.1",
"localpref": "",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
}
},
"ipprefix": "10.100.90.128/30"
},
{
"TABLE_path": {
"ROW_path": {
"aspath": "65059",
"best": "non-bestpath",
"bestcode": {},
"ipnexthop-out": "10.100.157.1",
"localpref": "",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
}
},
"ipprefix": "10.100.157.0/30"
},
{
"TABLE_path": {
"ROW_path": {
"aspath": "65059",
"best": "non-bestpath",
"bestcode": {},
"ipnexthop-out": "10.100.157.1",
"localpref": "",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
}
},
"ipprefix": "10.100.157.8/30"
},
{
"TABLE_path": {
"ROW_path": {
"aspath": "65059",
"best": "non-bestpath",
"bestcode": "&",
"ipnexthop-out": "10.100.157.1",
"localpref": "",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
}
},
"ipprefix": "33.33.33.33/32"
}
]
},
"af-name": "IPv4 Unicast",
"router-id": "7.57.255.2",
"safi": "1",
"table-version": "42"
}
},
"afi": "1"
}
},
"vrf-name-out": "default"
}
}
},
"code": "200",
"input": "show bgp ip unicast nexthop 10.100.157.1 vrf default",
"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 bgp ip unicast nexthop 10.100.157.1 vrf default command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 6.0(2)A8(8).
| CLI Output |
|---|
|
show bgp ip unicast summary
show bgp ip unicast summary
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 bgp ip unicast summary",
"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_vrf": {
"ROW_vrf": {
"TABLE_af": {
"ROW_af": {
"TABLE_saf": {
"ROW_saf": {
"TABLE_neighbor": {
"ROW_neighbor": [
{
"inq": "0",
"msgrecvd": "0",
"msgsent": "0",
"neighboras": "65057",
"neighborid": "10.40.100.57",
"neighbortableversion": "0",
"neighborversion": "4",
"outq": "0",
"prefixreceived": "0",
"state": "Idle",
"time": "1w5d"
},
{
"inq": "0",
"msgrecvd": "0",
"msgsent": "0",
"neighboras": " 300",
"neighborid": "10.100.90.130",
"neighbortableversion": "0",
"neighborversion": "4",
"outq": "0",
"prefixreceived": "0",
"state": "Idle",
"time": "1w5d"
},
{
"inq": "0",
"msgrecvd": "1076800",
"msgsent": "1075180",
"neighboras": "65059",
"neighborid": "10.100.157.1",
"neighbortableversion": "42",
"neighborversion": "4",
"outq": "0",
"prefixreceived": "8",
"state": "Established",
"time": "1w5d"
},
{
"inq": "0",
"msgrecvd": "1076800",
"msgsent": "1075182",
"neighboras": "65059",
"neighborid": "10.100.157.9",
"neighbortableversion": "42",
"neighborversion": "4",
"outq": "0",
"prefixreceived": "8",
"state": "Established",
"time": "1w5d"
},
{
"inq": "0",
"msgrecvd": "0",
"msgsent": "0",
"neighboras": " 1001",
"neighborid": "89.1.1.10",
"neighbortableversion": "0",
"neighborversion": "4",
"outq": "0",
"prefixreceived": "0",
"state": "Idle",
"time": "1w5d"
},
{
"inq": "0",
"msgrecvd": "0",
"msgsent": "0",
"neighboras": " 1002",
"neighborid": "89.1.2.10",
"neighbortableversion": "0",
"neighborversion": "4",
"outq": "0",
"prefixreceived": "0",
"state": "Idle",
"time": "1w5d"
},
{
"inq": "0",
"msgrecvd": "0",
"msgsent": "0",
"neighboras": " 1003",
"neighborid": "89.1.3.10",
"neighbortableversion": "0",
"neighborversion": "4",
"outq": "0",
"prefixreceived": "0",
"state": "Idle",
"time": "1w5d"
},
{
"inq": "0",
"msgrecvd": "0",
"msgsent": "0",
"neighboras": " 1004",
"neighborid": "89.1.4.10",
"neighbortableversion": "0",
"neighborversion": "4",
"outq": "0",
"prefixreceived": "0",
"state": "Idle",
"time": "1w5d"
}
]
},
"af-name": "IPv4 Unicast",
"bytesattrs": "408",
"bytesclusterlist": "0",
"bytescommunities": "0",
"bytespaths": "6",
"capablepeers": "2",
"configuredpeers": "8",
"dampening": "Disabled",
"memoryused": "1736",
"numberattrs": "3",
"numberclusterlist": "0",
"numbercommunities": "0",
"numberpaths": "1",
"safi": "1",
"tableversion": "42",
"totalnetworks": "9",
"totalpaths": "22"
}
},
"af-id": "1"
}
},
"vrf-local-as": "65057",
"vrf-name-out": "default",
"vrf-router-id": "7.57.255.2"
}
}
},
"code": "200",
"input": "show bgp ip unicast summary",
"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 bgp ip unicast summary command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 6.0(2)A8(8).
| CLI Output |
|---|
|
show bgp ip unicast summary vrf default
show bgp ip unicast summary vrf default
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 bgp ip unicast summary vrf default",
"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_vrf": {
"ROW_vrf": {
"TABLE_af": {
"ROW_af": {
"TABLE_saf": {
"ROW_saf": {
"TABLE_neighbor": {
"ROW_neighbor": [
{
"inq": "0",
"msgrecvd": "0",
"msgsent": "0",
"neighboras": "65057",
"neighborid": "10.40.100.57",
"neighbortableversion": "0",
"neighborversion": "4",
"outq": "0",
"prefixreceived": "0",
"state": "Idle",
"time": "1w5d"
},
{
"inq": "0",
"msgrecvd": "0",
"msgsent": "0",
"neighboras": " 300",
"neighborid": "10.100.90.130",
"neighbortableversion": "0",
"neighborversion": "4",
"outq": "0",
"prefixreceived": "0",
"state": "Idle",
"time": "1w5d"
},
{
"inq": "0",
"msgrecvd": "1076802",
"msgsent": "1075182",
"neighboras": "65059",
"neighborid": "10.100.157.1",
"neighbortableversion": "42",
"neighborversion": "4",
"outq": "0",
"prefixreceived": "8",
"state": "Established",
"time": "1w5d"
},
{
"inq": "0",
"msgrecvd": "1076802",
"msgsent": "1075184",
"neighboras": "65059",
"neighborid": "10.100.157.9",
"neighbortableversion": "42",
"neighborversion": "4",
"outq": "0",
"prefixreceived": "8",
"state": "Established",
"time": "1w5d"
},
{
"inq": "0",
"msgrecvd": "0",
"msgsent": "0",
"neighboras": " 1001",
"neighborid": "89.1.1.10",
"neighbortableversion": "0",
"neighborversion": "4",
"outq": "0",
"prefixreceived": "0",
"state": "Idle",
"time": "1w5d"
},
{
"inq": "0",
"msgrecvd": "0",
"msgsent": "0",
"neighboras": " 1002",
"neighborid": "89.1.2.10",
"neighbortableversion": "0",
"neighborversion": "4",
"outq": "0",
"prefixreceived": "0",
"state": "Idle",
"time": "1w5d"
},
{
"inq": "0",
"msgrecvd": "0",
"msgsent": "0",
"neighboras": " 1003",
"neighborid": "89.1.3.10",
"neighbortableversion": "0",
"neighborversion": "4",
"outq": "0",
"prefixreceived": "0",
"state": "Idle",
"time": "1w5d"
},
{
"inq": "0",
"msgrecvd": "0",
"msgsent": "0",
"neighboras": " 1004",
"neighborid": "89.1.4.10",
"neighbortableversion": "0",
"neighborversion": "4",
"outq": "0",
"prefixreceived": "0",
"state": "Idle",
"time": "1w5d"
}
]
},
"af-name": "IPv4 Unicast",
"bytesattrs": "408",
"bytesclusterlist": "0",
"bytescommunities": "0",
"bytespaths": "6",
"capablepeers": "2",
"configuredpeers": "8",
"dampening": "Disabled",
"memoryused": "1736",
"numberattrs": "3",
"numberclusterlist": "0",
"numbercommunities": "0",
"numberpaths": "1",
"safi": "1",
"tableversion": "42",
"totalnetworks": "9",
"totalpaths": "22"
}
},
"af-id": "1"
}
},
"vrf-local-as": "65057",
"vrf-name-out": "default",
"vrf-router-id": "7.57.255.2"
}
}
},
"code": "200",
"input": "show bgp ip unicast summary vrf default",
"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 bgp ip unicast summary vrf default command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 6.0(2)A8(8).
| CLI Output |
|---|
|
show bgp ip unicast vrf all
show bgp ip unicast vrf all
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 bgp ip unicast vrf all",
"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_vrf": {
"ROW_vrf": {
"TABLE_afi": {
"ROW_afi": {
"TABLE_safi": {
"ROW_safi": {
"TABLE_rd": {
"ROW_rd": {
"TABLE_prefix": {
"ROW_prefix": [
{
"TABLE_path": {
"ROW_path": [
{
"aspath": "",
"best": "bestpath",
"bestcode": ">",
"ipnexthop": "0.0.0.0",
"localpref": "100",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "valid",
"statuscode": "*",
"type": "local",
"typecode": "l",
"weight": "32768"
},
{
"aspath": "65059",
"best": "non-bestpath",
"bestcode": {},
"ipnexthop": "10.100.157.1",
"localpref": "",
"metric": "",
"origin": "i",
"pathnr": "1",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
},
{
"aspath": "65059",
"best": "non-bestpath",
"bestcode": "&",
"ipnexthop": "10.100.157.9",
"localpref": "110",
"metric": "",
"origin": "i",
"pathnr": "2",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
}
]
},
"ipprefix": "7.57.0.0/16"
},
{
"TABLE_path": {
"ROW_path": [
{
"aspath": "65059",
"best": "non-bestpath",
"bestcode": "&",
"ipnexthop": "10.100.157.1",
"localpref": "",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
},
{
"aspath": "65059",
"best": "bestpath",
"bestcode": ">",
"ipnexthop": "10.100.157.9",
"localpref": "110",
"metric": "",
"origin": "i",
"pathnr": "1",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
}
]
},
"ipprefix": "7.57.255.1/32"
},
{
"TABLE_path": {
"ROW_path": [
{
"aspath": "",
"best": "bestpath",
"bestcode": ">",
"ipnexthop": "0.0.0.0",
"localpref": "100",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "valid",
"statuscode": "*",
"type": "local",
"typecode": "l",
"weight": "32768"
},
{
"aspath": "65059",
"best": "non-bestpath",
"bestcode": {},
"ipnexthop": "10.100.157.1",
"localpref": "",
"metric": "",
"origin": "i",
"pathnr": "1",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
},
{
"aspath": "65059",
"best": "non-bestpath",
"bestcode": "&",
"ipnexthop": "10.100.157.9",
"localpref": "110",
"metric": "",
"origin": "i",
"pathnr": "2",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
}
]
},
"ipprefix": "10.57.0.0/16"
},
{
"TABLE_path": {
"ROW_path": [
{
"aspath": "65059",
"best": "non-bestpath",
"bestcode": "&",
"ipnexthop": "10.100.157.1",
"localpref": "",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
},
{
"aspath": "65059",
"best": "bestpath",
"bestcode": ">",
"ipnexthop": "10.100.157.9",
"localpref": "110",
"metric": "",
"origin": "i",
"pathnr": "1",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
}
]
},
"ipprefix": "10.57.50.0/24"
},
{
"TABLE_path": {
"ROW_path": [
{
"aspath": "",
"best": "bestpath",
"bestcode": ">",
"ipnexthop": "0.0.0.0",
"localpref": "100",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "valid",
"statuscode": "*",
"type": "local",
"typecode": "l",
"weight": "32768"
},
{
"aspath": "65059",
"best": "non-bestpath",
"bestcode": {},
"ipnexthop": "10.100.157.1",
"localpref": "",
"metric": "",
"origin": "i",
"pathnr": "1",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
},
{
"aspath": "65059",
"best": "non-bestpath",
"bestcode": "&",
"ipnexthop": "10.100.157.9",
"localpref": "110",
"metric": "",
"origin": "i",
"pathnr": "2",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
}
]
},
"ipprefix": "10.100.90.128/30"
},
{
"TABLE_path": {
"ROW_path": [
{
"aspath": "",
"best": "bestpath",
"bestcode": ">",
"ipnexthop": "0.0.0.0",
"localpref": "100",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "valid",
"statuscode": "*",
"type": "local",
"typecode": "l",
"weight": "32768"
},
{
"aspath": "65059",
"best": "non-bestpath",
"bestcode": {},
"ipnexthop": "10.100.157.1",
"localpref": "",
"metric": "",
"origin": "i",
"pathnr": "1",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
},
{
"aspath": "65059",
"best": "non-bestpath",
"bestcode": "&",
"ipnexthop": "10.100.157.9",
"localpref": "110",
"metric": "",
"origin": "i",
"pathnr": "2",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
}
]
},
"ipprefix": "10.100.157.0/30"
},
{
"TABLE_path": {
"ROW_path": [
{
"aspath": "",
"best": "bestpath",
"bestcode": ">",
"ipnexthop": "0.0.0.0",
"localpref": "100",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "valid",
"statuscode": "*",
"type": "local",
"typecode": "l",
"weight": "32768"
},
{
"aspath": "65059",
"best": "non-bestpath",
"bestcode": {},
"ipnexthop": "10.100.157.1",
"localpref": "",
"metric": "",
"origin": "i",
"pathnr": "1",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
},
{
"aspath": "65059",
"best": "non-bestpath",
"bestcode": "&",
"ipnexthop": "10.100.157.9",
"localpref": "110",
"metric": "",
"origin": "i",
"pathnr": "2",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
}
]
},
"ipprefix": "10.100.157.8/30"
},
{
"TABLE_path": {
"ROW_path": {
"aspath": "",
"best": "non-bestpath",
"bestcode": {},
"ipnexthop": "0.0.0.0",
"localpref": "100",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "",
"statuscode": {},
"type": "local",
"typecode": "l",
"weight": "32768"
}
},
"ipprefix": "10.100.166.4/30"
},
{
"TABLE_path": {
"ROW_path": [
{
"aspath": "65059",
"best": "non-bestpath",
"bestcode": "&",
"ipnexthop": "10.100.157.1",
"localpref": "",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
},
{
"aspath": "65059",
"best": "bestpath",
"bestcode": ">",
"ipnexthop": "10.100.157.9",
"localpref": "110",
"metric": "",
"origin": "i",
"pathnr": "1",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
}
]
},
"ipprefix": "33.33.33.33/32"
}
]
}
}
},
"af-name": "IPv4 Unicast",
"router-id": "7.57.255.2",
"safi": "1",
"table-version": "42"
}
},
"afi": "1"
}
},
"vrf-name-out": "default"
}
}
},
"code": "200",
"input": "show bgp ip unicast vrf all",
"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 bgp ip unicast vrf all command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 6.0(2)A8(8).
| CLI Output |
|---|
|
show bgp ip unicast vrf default
show bgp ip unicast vrf default
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 bgp ip unicast vrf default",
"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_vrf": {
"ROW_vrf": {
"TABLE_afi": {
"ROW_afi": {
"TABLE_safi": {
"ROW_safi": {
"TABLE_rd": {
"ROW_rd": {
"TABLE_prefix": {
"ROW_prefix": [
{
"TABLE_path": {
"ROW_path": [
{
"aspath": "",
"best": "bestpath",
"bestcode": ">",
"ipnexthop": "0.0.0.0",
"localpref": "100",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "valid",
"statuscode": "*",
"type": "local",
"typecode": "l",
"weight": "32768"
},
{
"aspath": "65059",
"best": "non-bestpath",
"bestcode": {},
"ipnexthop": "10.100.157.1",
"localpref": "",
"metric": "",
"origin": "i",
"pathnr": "1",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
},
{
"aspath": "65059",
"best": "non-bestpath",
"bestcode": "&",
"ipnexthop": "10.100.157.9",
"localpref": "110",
"metric": "",
"origin": "i",
"pathnr": "2",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
}
]
},
"ipprefix": "7.57.0.0/16"
},
{
"TABLE_path": {
"ROW_path": [
{
"aspath": "65059",
"best": "non-bestpath",
"bestcode": "&",
"ipnexthop": "10.100.157.1",
"localpref": "",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
},
{
"aspath": "65059",
"best": "bestpath",
"bestcode": ">",
"ipnexthop": "10.100.157.9",
"localpref": "110",
"metric": "",
"origin": "i",
"pathnr": "1",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
}
]
},
"ipprefix": "7.57.255.1/32"
},
{
"TABLE_path": {
"ROW_path": [
{
"aspath": "",
"best": "bestpath",
"bestcode": ">",
"ipnexthop": "0.0.0.0",
"localpref": "100",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "valid",
"statuscode": "*",
"type": "local",
"typecode": "l",
"weight": "32768"
},
{
"aspath": "65059",
"best": "non-bestpath",
"bestcode": {},
"ipnexthop": "10.100.157.1",
"localpref": "",
"metric": "",
"origin": "i",
"pathnr": "1",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
},
{
"aspath": "65059",
"best": "non-bestpath",
"bestcode": "&",
"ipnexthop": "10.100.157.9",
"localpref": "110",
"metric": "",
"origin": "i",
"pathnr": "2",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
}
]
},
"ipprefix": "10.57.0.0/16"
},
{
"TABLE_path": {
"ROW_path": [
{
"aspath": "65059",
"best": "non-bestpath",
"bestcode": "&",
"ipnexthop": "10.100.157.1",
"localpref": "",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
},
{
"aspath": "65059",
"best": "bestpath",
"bestcode": ">",
"ipnexthop": "10.100.157.9",
"localpref": "110",
"metric": "",
"origin": "i",
"pathnr": "1",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
}
]
},
"ipprefix": "10.57.50.0/24"
},
{
"TABLE_path": {
"ROW_path": [
{
"aspath": "",
"best": "bestpath",
"bestcode": ">",
"ipnexthop": "0.0.0.0",
"localpref": "100",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "valid",
"statuscode": "*",
"type": "local",
"typecode": "l",
"weight": "32768"
},
{
"aspath": "65059",
"best": "non-bestpath",
"bestcode": {},
"ipnexthop": "10.100.157.1",
"localpref": "",
"metric": "",
"origin": "i",
"pathnr": "1",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
},
{
"aspath": "65059",
"best": "non-bestpath",
"bestcode": "&",
"ipnexthop": "10.100.157.9",
"localpref": "110",
"metric": "",
"origin": "i",
"pathnr": "2",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
}
]
},
"ipprefix": "10.100.90.128/30"
},
{
"TABLE_path": {
"ROW_path": [
{
"aspath": "",
"best": "bestpath",
"bestcode": ">",
"ipnexthop": "0.0.0.0",
"localpref": "100",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "valid",
"statuscode": "*",
"type": "local",
"typecode": "l",
"weight": "32768"
},
{
"aspath": "65059",
"best": "non-bestpath",
"bestcode": {},
"ipnexthop": "10.100.157.1",
"localpref": "",
"metric": "",
"origin": "i",
"pathnr": "1",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
},
{
"aspath": "65059",
"best": "non-bestpath",
"bestcode": "&",
"ipnexthop": "10.100.157.9",
"localpref": "110",
"metric": "",
"origin": "i",
"pathnr": "2",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
}
]
},
"ipprefix": "10.100.157.0/30"
},
{
"TABLE_path": {
"ROW_path": [
{
"aspath": "",
"best": "bestpath",
"bestcode": ">",
"ipnexthop": "0.0.0.0",
"localpref": "100",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "valid",
"statuscode": "*",
"type": "local",
"typecode": "l",
"weight": "32768"
},
{
"aspath": "65059",
"best": "non-bestpath",
"bestcode": {},
"ipnexthop": "10.100.157.1",
"localpref": "",
"metric": "",
"origin": "i",
"pathnr": "1",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
},
{
"aspath": "65059",
"best": "non-bestpath",
"bestcode": "&",
"ipnexthop": "10.100.157.9",
"localpref": "110",
"metric": "",
"origin": "i",
"pathnr": "2",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
}
]
},
"ipprefix": "10.100.157.8/30"
},
{
"TABLE_path": {
"ROW_path": {
"aspath": "",
"best": "non-bestpath",
"bestcode": {},
"ipnexthop": "0.0.0.0",
"localpref": "100",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "",
"statuscode": {},
"type": "local",
"typecode": "l",
"weight": "32768"
}
},
"ipprefix": "10.100.166.4/30"
},
{
"TABLE_path": {
"ROW_path": [
{
"aspath": "65059",
"best": "non-bestpath",
"bestcode": "&",
"ipnexthop": "10.100.157.1",
"localpref": "",
"metric": "",
"origin": "i",
"pathnr": "0",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
},
{
"aspath": "65059",
"best": "bestpath",
"bestcode": ">",
"ipnexthop": "10.100.157.9",
"localpref": "110",
"metric": "",
"origin": "i",
"pathnr": "1",
"status": "valid",
"statuscode": "*",
"type": "external",
"typecode": "e",
"weight": "0"
}
]
},
"ipprefix": "33.33.33.33/32"
}
]
}
}
},
"af-name": "IPv4 Unicast",
"router-id": "7.57.255.2",
"safi": "1",
"table-version": "42"
}
},
"afi": "1"
}
},
"vrf-name-out": "default"
}
}
},
"code": "200",
"input": "show bgp ip unicast vrf default",
"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 bgp ip unicast vrf default command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 6.0(2)A8(8).
| CLI Output |
|---|
|