cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
286
Views
5
Helpful
4
Replies
Highlighted
Beginner

getting vPC to PC to interface mappings using the API

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
Highlighted
Collaborator

Re: getting vPC to PC to interface mappings using the API

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


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

View solution in original post

4 REPLIES 4
Highlighted
Collaborator

Re: getting vPC to PC to interface mappings using the API

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


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

View solution in original post

Highlighted
Beginner

Re: getting vPC to PC to interface mappings using the API

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

Re: getting vPC to PC to interface mappings using the API

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


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

Highlighted
Beginner

Re: getting vPC to PC to interface mappings using the API

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 !