Cisco ACI - Adding a Tenant from Postman Using the API

ACIAPICCisco

Before following these steps you need to have a token for the API stored in Postman. 

The process for this can be found here.


Creating the Tenant
Right Click on your Collection Name (Cisco ACI Sandbox in my case), and click "Add Request"




Right Click on your Collection Name (Cisco ACI Sandbox in my case), and click "Add Request"


There are a couple steps in this piece:

  1. Name the Request "Create Tenant".
  2. Change the yype of request from GET to POST, since we're pushing a configuration.
  3. You can use the following URL to test against the sandbox, but you can change the hostname to your own APIC.
https://sandboxapicdc.cisco.com/api/mo/uni.json

     4. Lastly in the Body you want to put the following JSON in place, and edit the name to whatever you'd like it to be. 
{
  "fvTenant" : {
   "attributes" : {
     "name" : "DBTN-Tenant"
     }
   }
}

    5. and finally, Click "Send"


Now we will want to validate that the Tenant was created which we can do by running a GET Request against the API. 


I named the Request "Show Tenants" You can use the following URL to test against the sandbox, but you can change the hostname to your own APIC.

https://sandboxapicdc.cisco.com/api/node/class/fvTenant.json

Click "Send"

Then do a find in the results for your tenant to confirm it has been created.

Alternatively, you can log into the GUI, and confirm its been created there as well.


I hope this helps, thanks!


Cisco's official documentation for their API is found here

Categories: ACI, APIC, Cisco