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:

http//www.cisco.com/c/en/us/support/switches/nexus-3000-series-switches/products-command-reference-list.html

Note: This example was added in Cisco NX-OS Release 6.0(2)A8(8).

CLI Output
Switch# show bgp ip unicast
BGP routing table information for VRF default, address family IPv4 Unicast
BGP table version is 42, local router ID is 7.57.255.2
Status: s-suppressed, x-deleted, S-stale, d-dampened, h-history, -valid,  -best
Path type: i-internal, e-external, c-confed, l-local, a-aggregate, r-redist, I-injected
Origin codes: i - IGP, e - EGP, ? - incomplete, | - multipath, & - backup

   Network            Next Hop            Metric     LocPrf     Weight Path
 l7.57.0.0/16        0.0.0.0                           100      32768 i
 e                   10.100.157.1                                   0 65059 i
&e                   10.100.157.9                      110          0 65059 i
&e7.57.255.1/32      10.100.157.1                                   0 65059 i
 e                   10.100.157.9                      110          0 65059 i
 l10.57.0.0/16       0.0.0.0                           100      32768 i
 e                   10.100.157.1                                   0 65059 i
&e                   10.100.157.9                      110          0 65059 i
&e10.57.50.0/24      10.100.157.1                                   0 65059 i
 e                   10.100.157.9                      110          0 65059 i
 l10.100.90.128/30   0.0.0.0                           100      32768 i
 e                   10.100.157.1                                   0 65059 i
&e                   10.100.157.9                      110          0 65059 i
 l10.100.157.0/30    0.0.0.0                           100      32768 i
 e                   10.100.157.1                                   0 65059 i
&e                   10.100.157.9                      110          0 65059 i
 l10.100.157.8/30    0.0.0.0                           100      32768 i
 e                   10.100.157.1                                   0 65059 i
&e                   10.100.157.9                      110          0 65059 i
  l10.100.166.4/30    0.0.0.0                           100      32768 i
&e33.33.33.33/32     10.100.157.1                                   0 65059 i
 e                   10.100.157.9                      110          0 65059 i


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:

http//www.cisco.com/c/en/us/support/switches/nexus-3000-series-switches/products-command-reference-list.html

Note: This example was added in Cisco NX-OS Release 6.0(2)A8(8).

CLI Output
Switch# show bgp ip unicast neighbors
BGP neighbor is 10.40.100.57,  remote AS 65057, ibgp link,  Peer index 1
  Description: REX
  BGP version 4, remote router ID 0.0.0.0
  BGP state = Idle, down for 1w5d, retry in 00:00:52
  Using loopback0 as update source for this peer
  Enable logging neighbor events
  Last read never, hold time = 3, keepalive interval is 1 seconds
  Last written never, keepalive timer not running
  Received 0 messages, 0 notifications, 0 bytes in queue
  Sent 0 messages, 0 notifications, 0 bytes in queue
  Connections established 0, dropped 0
  Connection attempts 10374
  Last reset by us never, due to No error
  Last reset by peer never, due to No error

  Message statistics:
                              Sent               Rcvd
  Opens:                         0                  0
Notifications: 0 0
Updates: 0 0
Keepalives: 0 0
Route Refresh: 0 0
Capability: 0 0
Total: 0 0
Total bytes: 0 0
Bytes in queue: 0 0
For address family: IPv4 Unicast BGP table version 42, neighbor version 0 0 accepted paths consume 0 bytes of memory First Update Rcvd : never Last Update Rcvd : never 0 sent paths First Update Sent : never Last Update Sent : never Third-party Nexthop will not be computed. No established BGP session with peer BGP neighbor is 10.100.90.130, remote AS 300, ebgp link, Peer index 2 BGP version 4, remote router ID 0.0.0.0 BGP state = Idle, down for 1w5d, retry in 00:00:17 Enable logging neighbor events Last read never, hold time = 3, keepalive interval is 1 seconds Last written never, keepalive timer not running Received 0 messages, 0 notifications, 0 bytes in queue Sent 0 messages, 0 notifications, 0 bytes in queue Connections established 0, dropped 0 Connection attempts 14486 Last reset by us never, due to No error Last reset by peer never, due to No error Message statistics: Sent Rcvd Opens: 0 0
Notifications: 0 0
Updates: 0 0
Keepalives: 0 0
Route Refresh: 0 0
Capability: 0 0
Total: 0 0
Total bytes: 0 0
Bytes in queue: 0 0
For address family: IPv4 Unicast BGP table version 42, neighbor version 0 0 accepted paths consume 0 bytes of memory First Update Rcvd : never Last Update Rcvd : never 0 sent paths First Update Sent : never Last Update Sent : never Inbound soft reconfiguration allowed Community attribute sent to this neighbor Extended community attribute sent to this neighbor Inbound route-map configured is RM-MIL-IN, handle obtained Outbound route-map configured is RM-MIL-OUT, handle obtained No established BGP session with peer BGP neighbor is 10.100.157.1, remote AS 65059, ebgp link, Peer index 3 BGP version 4, remote router ID 7.57.255.1 BGP state = Established, up for 1w5d Peer is directly attached, interface Ethernet1/2 Enable logging neighbor events Last read 0.480619, hold time = 3, keepalive interval is 1 seconds Last written 0.717171, keepalive timer expiry due 0.281304 Received 1076791 messages, 0 notifications, 0 bytes in queue Sent 1075171 messages, 0 notifications, 0 bytes in queue Connections established 1, dropped 0 Last reset by us never, due to No error Last reset by peer never, due to No error Neighbor capabilities: Dynamic capability: advertised (mp, refresh, gr) received (mp, refresh, gr) Dynamic capability (old): advertised received Route refresh capability (new): advertised received Route refresh capability (old): advertised received 4-Byte AS capability: advertised received Address family IPv4 Unicast: advertised received Graceful Restart capability: advertised received Graceful Restart Parameters: Address families advertised to peer: IPv4 Unicast
Address families received from peer: IPv4 Unicast
Forwarding state preserved by peer for: Restart time advertised to peer: 120 seconds Stale time for routes advertised by peer: 300 seconds Restart time advertised by peer: 120 seconds Additional Paths capability: advertised Additional Paths Capability Parameters: Send capability advertised to Peer for AF: IPv4 Unicast
Receive capability advertised to Peer for AF: IPv4 Unicast
Extended Next Hop Encoding Capability: advertised received Receive IPv6 next hop encoding Capability for AF: IPv4 Unicast
Message statistics: Sent Rcvd Opens: 1 1
Notifications: 0 0
Updates: 4 3
Keepalives: 1075166 1076787
Route Refresh: 0 0
Capability: 0 0
Total: 1075171 1076791
Total bytes: 20428332 20459096
Bytes in queue: 0 0
For address family: IPv4 Unicast BGP table version 42, neighbor version 42 8 accepted paths consume 448 bytes of memory First Update Rcvd : 1w5d Last Update Rcvd : 1w5d 5 sent paths First Update Sent : 1w5d Last Update Sent : 1w5d Inbound soft reconfiguration allowed Community attribute sent to this neighbor Extended community attribute sent to this neighbor Last End-of-RIB received 00:00:01 after session start Local host: 10.100.157.2, Local port: 179 Foreign host: 10.100.157.1, Foreign port: 14258 fd = 49 BGP neighbor is 10.100.157.9, remote AS 65059, ebgp link, Peer index 4 BGP version 4, remote router ID 7.57.255.1 BGP state = Established, up for 1w5d Peer is directly attached, interface Ethernet1/4 Enable logging neighbor events Last read 0.480807, hold time = 3, keepalive interval is 1 seconds Last written 0.716315, keepalive timer expiry due 0.281105 Received 1076791 messages, 0 notifications, 0 bytes in queue Sent 1075173 messages, 0 notifications, 0 bytes in queue Connections established 1, dropped 0 Last reset by us never, due to No error Last reset by peer never, due to No error Neighbor capabilities: Dynamic capability: advertised (mp, refresh, gr) received (mp, refresh, gr) Dynamic capability (old): advertised received Route refresh capability (new): advertised received Route refresh capability (old): advertised received 4-Byte AS capability: advertised received Address family IPv4 Unicast: advertised received Graceful Restart capability: advertised received Graceful Restart Parameters: Address families advertised to peer: IPv4 Unicast
Address families received from peer: IPv4 Unicast
Forwarding state preserved by peer for: Restart time advertised to peer: 120 seconds Stale time for routes advertised by peer: 300 seconds Restart time advertised by peer: 120 seconds Additional Paths capability: advertised Additional Paths Capability Parameters: Send capability advertised to Peer for AF: IPv4 Unicast
Receive capability advertised to Peer for AF: IPv4 Unicast
Extended Next Hop Encoding Capability: advertised received Receive IPv6 next hop encoding Capability for AF: IPv4 Unicast
Message statistics: Sent Rcvd Opens: 1 1
Notifications: 0 0
Updates: 6 3
Keepalives: 1075166 1076787
Route Refresh: 0 0
Capability: 0 0
Total: 1075173 1076791
Total bytes: 20428465 20459096
Bytes in queue: 0 0
For address family: IPv4 Unicast BGP table version 42, neighbor version 42 8 accepted paths consume 448 bytes of memory First Update Rcvd : 1w5d Last Update Rcvd : 1w5d 5 sent paths First Update Sent : 1w5d Last Update Sent : 1w5d Inbound soft reconfiguration allowed Community attribute sent to this neighbor Extended community attribute sent to this neighbor Inbound route-map configured is RM-LSL-IN, handle obtained Outbound route-map configured is RM-LSL-OUT, handle obtained Last End-of-RIB received 00:00:01 after session start Local host: 10.100.157.10, Local port: 179 Foreign host: 10.100.157.9, Foreign port: 14083 fd = 45 BGP neighbor is 89.1.1.10, remote AS 1001, ebgp link, Peer index 5 BGP version 4, remote router ID 0.0.0.0 BGP state = Idle, down for 1w5d, retry in 00:00:05 Enable logging neighbor events Last read never, hold time = 3, keepalive interval is 1 seconds Last written never, keepalive timer not running Received 0 messages, 0 notifications, 0 bytes in queue Sent 0 messages, 0 notifications, 0 bytes in queue Connections established 0, dropped 0 Connection attempts 14454 Last reset by us never, due to No error Last reset by peer never, due to No error Message statistics: Sent Rcvd Opens: 0 0
Notifications: 0 0
Updates: 0 0
Keepalives: 0 0
Route Refresh: 0 0
Capability: 0 0
Total: 0 0
Total bytes: 0 0
Bytes in queue: 0 0
For address family: IPv4 Unicast BGP table version 42, neighbor version 0 0 accepted paths consume 0 bytes of memory First Update Rcvd : never Last Update Rcvd : never 0 sent paths First Update Sent : never Last Update Sent : never No established BGP session with peer BGP neighbor is 89.1.2.10, remote AS 1002, ebgp link, Peer index 6 BGP version 4, remote router ID 0.0.0.0 BGP state = Active, down for 1w5d, retry in 0.000000 Enable logging neighbor events Last read never, hold time = 3, keepalive interval is 1 seconds Last written never, keepalive timer not running Received 0 messages, 0 notifications, 0 bytes in queue Sent 0 messages, 0 notifications, 0 bytes in queue Connections established 0, dropped 0 Connection attempts 14473 Last reset by us never, due to No error Last reset by peer never, due to No error Message statistics: Sent Rcvd Opens: 0 0
Notifications: 0 0
Updates: 0 0
Keepalives: 0 0
Route Refresh: 0 0
Capability: 0 0
Total: 0 0
Total bytes: 0 0
Bytes in queue: 0 0
For address family: IPv4 Unicast BGP table version 42, neighbor version 0 0 accepted paths consume 0 bytes of memory First Update Rcvd : never Last Update Rcvd : never 0 sent paths First Update Sent : never Last Update Sent : never Active open tid = 0 fd = 57 No established BGP session with peer BGP neighbor is 89.1.3.10, remote AS 1003, ebgp link, Peer index 7 BGP version 4, remote router ID 0.0.0.0 BGP state = Idle, down for 1w5d, retry in 00:01:25 Enable logging neighbor events Last read never, hold time = 3, keepalive interval is 1 seconds Last written never, keepalive timer not running Received 0 messages, 0 notifications, 0 bytes in queue Sent 0 messages, 0 notifications, 0 bytes in queue Connections established 0, dropped 0 Connection attempts 14450 Last reset by us never, due to No error Last reset by peer never, due to No error Message statistics: Sent Rcvd Opens: 0 0
Notifications: 0 0
Updates: 0 0
Keepalives: 0 0
Route Refresh: 0 0
Capability: 0 0
Total: 0 0
Total bytes: 0 0
Bytes in queue: 0 0
For address family: IPv4 Unicast BGP table version 42, neighbor version 0 0 accepted paths consume 0 bytes of memory First Update Rcvd : never Last Update Rcvd : never 0 sent paths First Update Sent : never Last Update Sent : never No established BGP session with peer BGP neighbor is 89.1.4.10, remote AS 1004, ebgp link, Peer index 8 BGP version 4, remote router ID 0.0.0.0 BGP state = Idle, down for 1w5d, retry in 00:00:25 Enable logging neighbor events Last read never, hold time = 3, keepalive interval is 1 seconds Last written never, keepalive timer not running Received 0 messages, 0 notifications, 0 bytes in queue Sent 0 messages, 0 notifications, 0 bytes in queue Connections established 0, dropped 0 Connection attempts 14461 Last reset by us never, due to No error Last reset by peer never, due to No error Message statistics: Sent Rcvd Opens: 0 0
Notifications: 0 0
Updates: 0 0
Keepalives: 0 0
Route Refresh: 0 0
Capability: 0 0
Total: 0 0
Total bytes: 0 0
Bytes in queue: 0 0
For address family: IPv4 Unicast BGP table version 42, neighbor version 0 0 accepted paths consume 0 bytes of memory First Update Rcvd : never Last Update Rcvd : never 0 sent paths First Update Sent : never Last Update Sent : never No established BGP session with peer

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:

http//www.cisco.com/c/en/us/support/switches/nexus-3000-series-switches/products-command-reference-list.html

Note: This example was added in Cisco NX-OS Release 6.0(2)A8(8).

CLI Output
Switch# show bgp ip unicast neighbors vrf default
BGP neighbor is 10.40.100.57,  remote AS 65057, ibgp link,  Peer index 1
  Description: REX
  BGP version 4, remote router ID 0.0.0.0
  BGP state = Idle, down for 1w5d, retry in 00:00:49
  Using loopback0 as update source for this peer
  Enable logging neighbor events
  Last read never, hold time = 3, keepalive interval is 1 seconds
  Last written never, keepalive timer not running
  Received 0 messages, 0 notifications, 0 bytes in queue
  Sent 0 messages, 0 notifications, 0 bytes in queue
  Connections established 0, dropped 0
  Connection attempts 10374
  Last reset by us never, due to No error
  Last reset by peer never, due to No error

  Message statistics:
                              Sent               Rcvd
  Opens:                         0                  0
Notifications: 0 0
Updates: 0 0
Keepalives: 0 0
Route Refresh: 0 0
Capability: 0 0
Total: 0 0
Total bytes: 0 0
Bytes in queue: 0 0
For address family: IPv4 Unicast BGP table version 42, neighbor version 0 0 accepted paths consume 0 bytes of memory First Update Rcvd : never Last Update Rcvd : never 0 sent paths First Update Sent : never Last Update Sent : never Third-party Nexthop will not be computed. No established BGP session with peer BGP neighbor is 10.100.90.130, remote AS 300, ebgp link, Peer index 2 BGP version 4, remote router ID 0.0.0.0 BGP state = Idle, down for 1w5d, retry in 00:00:13 Enable logging neighbor events Last read never, hold time = 3, keepalive interval is 1 seconds Last written never, keepalive timer not running Received 0 messages, 0 notifications, 0 bytes in queue Sent 0 messages, 0 notifications, 0 bytes in queue Connections established 0, dropped 0 Connection attempts 14486 Last reset by us never, due to No error Last reset by peer never, due to No error Message statistics: Sent Rcvd Opens: 0 0
Notifications: 0 0
Updates: 0 0
Keepalives: 0 0
Route Refresh: 0 0
Capability: 0 0
Total: 0 0
Total bytes: 0 0
Bytes in queue: 0 0
For address family: IPv4 Unicast BGP table version 42, neighbor version 0 0 accepted paths consume 0 bytes of memory First Update Rcvd : never Last Update Rcvd : never 0 sent paths First Update Sent : never Last Update Sent : never Inbound soft reconfiguration allowed Community attribute sent to this neighbor Extended community attribute sent to this neighbor Inbound route-map configured is RM-MIL-IN, handle obtained Outbound route-map configured is RM-MIL-OUT, handle obtained No established BGP session with peer BGP neighbor is 10.100.157.1, remote AS 65059, ebgp link, Peer index 3 BGP version 4, remote router ID 7.57.255.1 BGP state = Established, up for 1w5d Peer is directly attached, interface Ethernet1/2 Enable logging neighbor events Last read 0.850146, hold time = 3, keepalive interval is 1 seconds Last written 0.067967, keepalive timer expiry due 0.930844 Received 1076794 messages, 0 notifications, 0 bytes in queue Sent 1075175 messages, 0 notifications, 0 bytes in queue Connections established 1, dropped 0 Last reset by us never, due to No error Last reset by peer never, due to No error Neighbor capabilities: Dynamic capability: advertised (mp, refresh, gr) received (mp, refresh, gr) Dynamic capability (old): advertised received Route refresh capability (new): advertised received Route refresh capability (old): advertised received 4-Byte AS capability: advertised received Address family IPv4 Unicast: advertised received Graceful Restart capability: advertised received Graceful Restart Parameters: Address families advertised to peer: IPv4 Unicast
Address families received from peer: IPv4 Unicast
Forwarding state preserved by peer for: Restart time advertised to peer: 120 seconds Stale time for routes advertised by peer: 300 seconds Restart time advertised by peer: 120 seconds Additional Paths capability: advertised Additional Paths Capability Parameters: Send capability advertised to Peer for AF: IPv4 Unicast
Receive capability advertised to Peer for AF: IPv4 Unicast
Extended Next Hop Encoding Capability: advertised received Receive IPv6 next hop encoding Capability for AF: IPv4 Unicast
Message statistics: Sent Rcvd Opens: 1 1
Notifications: 0 0
Updates: 4 3
Keepalives: 1075170 1076790
Route Refresh: 0 0
Capability: 0 0
Total: 1075175 1076794
Total bytes: 20428408 20459153
Bytes in queue: 0 0
For address family: IPv4 Unicast BGP table version 42, neighbor version 42 8 accepted paths consume 448 bytes of memory First Update Rcvd : 1w5d Last Update Rcvd : 1w5d 5 sent paths First Update Sent : 1w5d Last Update Sent : 1w5d Inbound soft reconfiguration allowed Community attribute sent to this neighbor Extended community attribute sent to this neighbor Last End-of-RIB received 00:00:01 after session start Local host: 10.100.157.2, Local port: 179 Foreign host: 10.100.157.1, Foreign port: 14258 fd = 49 BGP neighbor is 10.100.157.9, remote AS 65059, ebgp link, Peer index 4 BGP version 4, remote router ID 7.57.255.1 BGP state = Established, up for 1w5d Peer is directly attached, interface Ethernet1/4 Enable logging neighbor events Last read 0.850392, hold time = 3, keepalive interval is 1 seconds Last written 0.067928, keepalive timer expiry due 0.930594 Received 1076794 messages, 0 notifications, 0 bytes in queue Sent 1075177 messages, 0 notifications, 0 bytes in queue Connections established 1, dropped 0 Last reset by us never, due to No error Last reset by peer never, due to No error Neighbor capabilities: Dynamic capability: advertised (mp, refresh, gr) received (mp, refresh, gr) Dynamic capability (old): advertised received Route refresh capability (new): advertised received Route refresh capability (old): advertised received 4-Byte AS capability: advertised received Address family IPv4 Unicast: advertised received Graceful Restart capability: advertised received Graceful Restart Parameters: Address families advertised to peer: IPv4 Unicast
Address families received from peer: IPv4 Unicast
Forwarding state preserved by peer for: Restart time advertised to peer: 120 seconds Stale time for routes advertised by peer: 300 seconds Restart time advertised by peer: 120 seconds Additional Paths capability: advertised Additional Paths Capability Parameters: Send capability advertised to Peer for AF: IPv4 Unicast
Receive capability advertised to Peer for AF: IPv4 Unicast
Extended Next Hop Encoding Capability: advertised received Receive IPv6 next hop encoding Capability for AF: IPv4 Unicast
Message statistics: Sent Rcvd Opens: 1 1
Notifications: 0 0
Updates: 6 3
Keepalives: 1075170 1076790
Route Refresh: 0 0
Capability: 0 0
Total: 1075177 1076794
Total bytes: 20428541 20459153
Bytes in queue: 0 0
For address family: IPv4 Unicast BGP table version 42, neighbor version 42 8 accepted paths consume 448 bytes of memory First Update Rcvd : 1w5d Last Update Rcvd : 1w5d 5 sent paths First Update Sent : 1w5d Last Update Sent : 1w5d Inbound soft reconfiguration allowed Community attribute sent to this neighbor Extended community attribute sent to this neighbor Inbound route-map configured is RM-LSL-IN, handle obtained Outbound route-map configured is RM-LSL-OUT, handle obtained Last End-of-RIB received 00:00:01 after session start Local host: 10.100.157.10, Local port: 179 Foreign host: 10.100.157.9, Foreign port: 14083 fd = 45 BGP neighbor is 89.1.1.10, remote AS 1001, ebgp link, Peer index 5 BGP version 4, remote router ID 0.0.0.0 BGP state = Idle, down for 1w5d, retry in 00:00:01 Enable logging neighbor events Last read never, hold time = 3, keepalive interval is 1 seconds Last written never, keepalive timer not running Received 0 messages, 0 notifications, 0 bytes in queue Sent 0 messages, 0 notifications, 0 bytes in queue Connections established 0, dropped 0 Connection attempts 14454 Last reset by us never, due to No error Last reset by peer never, due to No error Message statistics: Sent Rcvd Opens: 0 0
Notifications: 0 0
Updates: 0 0
Keepalives: 0 0
Route Refresh: 0 0
Capability: 0 0
Total: 0 0
Total bytes: 0 0
Bytes in queue: 0 0
For address family: IPv4 Unicast BGP table version 42, neighbor version 0 0 accepted paths consume 0 bytes of memory First Update Rcvd : never Last Update Rcvd : never 0 sent paths First Update Sent : never Last Update Sent : never No established BGP session with peer BGP neighbor is 89.1.2.10, remote AS 1002, ebgp link, Peer index 6 BGP version 4, remote router ID 0.0.0.0 BGP state = Idle, down for 1w5d, retry in 00:01:19 Enable logging neighbor events Last read never, hold time = 3, keepalive interval is 1 seconds Last written never, keepalive timer not running Received 0 messages, 0 notifications, 0 bytes in queue Sent 0 messages, 0 notifications, 0 bytes in queue Connections established 0, dropped 0 Connection attempts 14473 Last reset by us never, due to No error Last reset by peer never, due to No error Message statistics: Sent Rcvd Opens: 0 0
Notifications: 0 0
Updates: 0 0
Keepalives: 0 0
Route Refresh: 0 0
Capability: 0 0
Total: 0 0
Total bytes: 0 0
Bytes in queue: 0 0
For address family: IPv4 Unicast BGP table version 42, neighbor version 0 0 accepted paths consume 0 bytes of memory First Update Rcvd : never Last Update Rcvd : never 0 sent paths First Update Sent : never Last Update Sent : never No established BGP session with peer BGP neighbor is 89.1.3.10, remote AS 1003, ebgp link, Peer index 7 BGP version 4, remote router ID 0.0.0.0 BGP state = Idle, down for 1w5d, retry in 00:01:22 Enable logging neighbor events Last read never, hold time = 3, keepalive interval is 1 seconds Last written never, keepalive timer not running Received 0 messages, 0 notifications, 0 bytes in queue Sent 0 messages, 0 notifications, 0 bytes in queue Connections established 0, dropped 0 Connection attempts 14450 Last reset by us never, due to No error Last reset by peer never, due to No error Message statistics: Sent Rcvd Opens: 0 0
Notifications: 0 0
Updates: 0 0
Keepalives: 0 0
Route Refresh: 0 0
Capability: 0 0
Total: 0 0
Total bytes: 0 0
Bytes in queue: 0 0
For address family: IPv4 Unicast BGP table version 42, neighbor version 0 0 accepted paths consume 0 bytes of memory First Update Rcvd : never Last Update Rcvd : never 0 sent paths First Update Sent : never Last Update Sent : never No established BGP session with peer BGP neighbor is 89.1.4.10, remote AS 1004, ebgp link, Peer index 8 BGP version 4, remote router ID 0.0.0.0 BGP state = Idle, down for 1w5d, retry in 00:00:22 Enable logging neighbor events Last read never, hold time = 3, keepalive interval is 1 seconds Last written never, keepalive timer not running Received 0 messages, 0 notifications, 0 bytes in queue Sent 0 messages, 0 notifications, 0 bytes in queue Connections established 0, dropped 0 Connection attempts 14461 Last reset by us never, due to No error Last reset by peer never, due to No error Message statistics: Sent Rcvd Opens: 0 0
Notifications: 0 0
Updates: 0 0
Keepalives: 0 0
Route Refresh: 0 0
Capability: 0 0
Total: 0 0
Total bytes: 0 0
Bytes in queue: 0 0
For address family: IPv4 Unicast BGP table version 42, neighbor version 0 0 accepted paths consume 0 bytes of memory First Update Rcvd : never Last Update Rcvd : never 0 sent paths First Update Sent : never Last Update Sent : never No established BGP session with peer

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:

http//www.cisco.com/c/en/us/support/switches/nexus-3000-series-switches/products-command-reference-list.html

Note: This example was added in Cisco NX-OS Release 6.0(2)A8(8).

CLI Output
Switch# show bgp ip unicast nexthop 10.100.157.1
BGP routing table information for VRF default, address family IPv4 Unicast
BGP table version is 42, local router ID is 7.57.255.2
Status: s-suppressed, x-deleted, S-stale, d-dampened, h-history, -valid,  -best
Path type: i-internal, e-external, c-confed, l-local, a-aggregate, r-redist, I-injected
Origin codes: i - IGP, e - EGP, ? - incomplete, | - multipath, & - backup

   Network            Next Hop            Metric     LocPrf     Weight Path
 e7.57.0.0/16        10.100.157.1                                   0 65059 i
&e7.57.255.1/32      10.100.157.1                                   0 65059 i
 e10.57.0.0/16       10.100.157.1                                   0 65059 i
&e10.57.50.0/24      10.100.157.1                                   0 65059 i
 e10.100.90.128/30   10.100.157.1                                   0 65059 i
 e10.100.157.0/30    10.100.157.1                                   0 65059 i
 e10.100.157.8/30    10.100.157.1                                   0 65059 i
*&e33.33.33.33/32     10.100.157.1                                   0 65059 i


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:

http//www.cisco.com/c/en/us/support/switches/nexus-3000-series-switches/products-command-reference-list.html

Note: This example was added in Cisco NX-OS Release 6.0(2)A8(8).

CLI Output
Switch# show bgp ip unicast nexthop 10.100.157.1 vrf default
BGP routing table information for VRF default, address family IPv4 Unicast
BGP table version is 42, local router ID is 7.57.255.2
Status: s-suppressed, x-deleted, S-stale, d-dampened, h-history, -valid,  -best
Path type: i-internal, e-external, c-confed, l-local, a-aggregate, r-redist, I-injected
Origin codes: i - IGP, e - EGP, ? - incomplete, | - multipath, & - backup

   Network            Next Hop            Metric     LocPrf     Weight Path
 e7.57.0.0/16        10.100.157.1                                   0 65059 i
&e7.57.255.1/32      10.100.157.1                                   0 65059 i
 e10.57.0.0/16       10.100.157.1                                   0 65059 i
&e10.57.50.0/24      10.100.157.1                                   0 65059 i
 e10.100.90.128/30   10.100.157.1                                   0 65059 i
 e10.100.157.0/30    10.100.157.1                                   0 65059 i
 e10.100.157.8/30    10.100.157.1                                   0 65059 i
*&e33.33.33.33/32     10.100.157.1                                   0 65059 i


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:

http//www.cisco.com/c/en/us/support/switches/nexus-3000-series-switches/products-command-reference-list.html

Note: This example was added in Cisco NX-OS Release 6.0(2)A8(8).

CLI Output
Switch# show bgp ip unicast summary
BGP summary information for VRF default, address family IPv4 Unicast
BGP router identifier 7.57.255.2, local AS number 65057
BGP table version is 42, IPv4 Unicast config peers 8, capable peers 2
9 network entries and 22 paths using 1736 bytes of memory
BGP attribute entries [3/408], BGP AS path entries [1/6]
BGP community entries [0/0], BGP clusterlist entries [0/0]

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
10.40.100.57    4 65057       0       0        0    0    0     1w5d Idle
10.100.90.130 4 300 0 0 0 0 0 1w5d Idle
10.100.157.1 4 65059 1076801 1075181 42 0 0 1w5d 8
10.100.157.9 4 65059 1076801 1075183 42 0 0 1w5d 8
89.1.1.10 4 1001 0 0 0 0 0 1w5d Idle
89.1.2.10 4 1002 0 0 0 0 0 1w5d Idle
89.1.3.10 4 1003 0 0 0 0 0 1w5d Idle
89.1.4.10 4 1004 0 0 0 0 0 1w5d Idle

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:

http//www.cisco.com/c/en/us/support/switches/nexus-3000-series-switches/products-command-reference-list.html

Note: This example was added in Cisco NX-OS Release 6.0(2)A8(8).

CLI Output
Switch# show bgp ip unicast summary vrf default
BGP summary information for VRF default, address family IPv4 Unicast
BGP router identifier 7.57.255.2, local AS number 65057
BGP table version is 42, IPv4 Unicast config peers 8, capable peers 2
9 network entries and 22 paths using 1736 bytes of memory
BGP attribute entries [3/408], BGP AS path entries [1/6]
BGP community entries [0/0], BGP clusterlist entries [0/0]

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
10.40.100.57    4 65057       0       0        0    0    0     1w5d Idle
10.100.90.130 4 300 0 0 0 0 0 1w5d Idle
10.100.157.1 4 65059 1076803 1075183 42 0 0 1w5d 8
10.100.157.9 4 65059 1076803 1075185 42 0 0 1w5d 8
89.1.1.10 4 1001 0 0 0 0 0 1w5d Idle
89.1.2.10 4 1002 0 0 0 0 0 1w5d Idle
89.1.3.10 4 1003 0 0 0 0 0 1w5d Idle
89.1.4.10 4 1004 0 0 0 0 0 1w5d Idle

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:

http//www.cisco.com/c/en/us/support/switches/nexus-3000-series-switches/products-command-reference-list.html

Note: This example was added in Cisco NX-OS Release 6.0(2)A8(8).

CLI Output
Switch# show bgp ip unicast vrf all
BGP routing table information for VRF default, address family IPv4 Unicast
BGP table version is 42, local router ID is 7.57.255.2
Status: s-suppressed, x-deleted, S-stale, d-dampened, h-history, -valid,  -best
Path type: i-internal, e-external, c-confed, l-local, a-aggregate, r-redist, I-injected
Origin codes: i - IGP, e - EGP, ? - incomplete, | - multipath, & - backup

   Network            Next Hop            Metric     LocPrf     Weight Path
 l7.57.0.0/16        0.0.0.0                           100      32768 i
 e                   10.100.157.1                                   0 65059 i
&e                   10.100.157.9                      110          0 65059 i
&e7.57.255.1/32      10.100.157.1                                   0 65059 i
 e                   10.100.157.9                      110          0 65059 i
 l10.57.0.0/16       0.0.0.0                           100      32768 i
 e                   10.100.157.1                                   0 65059 i
&e                   10.100.157.9                      110          0 65059 i
&e10.57.50.0/24      10.100.157.1                                   0 65059 i
 e                   10.100.157.9                      110          0 65059 i
 l10.100.90.128/30   0.0.0.0                           100      32768 i
 e                   10.100.157.1                                   0 65059 i
&e                   10.100.157.9                      110          0 65059 i
 l10.100.157.0/30    0.0.0.0                           100      32768 i
 e                   10.100.157.1                                   0 65059 i
&e                   10.100.157.9                      110          0 65059 i
 l10.100.157.8/30    0.0.0.0                           100      32768 i
 e                   10.100.157.1                                   0 65059 i
&e                   10.100.157.9                      110          0 65059 i
  l10.100.166.4/30    0.0.0.0                           100      32768 i
&e33.33.33.33/32     10.100.157.1                                   0 65059 i
 e                   10.100.157.9                      110          0 65059 i


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:

http//www.cisco.com/c/en/us/support/switches/nexus-3000-series-switches/products-command-reference-list.html

Note: This example was added in Cisco NX-OS Release 6.0(2)A8(8).

CLI Output
Switch# show bgp ip unicast vrf default
BGP routing table information for VRF default, address family IPv4 Unicast
BGP table version is 42, local router ID is 7.57.255.2
Status: s-suppressed, x-deleted, S-stale, d-dampened, h-history, -valid,  -best
Path type: i-internal, e-external, c-confed, l-local, a-aggregate, r-redist, I-injected
Origin codes: i - IGP, e - EGP, ? - incomplete, | - multipath, & - backup

   Network            Next Hop            Metric     LocPrf     Weight Path
 l7.57.0.0/16        0.0.0.0                           100      32768 i
 e                   10.100.157.1                                   0 65059 i
&e                   10.100.157.9                      110          0 65059 i
&e7.57.255.1/32      10.100.157.1                                   0 65059 i
 e                   10.100.157.9                      110          0 65059 i
 l10.57.0.0/16       0.0.0.0                           100      32768 i
 e                   10.100.157.1                                   0 65059 i
&e                   10.100.157.9                      110          0 65059 i
&e10.57.50.0/24      10.100.157.1                                   0 65059 i
 e                   10.100.157.9                      110          0 65059 i
 l10.100.90.128/30   0.0.0.0                           100      32768 i
 e                   10.100.157.1                                   0 65059 i
&e                   10.100.157.9                      110          0 65059 i
 l10.100.157.0/30    0.0.0.0                           100      32768 i
 e                   10.100.157.1                                   0 65059 i
&e                   10.100.157.9                      110          0 65059 i
 l10.100.157.8/30    0.0.0.0                           100      32768 i
 e                   10.100.157.1                                   0 65059 i
&e                   10.100.157.9                      110          0 65059 i
  l10.100.166.4/30    0.0.0.0                           100      32768 i
&e33.33.33.33/32     10.100.157.1                                   0 65059 i
 e                   10.100.157.9                      110          0 65059 i