Let’s now see how to write our first automation for Cisco ACI. As we mentioned, Cisco ACI is designed to be API-first, meaning that every operation is performed through APIs.
Cisco made an interesting design choice: to address the challenge of documenting APIs in an effective and long-lasting way, they built a web interface that itself uses only APIs. In other words, by observing what happens while we use the web interface, we can identify the APIs being called and the required parameters. In addition, Cisco added a feature to the web interface: API Inspector, which allows us to observe the APIs in use.
We can therefore say that Cisco ACI APIs are self-documenting. Cisco also provides an official APIC REST API User Guide . This guide will be very useful later on, but to get started, API Inspector is the fastest way to achieve results.
Let’s go through the process step by step.
First, connect to the APIC and go to Tools → Show API Inspector:
A new browser window will open, containing the API Inspector. Navigate through the web interface and add a tenant. If we look at the API Inspector window, we’ll see that it contains all the API calls performed during our actions:
For example, if we select our tenant in the web interface, we will find a POST call and its payload:
method: POST url: https://172.25.82.1/api/node/mo/uni/tn-AD-TEST.json payload: { "fvTenant": { "attributes": { "dn": "uni/tn-AD-TEST", "name": "AD-TEST", "rn": "tn-AD-TEST", "status": "created" }, "children": [] } }
Continue reading the post on Patreon .