Cisco ACI JSON Examples
Cisco ACI uses JSON to store and exchange data with other devices and applications.
JSON is a text-based, human-readable format for representing simple data structures and associative arrays (called objects).
The following Cisco ACI JSON examples show how to create and delete a tenant, an application profile, and a Bridge Domain.
Create a Tenant
The following JSON code creates a tenant named “Demo” with a description of “Demo Tenant”:
POST https://<apic_ip_address>/api/mo/uni.json
Content-Type: application/json
Accept: application/json
{ “fvTenant”: { “attributes”: { “descr”: “Demo Tenant”, “name”: “Demo” } } }
Delete a Tenant
The following JSON code deletes the tenant named “Demo”:
DELETE https://<apic_ip_address>/api/mo/uni/tn-Demo.json
Content-Type: application/json
Accept: application/json
Create an Application Profile
The following JSON code creates an application profile named “DemoApp” with a description of “Demo Application Profile”:
POST https://<apic_ip_address>/api/mo/uni.json
Content-Type: application/json
Accept: application/json
{ “fvAp”: { “attributes”: { “descr”: “Demo Application Profile”, “name”: “DemoApp” } } }
Delete an Application Profile
The following JSON code deletes the application profile named “DemoApp”:
DELETE https://<apic_ip_address>/api/mo/uni/ap-DemoApp.json
Content-Type: application/json
Accept: application/json
Create a Bridge Domain
The following JSON code creates a bridge domain named “DemoBD” with a description of “Demo Bridge Domain”:
POST https://<apic_ip_address>/api/mo/uni.json
Content-Type: application/json
Accept: application/json
{ “fvBD”: { “attributes”: { “descr”: “Demo Bridge Domain”, “name”: “DemoBD” } } }
Delete a Bridge Domain
The following JSON code deletes the bridge domain named “DemoBD”:
DELETE https://<apic_ip_address>/api/mo/uni/bd-DemoBD.json
Content-Type: application/json
Accept: application/json