Showing results for 
Search instead for 
Did you mean: 

ACI Programmability: Part 1 ACIToolkit

Cisco Employee

Created by Jason Gmitter

ACI programmability is rightfully getting a lot of attention lately due to its robust GUI and a RESTful API that supports both JSON and XML. ACI 's RESTful API will drastically help reduce the time it takes to deploy new network policy, update existing policy and deprovision policy for a new or existing application. Therefore, as a network engineer with 15 years in the industry and mostly only touching a CLI, I started to ask whether I should learn the GUI or learn how to leverage the RESTful API to reduce provisioning and deprovisioning times. I decided to invest my time in learning how best to take advantage of this rich API. However, I did recognize the ACI GUI is great for creating best practice configurations and verifying and testing them; but, leverage the API to automate the configurations best practices I created from the GUI for any new add, moves, changes or deletions.

I started researching the tools Cisco currently makes available to help a CLI jockey learn how to use this API. On, I came across Arya, CobraSDK and ACIToolKit as popular tools to program ACI. Which one should I learn first?

Arya ( is a code generator. It essentially allows me to save APIC objects in XML or JSON format that I created in the GUI and convert them into ACI Python SDK code, where I can automate and deploy configurations in seconds. For example, I can take JSON or XML from APIC Visor, the API Inspector or a REST query, and generate Python source code to build a full configuration in seconds. There are some caveats: Arya doesn't validate configurations or perform advanced lookup logic, but it's a great way to create code from JSON or XML objects or classes that already exist. I view it as a great tool to help with creating great code with the Cobra SDK. But I wasn't ready to create code yet.

Next, I looked at the Cobra ACI Python SDK ( Cobra has an all-inclusive ACI object model implemented that can essentially do everything to configure an ACI fabric. It not only has a Python library that provides native bindings for all the REST functions but also a complete copy of the object model, which means data integrity can be ensured. This is important as it validates the configuration before executing it on APIC. The Cobra SDK provides methods for performing lookups or queries and object creation, modification and deletion that match the REST methods used by the GUI. What's cool is that I can take policy built in the GUI and use it as a programming template to build new code for super fast deployments for other tenants and their applications. Here's a link to the Cobra API documentation ( Although I felt I wasn't quite ready for Cobra, I knew I would want to come back and learn how to use this SDK. If new to Python here is a great place to start:

Ultimately, I decided to learn the ACIToolkit first

The ACIToolkit is very use-case oriented; for example, it knows how to build an EPG, but doesn't know how to manipulate all of the underlying objects and class inheritances. The ACIToolkit also provides an NXOS like CLI for ACI; therefore, I can leverage some of my CLI skills. Here is an example of some of the CLI available to configure ACI:

Take a look at a sample ACIToolkit script for building out a simple tenant and the application network profile to support a new application deployment at I don't need to ssh or telnet to a number of switches to build this configuration, but instead I leveraged a single API where APIC distributes the policy to the fabric. You can imagine you can easily further customize this script to deploy for other applications.

If you want to evolve past the CLI samples and dive into Python, take a look at an example that leverages a simple Python script to create a tenant with a single EPG and assign it statically to 2 interfaces:

You can find a list of other ACIToolkit Python applications you can start to use at One of my favorites is the end point tracker. It allows me to search for a mac address or IP address anywhere within the fabric. I can sort by Tenant, Application Network Profile, or by EPG. It's extremely flexible to have a single interface to configure, monitor, audit and troubleshoot the fabric.

Lastly, you can find additional examples that allow you to build out the fabric or query information from the fabric leveraging ACITookit python scripts at The ACIToolkit is a great way to start to evolve from what I know with CLI, move onto python scripts, and get me ready to dive into learning the ACI Python SDK next (Cobra).

In summary, I chose to start with ACIToolkit because I wanted something easy to learn.

Start here and go through the documentation: let me know what you think.

You can install the ACIToolkit as a VM, Docker image or just git clone and run natively on your PC or MAC.

To get you started, I provided a short video to show you where to get started and a few sample demonstrations. Enjoy!

For clearer video:

Recognize Your Peers
Content for Community-Ad