Querying the Routes Advertised to a Peer

This section contains the 4 steps for querying the routes advertised to a peer:

  1. Attempt to retrieve a batch size.
  2. Send a request using a batch size that matches the route size (13) in the step 1 response.
  3. Increment the batch-id for each additional request.
  4. Repeat Step 3 until a 400 bad request error is received. This occurs after the last batch is reached.

Step 1

Attempt to retrieve a batch size.

Step 1
GET http://<IP_Address>/api/mo/sys/bgp/inst/dom-[vpn3]/peer-[21.0.101.1]/af-[ipv4-ucast]/advtdrt.json?rsp-subtree=full&rsp-foreign-subtree=ephemeral&batch-**size=1**&batch-id=1
{
    "totalCount": "0",
    "imdata": [
        {
            "warning": {
                "attributes": {
                    "text": "backend rv=0, Batch size [1] is less than Route size [13]. Increase the batch-size and try again"
}}}]}

Note: The property information for this example was added in Release 9.3(3).


Related Documentation

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:

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

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:

https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:

https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Step 2

Send a request using a batch size that matches the route size (13) in the step 1 response.

Step 2
GET http://<IP_Address>/api/mo/sys/bgp/inst/dom-[vpn3]/peer-[21.0.101.1]/af-[ipv4-ucast]/advtdrt.json?rsp-subtree=full&rsp-foreign-subtree=ephemeral&batch-size=13&batch-id=1
{
    "totalCount": "1",
    "imdata": [
    {
        "bgpAdvtdRoutes": {
            "attributes": {
                "dn": "sys/bgp/inst/dom-vpn3/peer-[21.0.101.1]/af-ipv4-ucast/advtdrt"
    },
    "children": [
        {
            "bgpRoute": {
                "attributes": {
                    "bestPathId": "2",
                    "numPaths": "1",
                    "pfx": "1.1.1.0/24",
                    "rd": "unknown:unknown:0:0",
                    "rn": "rt-[1.1.1.0/24]",
                    "rtFlags": "best,rib,xmit",
                    "ver": "147"
    },
    "children": [
        {
            "bgpPath": {
                "attributes": {
                    "aggr": "0.0.0.0",
                    "aggrAs": "0",
                    "asPath": "{62112 33492 4872 41787 13166 50081 21461 58376 29755 1135}",
                    "clusterLst": "21.0.102.1,21.0.102.1",
                    "extComm": "",
                    "flags": "advertise,best-path",
                    "id": "0",
                    "importedRd": "unknown:unknown:0:0",
                    "localPref": "100",
                    "metric": "0",
                    "nh": "21.0.102.1",
                    "nhMetric": "0",
                    "operSt": "valid",
                    "origImportedRd": "unknown:unknown:0:0",
                    "origin": "igp",
                    "originatorId": "5.5.5.102",
                    "peer": "21.0.102.1",
                    "peerRtrId": "21.0.102.1",
                    "rcvdLbl": "",
                    "regComm": "",
                    "rn": "path-[21.0.102.1]-id-0-nh-[21.0.102.1]-imprd-unknown:unknown:0:0-origimprd-unknown:unknown:0:0",
                    "type": "internal",
                    "unknownAttrData": "",
                    "unknownAttrLen": "0",
                    "weight": "0"
    },
    "children": [
        {
            "bgpAsSeg": {
                "attributes": {
                    "order": "1",
                    "rn": "seg-1"
    },
    "children": [
        {
    "bgpAsItem": {
        "attributes": {
            "asn": "13166",
            "order": "5",
            "rn": "asn-5"
    }}},{
    "bgpAsItem": {
        "attributes": {
            "asn": "62112",
            "order": "1",
            "rn": "asn-1"
    }}},{
    "bgpAsItem": {
        "attributes": {
            "asn": "21461",
            "order": "7",
            "rn": "asn-7"
    }}},{
    "bgpAsItem": {
        "attributes": {
            "asn": "50081",
            "order": "6",
            "rn": "asn-6"
    }}},{
    "bgpAsItem": {
        "attributes": {
            "asn": "41787",
            "order": "4",
            "rn": "asn-4"
    }}},{
    "bgpAsItem": {
        "attributes": {
            "asn": "58376",
            "order": "8",
            "rn": "asn-8"
    }}},{
    "bgpAsItem": {
        "attributes": {
            "asn": "1135",
            "order": "10",
            "rn": "asn-10"
    }}},{
    "bgpAsItem": {
        "attributes": {
            "asn": "4872",
            "order": "3",
            "rn": "asn-3"
    }}},{
    "bgpAsItem": {
        "attributes": {
            "asn": "29755",
            "order": "9",
            "rn": "asn-9"
    }}},{
    "bgpAsItem": {
        "attributes": {
            "asn": "33492",
            "order": "2",
            "rn": "asn-2"
}}}]}}]}}]}}]}}]}

Note: The property information for this example was added in Release 9.3(3).


Verifying a DME Configuration
The following table contains the distinguished name (DN) for each managed object (MO) in the DME payload. Issue a GET request using the DN to verify the configuration was posted or to get information about the configured properties of a particular object.

MODN
bgpAdvtdRoutes sys/bgp/inst/dom-{name}/peerif-{[id]}/af-{[type]}/advtdrt
bgpRoute sys/bgp/inst/dom-{name}/af-{[type]}/nh-{[pfx]}/rt-{[pfx]}


bgpAdvtdRoutes Properties

The following table contains information about the bgpAdvtdRoutes properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

Property NameData TypeDescriptionValues
dn
reference:BinRef
A tag or metadata is a non-hierarchical keyword or term assigned to the fabric module.


bgpRoute Properties

The following table contains information about the bgpRoute properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

Property NameData TypeDescriptionValues
bestPathIdbgp:PathId
(scalar:Uint32)
Bestpath IdRANGE: [0, 4294967295]
numPathsscalar:Uint32
Number of paths availableRANGE: [0, 4294967295]
pfxaddress:Ip
PrefixValue must match ipv4 or ipv6 known format
rd
base:Community
A unique value that extends the formal network address for all routes in a particular VRF, making the route unique within the entire BGP table.
rn
reference:BinRN
Identifies an object from its siblings within the context of its parent object. The distinguished name contains a sequence of relative names.
rtFlagsbgp:RtFlags
(scalar:Bitmask32)
FlagsSELECTION:
1 - new
2 - xmit
4 - rib
8 - best
16 - suppressed
32 - exported
64 - locked
128 - vpn
256 - label
512 - l2rib-evpn
1024 - hw
2048 - table-map-filtered
verbgp:RtVer
(scalar:Uint32)
Version of the routeRANGE: [0, 4294967295]


bgpPath Properties

The following table contains information about the bgpPath properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

Property NameData TypeDescriptionValues
aggraddress:Ip
AggregatorValue must match ipv4 or ipv6 known format
aggrAsbgp:AsnNum
(string:Basic)
Aggregator ASA sequence of characters
asPathstring:Basic
AS-PathA sequence of characters


bgpAsSeg Properties

The following table contains information about the bgpAsSeg properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

Property NameData TypeDescriptionValues
orderbgp:Order
(scalar:Uint16)
OrderRANGE: [0, 65535]
rn
reference:BinRN
Identifies an object from its siblings within the context of its parent object. The distinguished name contains a sequence of relative names.


bgpAsItem Properties

The following table contains information about the bgpAsItem properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

Property NameData TypeDescriptionValues
asnbgp:AsnNum
(string:Basic)
AS numberA sequence of characters
orderbgp:Order
(scalar:Uint16)
OrderRANGE: [0, 65535]
rn
reference:BinRN
Identifies an object from its siblings within the context of its parent object. The distinguished name contains a sequence of relative names.


Related Documentation

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:

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

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:

https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:

https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Step 3

Increment the batch-id for each additional request.

Step 3
GET http://<IP_Address>/api/mo/sys/bgp/inst/dom-[vpn3]/peer-[21.0.101.1]/af-[ipv4-ucast]/advtdrt.json?rsp-subtree=full&rsp-foreign-subtree=ephemeral&batch-size=13&batch-id=2
{
 "totalCount": "1",
    "imdata": [
    {
    "bgpAdvtdRoutes": {
        "attributes": {
            "dn": "sys/bgp/inst/dom-vpn3/peer-[21.0.101.1]/af-ipv4-ucast/advtdrt"
    },
    "children": [
    {
    "bgpRoute": {
        "attributes": {
            "bestPathId": "2",
            "numPaths": "1",
            "pfx": "1.1.2.0/24",
            "rd": "unknown:unknown:0:0",
            "rn": "rt-[1.1.2.0/24]",
            "rtFlags": "best,rib,xmit",
            "ver": "148"
    },
    "children": [
    {
    "bgpPath": {
        "attributes": {
            "aggr": "0.0.0.0",
            "aggrAs": "0",
            "asPath": "{62112 33492 4872 41787 13166 50081 21461 58376 29755 1135}",
            "clusterLst": "21.0.102.1,21.0.102.1",
            "extComm": "",
            "flags": "advertise,best-path",
            "id": "0",
            "importedRd": "unknown:unknown:0:0",
            "localPref": "100",
            "metric": "0",
            "nh": "21.0.102.1",
            "nhMetric": "0",
            "operSt": "valid",
            "origImportedRd": "unknown:unknown:0:0",
            "origin": "igp",
            "originatorId": "5.5.5.102",
            "peer": "21.0.102.1",
            "peerRtrId": "21.0.102.1",
            "rcvdLbl": "",
            "regComm": "",
            "rn": "path-[21.0.102.1]-id-0-nh-[21.0.102.1]-imprd-unknown:unknown:0:0-origimprd-unknown:unknown:0:0",
            "type": "internal",
            "unknownAttrData": "",
            "unknownAttrLen": "0",
            "weight": "0"
    },
    "children": [
    {
    "bgpAsSeg": {
        "attributes": {
            "order": "1",
            "rn": "seg-1"
    },
    "children": [
    {
    "bgpAsItem": {
        "attributes": {
            "asn": "13166",
            "order": "5",
            "rn": "asn-5"
    }}},{
    "bgpAsItem": {
        "attributes": {
            "asn": "62112",
            "order": "1",
            "rn": "asn-1"
    }}},{
    "bgpAsItem": {
        "attributes": {
            "asn": "21461",
            "order": "7",
            "rn": "asn-7"
    }}},{
    "bgpAsItem": {
        "attributes": {
            "asn": "50081",
            "order": "6",
            "rn": "asn-6"
    }}},{
    "bgpAsItem": {
        "attributes": {
            "asn": "41787",
            "order": "4",
            "rn": "asn-4"
    }}},{
    "bgpAsItem": {
        "attributes": {
            "asn": "58376",
            "order": "8",
            "rn": "asn-8"
    }}},{
    "bgpAsItem": {
        "attributes": {
            "asn": "1135",
            "order": "10",
            "rn": "asn-10"
    }}},{
    "bgpAsItem": {
        "attributes": {
            "asn": "4872",
            "order": "3",
            "rn": "asn-3"
    }}},{
    "bgpAsItem": {
        "attributes": {
            "asn": "29755",
            "order": "9",
            "rn": "asn-9"
    }}},{
    "bgpAsItem": {
        "attributes": {
            "asn": "33492",
            "order": "2",
            "rn": "asn-2"
}}}]}}]}}]}}]}}]}

Note: The property information for this example was added in Release 9.3(3).


Verifying a DME Configuration
The following table contains the distinguished name (DN) for each managed object (MO) in the DME payload. Issue a GET request using the DN to verify the configuration was posted or to get information about the configured properties of a particular object.

MODN
bgpAdvtdRoutes sys/bgp/inst/dom-{name}/peerif-{[id]}/af-{[type]}/advtdrt
bgpRoute sys/bgp/inst/dom-{name}/af-{[type]}/nh-{[pfx]}/rt-{[pfx]}


bgpAdvtdRoutes Properties

The following table contains information about the bgpAdvtdRoutes properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

Property NameData TypeDescriptionValues
dn
reference:BinRef
A tag or metadata is a non-hierarchical keyword or term assigned to the fabric module.


bgpRoute Properties

The following table contains information about the bgpRoute properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

Property NameData TypeDescriptionValues
bestPathIdbgp:PathId
(scalar:Uint32)
Bestpath IdRANGE: [0, 4294967295]
numPathsscalar:Uint32
Number of paths availableRANGE: [0, 4294967295]
pfxaddress:Ip
PrefixValue must match ipv4 or ipv6 known format
rd
base:Community
A unique value that extends the formal network address for all routes in a particular VRF, making the route unique within the entire BGP table.
rn
reference:BinRN
Identifies an object from its siblings within the context of its parent object. The distinguished name contains a sequence of relative names.
rtFlagsbgp:RtFlags
(scalar:Bitmask32)
FlagsSELECTION:
1 - new
2 - xmit
4 - rib
8 - best
16 - suppressed
32 - exported
64 - locked
128 - vpn
256 - label
512 - l2rib-evpn
1024 - hw
2048 - table-map-filtered
verbgp:RtVer
(scalar:Uint32)
Version of the routeRANGE: [0, 4294967295]


bgpPath Properties

The following table contains information about the bgpPath properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

Property NameData TypeDescriptionValues
aggraddress:Ip
AggregatorValue must match ipv4 or ipv6 known format
aggrAsbgp:AsnNum
(string:Basic)
Aggregator ASA sequence of characters
asPathstring:Basic
AS-PathA sequence of characters


bgpAsSeg Properties

The following table contains information about the bgpAsSeg properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

Property NameData TypeDescriptionValues
orderbgp:Order
(scalar:Uint16)
OrderRANGE: [0, 65535]
rn
reference:BinRN
Identifies an object from its siblings within the context of its parent object. The distinguished name contains a sequence of relative names.


bgpAsItem Properties

The following table contains information about the bgpAsItem properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

Property NameData TypeDescriptionValues
asnbgp:AsnNum
(string:Basic)
AS numberA sequence of characters
orderbgp:Order
(scalar:Uint16)
OrderRANGE: [0, 65535]
rn
reference:BinRN
Identifies an object from its siblings within the context of its parent object. The distinguished name contains a sequence of relative names.


Related Documentation

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:

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

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:

https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:

https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Step 4

A 400 bad request error is received after the last batch is reached.

Step 4
GET http://<IP_Address>/api/mo/sys/bgp/inst/dom-[vpn3]/peer-[21.0.101.1]/af-[ipv4-ucast]/advtdrt.json?rsp-subtree=full&rsp-foreign-subtree=ephemeral&batch-size=13&batch-id=11
{
    "imdata": [
{
    "error": {
        "attributes": {
            "code": "123",
            "text": "Foreign Ephemeral lookup failed: Invalid user input: batch-id argument must be 1 for the first batch of this DN, specified 11"
}}}]}
CLI Output
switch# show bgp ipv4 unicast neighbors 21.0.101.1 advertised-routes vrf vpn3

Peer 21.0.101.1 routes for address family IPv4 Unicast:
BGP table version is 156, Local Router ID is 21.0.0.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-i
njected
Origin codes: i - IGP, e - EGP, ?- incomplete, |- multipath, - backup
Network Next Hop Metric LocPrf Weight Path *>i1.1.1.0/24 21.0.102.1 100 0 {62112 33
492 4872 41787 13166 50081 21461 58376 29755 1135} i
*>i1.1.2.0/24 21.0.102.1 100 0 {62112 33
492 4872 41787 13166 50081 21461 58376 29755 1135} i
*>i1.1.3.0/24 21.0.102.1 100 0 {62112 33
492 4872 41787 13166 50081 21461 58376 29755 1135} i
*>i1.1.4.0/24 21.0.102.1 100 0 {62112 33
492 4872 41787 13166 50081 21461 58376 29755 1135} i
*>i1.1.5.0/24 21.0.102.1 100 0 {62112 33
492 4872 41787 13166 50081 21461 58376 29755 1135} i
*>i2.2.2.0/24 21.0.102.1 100 0 {38050 94
30 46344 17724 54639 26019 62933 34313 5693 42608} i
*>i2.2.3.0/24 21.0.102.1 100 0 {38050 94
30 46344 17724 54639 26019 62933 34313 5693 42608} i
*>i2.2.4.0/24 21.0.102.1 100 0 {38050 94
30 46344 17724 54639 26019 62933 34313 5693 42608} i
*>i2.2.5.0/24 21.0.102.1 100 0 {38050 94
30 46344 17724 54639 26019 62933 34313 5693 42608} i
*>i2.2.6.0/24 21.0.102.1 100 0 {38050 94
30 46344 17724 54639 26019 62933 34313 5693 42608} i


Related Documentation

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:

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

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:

https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:

https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html