cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
423
Views
1
Helpful
2
Replies

[ACI] [REST-API]: Need API to find APIC interface operational status

Forward
Level 1
Level 1

Hello ,

I was finding the API which gives me the interface status of APIC, I found one document but the API seems not to give me the interface status.

https://www.cisco.com/c/en/us/td/docs/switches/datacenter/aci/apic/sw/4-x/rest-api-config/Cisco-APIC-REST-API-Configuration-Guide-401/Cisco-APIC-REST-API-Configuration-Guide-401_chapter_0110.html
----------------------------------------------------------------------

Monitoring Physical Interface Statistics and Link State Using the REST API

You can use the REST API interface to poll for interface statistics. Several counters are available (for example, RX/TX, input/output / duplex, 30 second rates, 5 minute rate, unicast packets, multicast packets). Using the parent managed object, the children can be derived from it. To do this, you must have a good understanding of the object model and be able to navigate through the model to obtain the information desired using the example below.

Procedure


Step 1

Use the following base API call to get physical interface statistics:

Example:

https://apic-ip-address/api/node/mo/topology/pod-1/node-101/sys/phys-[eth1/1].json

Step 2

To determine the total ingress bytes on Leaf 101 port Eth1/1, you can issue the following API call:

Example:

 /topology/pod-1/node-101/sys/phys-[eth1/1].json 

Step 3

Visore allows you to dig deeper into the hierarchical tree. From the prior command, the operator can see children of the interface object, such as ingress and egress bytes. The child objects include the following:

Example:

/topology/pod-1/node-101/sys/phys-[eth1/1]/dbgEtherStats

 

I get the following API response error , Can somebody assist or provide right API

{
    "totalCount": "1",
    "imdata": [
        {
            "error": {
                "attributes": {
                    "code": "1",
                    "text": "the messaging layer was unable to deliver the stimulus (destination (node) is marked unavailable)"
                }
            }
        }
    ]
} 

 

 

1 Accepted Solution

Accepted Solutions

Forward
Level 1
Level 1

Thanks, I found the correct API
https://<APIC IP>/api/node/class/cnwPhysIf.json?&order-by=cnwPhysIf.modTs|desc

View solution in original post

2 Replies 2

@Forward just based on the error you posted, this would indicated that the destination node is marked as unavailable, which normally means the leaf switch you are trying to reach (node-101 in this case) is not reachable by the APIC. Have you confirmed this is connected ok?

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

Forward
Level 1
Level 1

Thanks, I found the correct API
https://<APIC IP>/api/node/class/cnwPhysIf.json?&order-by=cnwPhysIf.modTs|desc

Review Cisco Networking for a $25 gift card

Save 25% on Day-2 Operations Add-On License