Querying the Routes Advertised to a Peer
This section contains the 4 steps for querying the routes advertised to a peer:
- Attempt to retrieve a batch size.
- Send a request using a batch size that matches the route size (13) in the step 1 response.
- Increment the batch-id for each additional request.
- 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:
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:
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.
MO | DN |
---|---|
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 Name | Data Type | Description | Values |
---|---|---|---|
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 Name | Data Type | Description | Values |
---|---|---|---|
bestPathId | bgp:PathId (scalar:Uint32) | Bestpath Id | RANGE: [0, 4294967295] |
numPaths | scalar:Uint32 | Number of paths available | RANGE: [0, 4294967295] |
pfx | address:Ip | Prefix | Value 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. | |
rtFlags | bgp:RtFlags (scalar:Bitmask32) | Flags | SELECTION: 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 |
ver | bgp:RtVer (scalar:Uint32) | Version of the route | RANGE: [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 Name | Data Type | Description | Values |
---|---|---|---|
aggr | address:Ip | Aggregator | Value must match ipv4 or ipv6 known format |
aggrAs | bgp:AsnNum (string:Basic) | Aggregator AS | A sequence of characters |
asPath | string:Basic | AS-Path | A 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 Name | Data Type | Description | Values |
---|---|---|---|
order | bgp:Order (scalar:Uint16) | Order | RANGE: [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 Name | Data Type | Description | Values |
---|---|---|---|
asn | bgp:AsnNum (string:Basic) | AS number | A sequence of characters |
order | bgp:Order (scalar:Uint16) | Order | RANGE: [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:
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:
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.
MO | DN |
---|---|
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 Name | Data Type | Description | Values |
---|---|---|---|
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 Name | Data Type | Description | Values |
---|---|---|---|
bestPathId | bgp:PathId (scalar:Uint32) | Bestpath Id | RANGE: [0, 4294967295] |
numPaths | scalar:Uint32 | Number of paths available | RANGE: [0, 4294967295] |
pfx | address:Ip | Prefix | Value 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. | |
rtFlags | bgp:RtFlags (scalar:Bitmask32) | Flags | SELECTION: 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 |
ver | bgp:RtVer (scalar:Uint32) | Version of the route | RANGE: [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 Name | Data Type | Description | Values |
---|---|---|---|
aggr | address:Ip | Aggregator | Value must match ipv4 or ipv6 known format |
aggrAs | bgp:AsnNum (string:Basic) | Aggregator AS | A sequence of characters |
asPath | string:Basic | AS-Path | A 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 Name | Data Type | Description | Values |
---|---|---|---|
order | bgp:Order (scalar:Uint16) | Order | RANGE: [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 Name | Data Type | Description | Values |
---|---|---|---|
asn | bgp:AsnNum (string:Basic) | AS number | A sequence of characters |
order | bgp:Order (scalar:Uint16) | Order | RANGE: [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:
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:
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 |
Related Documentation
For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
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: