cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1496
Views
5
Helpful
4
Replies

getting vPC to PC to interface mappings using the API

cbueche
Level 1
Level 1

Dear specialists,

 

I'm an OSS engineer trying to understand Cisco APIC and SDN. Excuse my ignorance when it goes to network technologies, I haven't had the chance to be trained in those SDN things.... my know-how there was frozen at routers and switches with "show-running".

 

A network has been deployed on top of Nexus devices, using an APIC, version: 4.2(3l). I would like to use the REST API to recover some information from the live configuration, namely the list of virtual-port-channels, along with what port-channels are used to build them and what physical interfaces behind. So if this makes more sense, vPC --> Po --> Eth.

 

I know how to implement a REST client, but I can't grab this whole mess of fvCEp, fvAEPg, vpcIf, etc. Not sure if this needs to be that complex but I disgress...

Hints welcome !
Charles

1 Accepted Solution

Accepted Solutions

RedNectar
VIP
VIP

Hi Charles,

Hopefully someone else will give you a better answer, but as a starter, try this

moquery -c pcAggrIf | egrep "^dn|fop"

the class pcAggrIf should contain all you need to know, and you can glean the po number, the node number and the physical interface from the above - although I'm not sure it distinguishes between PCs and VPCs.

Example

admin@apic1:~> moquery -c pcAggrIf | egrep "^dn|fop"
dn                             : topology/pod-1/node-101/sys/aggr-[po18]
fop                            : eth1/10
dn                             : topology/pod-1/node-101/sys/aggr-[po19]
fop                            : eth1/43
dn                             : topology/pod-1/node-101/sys/aggr-[po20]
fop                            : eth1/42
dn                             : topology/pod-1/node-101/sys/aggr-[po21]
fop                            : eth1/41
dn                             : topology/pod-1/node-101/sys/aggr-[po22]
fop                            : eth1/36
dn                             : topology/pod-1/node-102/sys/aggr-[po19]
fop                            : eth1/10
dn                             : topology/pod-1/node-102/sys/aggr-[po20]
fop                            : eth1/43
dn                             : topology/pod-1/node-102/sys/aggr-[po21]
fop                            : eth1/42
dn                             : topology/pod-1/node-102/sys/aggr-[po22]
fop                            : eth1/41
dn                             : topology/pod-1/node-102/sys/aggr-[po23]
fop                            : eth1/36

I hope this helps


Don't forget to mark answers as correct if it solves your problem. This helps others find the correct answer if they search for the same problem


 

RedNectar aka Chris Welsh.
Forum Tips: 1. Paste images inline - don't attach. 2. Always mark helpful and correct answers, it helps others find what they need.

View solution in original post

4 Replies 4

RedNectar
VIP
VIP

Hi Charles,

Hopefully someone else will give you a better answer, but as a starter, try this

moquery -c pcAggrIf | egrep "^dn|fop"

the class pcAggrIf should contain all you need to know, and you can glean the po number, the node number and the physical interface from the above - although I'm not sure it distinguishes between PCs and VPCs.

Example

admin@apic1:~> moquery -c pcAggrIf | egrep "^dn|fop"
dn                             : topology/pod-1/node-101/sys/aggr-[po18]
fop                            : eth1/10
dn                             : topology/pod-1/node-101/sys/aggr-[po19]
fop                            : eth1/43
dn                             : topology/pod-1/node-101/sys/aggr-[po20]
fop                            : eth1/42
dn                             : topology/pod-1/node-101/sys/aggr-[po21]
fop                            : eth1/41
dn                             : topology/pod-1/node-101/sys/aggr-[po22]
fop                            : eth1/36
dn                             : topology/pod-1/node-102/sys/aggr-[po19]
fop                            : eth1/10
dn                             : topology/pod-1/node-102/sys/aggr-[po20]
fop                            : eth1/43
dn                             : topology/pod-1/node-102/sys/aggr-[po21]
fop                            : eth1/42
dn                             : topology/pod-1/node-102/sys/aggr-[po22]
fop                            : eth1/41
dn                             : topology/pod-1/node-102/sys/aggr-[po23]
fop                            : eth1/36

I hope this helps


Don't forget to mark answers as correct if it solves your problem. This helps others find the correct answer if they search for the same problem


 

RedNectar aka Chris Welsh.
Forum Tips: 1. Paste images inline - don't attach. 2. Always mark helpful and correct answers, it helps others find what they need.

Chris many thanks it helped a lot, I get exactly the fields I needed and it's much simpler now. Many thanks !

Glad it helped. BTW, with the right google search you'll find a video that explains the method I used to determine the class.

RedNectar aka Chris Welsh.
Forum Tips: 1. Paste images inline - don't attach. 2. Always mark helpful and correct answers, it helps others find what they need.

great video. Moquery is a good first step to identify API calls before turning back to Python to do the real work. Thx for your engagement and your blog on the subject !
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

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