cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
15013
Views
0
Helpful
0
Replies

ACI - Basic Scripting vs Obj Oriented Programming Package question

cowser1979
Level 1
Level 1

Hello

I am a Network Engineer with NO scripting/programming knowledge and I am dipping my toe into the scripting (json) capabilities on my ACI fabric. One of my biggest hurdles with my new ACI fabric (at least initially) is the repetitive nature of mapping EPGs to ports.  In our environment, we are migrating from a legacy 6500 and Nexus switching fabric to ACI 9k.  Initially we statically mapped existing DC VLANs to EPGs, and basically statically assign those vlans/epgs to individual interfaces (and in some cases PCs and VPCs) to simulate traditional trunk ports (we do not use L2 outs on these interfaces).

So in our environment we have several hundred vlans.  you can imagine that going thru the motions of statically mapping each epg to each "trunk" port gets a little tedious.  So, I used the API inspector to generate a config/script template, for mapping each epg to each port.  the issue is, while i can just keep modifying and pasting in this script, on a per EPG to Port basis. Is there a better way to create one LARGE JSON/XML script that encompasses each port change?  i cant seem to find a way to paste in more that one change at a time, and have POSTMAN accept it.  Is there something simple that I am missing?  Like a special character or something?  or Is that a limitation of API scripting?  in that there is no way to pair multiple changes in one session?  and that’s why you have to graduate to PYTHON?

example scripts...

COMBINE this change

10:11:56 DEBUG -

method: POST

url: https://10.62.60.18/api/node/mo/uni/tn-**tenetNAME/ap-***APP-PROFILE-Legacy/epg-epg-vlan10.json

payload{"fvRsPathAtt":{"attributes":{"encap":"vlan-10","instrImedcy":"immediate","tDn":"topology/pod-1/paths-101/pathep-[trunkPORTPROFILE-IntPolGrp]","status":"created"},"children":[]}}

response: {"imdata":[]}

WITH THIS CHANGE…

10:12:35 DEBUG -

method: POST

url: https://10.62.60.18/api/node/mo/uni/tn-**tenetNAME/ap-***APP-PROFILE-Legacy/epg-epg-vlan100.json

payload{"fvRsPathAtt":{"attributes":{"encap":"vlan-100","instrImedcy":"immediate","tDn":"topology/pod-1/paths-101/pathep-[trunkPORTPROFILE-IntPolGrp]","status":"created"},"children":[]}}

response: {"imdata":[]}

AND SO ON, and SO ON....

INTO ONE POST ACTION/SCRIPT

Thank you for any help!

0 Replies 0