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

ACI fabric automation

gavin han
Level 1
Level 1

can we automate fabric and access policies?

 

I am going through ACI programmability module labs on devnet and it looks like all of these labs/modules are for tenant. I don't see any scripting for fabric and access policies? do we have to configure fabric and access policies manually?

1 Reply 1

Nik Noltenius
Spotlight
Spotlight

Hi,

yes, you can automate everything in ACI. In my opinion it takes a lot of effort to find the right objects, parameters and connections but basically it's all out there, publicly available. You just have to find and make sense of it ;)

 

E.g. this lets you create a VLAN-Pool via Python:

 

import cobra.mit.access
import cobra.mit.session
import cobra.mit.request
import cobra.model.fvns

# log into APIC and create a directory object
authentication = cobra.mit.session.LoginSession(URL, USER, PASSWORD)
mySession = cobra.mit.access.MoDirectory(authentication)
mySession.login()

# create VLAN Pool with VLAN 123
fabric = mySession.lookupByDn('uni/infra')
vlanpool = cobra.model.fvns.VlanInstP(parentMoOrDn=fabric, allocMode='static', name='TestPool')
vlans = cobra.model.fvns.EncapBlk(parentMoOrDn=vlanpool, from_='vlan-123', to='vlan-123')

# commit changes to fabric
request = cobra.mit.request.ConfigRequest()
request.addMo(vlanpool)
mySession.commit(request)

I'm not a developer so this might not be the best way to do it, but the message is: It can be done!

 

 

The online documentation is helpful (https://solutionpartner.cisco.com/media/apicDcPythonAPI_v0.1/index.html), Visore (the Object Store Browser) gives useful hints and the API Documentation on the APIC can also lead you the way.

 

Regards,

Nik

 

Review Cisco Networking for a $25 gift card

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