REST Examples

This chapter contains the following sections:

REST API Examples


Note


The word Schema is alternately known as Profile in this guide.


APIs for Authentication

User Login

The following is an example of how a user can login.

POST:

POST https://<host>:<port>/api/v1/auth/login

Request:

{
 "username": "bob",
 "password": "welcome"
}
 

Response:

HTTP/1.1 201 (Created)      -> Valid user credentials
{
  "userId": "592717d22000008b01db2749",
  "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.ey...fQ.QpfcqZdo-g-O0RGUmMZCVspIL7rYHjKJH0srX7Tl3wA",
  "permissions": [
    "view-sites",
    "manage-sites",
    "view-tenants",
    "manage-tenants"
  ]
}
 
HTTP/1.1 401(Unauthorized)   -> Invalid user credentials
{
  "code": 401,
  "message": "Invalid user credentials"
}


Note


  • This is the only API in Cisco ACI Multi-Site that does not require the Authorization header to be set.

  • The token in the above example has been trimmed for readability.


User Logout

The following is an example of how a user can logout.

DELETE:

DELETE https://<host>:<port>/api/v1/auth/logout

Request:

<empty>
 

Response:

HTTP/1.1 204

Refresh Token

The following is an example of how to refresh a token.

GET:

GET https://<host>:<port>/api/v1/auth/refresh-token

Request:

<empty> 

Response:

HTTP/1.1 200
{
  "userId": "592717d22000008b01db2749",
  "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.ey...fQ.YVGLUtVZYfrMa-Bpf7gk281dZ4uPg20pk1QF6ffH63w",
  "permissions": [
    "view-sites",
    "manage-sites",
    "view-tenants",
    "manage-tenants"
  ]
}

Note


Tokens in Cisco ACI Multi-Site expire every 20 minutes. For longer interactions, this API provides an ability to obtain new tokens for subsequent interactions.


Using Tokens on Authentication on APIs

Once the user token has been returned from the initial login API POST, this token must be inserted into a Header key called “Authorization” with the value of “Bearer [Token_ID]” for all subsequent API calls.

The following is an example of how to use tokens on authentication on APIs. In this example, it is to get a list of tenants.

GET:

GET https://<host>:<port>/api/v1/tenants -H 'Authorization': 'Bearer {token}'

Request:

curl http://localhost/api/v1/tenants -H 'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.ey...fQ.QpfcqZdo-g-O0RGUmMZCVspIL7rYHjKJH0srX7Tl3wA'

Authenticating and Maintaining an API Session

The following is an example of how to authenticate and maintain an API session.

  • Before you access the API, you must first log in with the username and password of a configured user.

  • When a login message is accepted, the API returns a data structure that includes a token that represents the session, and it also returns the permissions of the user.

  • The default timeout period is 20 minutes.

Login: Sent as a post message, this method logs in the user, and opens the session. A user object, with the name and password attributes and the response, contains a session token. A set of permissions given to this user are also returned as a part of the response body.

Refresh: Tokens in Multi-Site expire every 20 minutes. For longer interactions, this API provides an ability to obtain new tokens for subsequent interactions.

Login to Authenticate and Maintain an API Session

The following example shows how to login to authenticate and maintain an API session.

POST:

POST https://<host>:<port>/api/v1/auth/login

Request:

{
  "username": "georgewa",
  "password": "paSSword1”
}

Response:


Note


This is part of the response after a successful login.


{
  "userId": "0000ffff0000000000000020",
  "needsPasswordUpdate": false,
  "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1MDA2NTgyODMsImlhd
CI6MTUwMDY1NzA4MywiaXNzIjoiZTc3Zjc5OTBlYjA4NDhkZWEwZDk0YWY0NmMzMWZmNDYiLCJ1c2
VySWQiOiIwMDAwZmZmZjAwMDAwMDAwMDAwMDAwMjAiLCJ1c2VybmFtZSI6ImFkbWluIiwic
GVybWlzc2lvbnMiOlsidmlldy1zaXRlcyIsIm1hbmFnZS1zaXRlcyIsInZpZXctdGVuYW50
cyIsIm1hbmFnZS10ZW5hbnRzIiwidmlldy10ZW5hbnQtc2NoZW1hcyIsIm1hbmFnZS10ZW5
hbnQtc2NoZW1hcyIsInZpZXctc2NoZW1hcyIsIm1hbmFnZS1zY2hlbWFzIiwidmlldy11c2
VycyIsIm1hbmFnZS11c2VycyIsInZpZXctcm9sZXMiLCJtYW5hZ2Utcm9sZXMiLCJ2aWV3
LWxhYmVscyIsIm1hbmFnZS1sYWJlbHMiLCJwbGF0Zm9ybS1sb2dzIl19.KU5I4qynMKvj
2ye0f3yzEKdABkE6uQNjGXj6Z3bbbb",
  "permissions": [
    "view-sites",
[TRUNCATED] ...
  ]
}
Note: User has to copy above token, in the header of all the requests user need to access from now onward. 
Where the header key is ‘Authorization’
And value is ‘Bearer {token}’
============================End==============================

Refresh to Authenticate and Maintain an API Session

The following example shows how to refresh to authenticate and maintain an API session.

Tokens in Multi-Site expire every 20 minutes. For longer interactions, this API provides an ability to obtain new tokens for subsequent interactions.

GET:

GET https://<host>:<port>/api/v1/auth/refresh-token
-H 'Authorization': 'Bearer {token}'     

Note


Replace {token} with your current token.


Response:

{
  "userId": "0000ffff0000000000000020",
  "needsPasswordUpdate": false,
  "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1MDA2NTgyODMsImlhd
CI6MTUwMDY1NzA4MywiaXNzIjoiZTc3Zjc5OTBlYjA4NDhkZWEwZDk0YWY0NmMzMWZmNDYiLCJ1c2
VySWQiOiIwMDAwZmZmZjAwMDAwMDAwMDAwMDAwMjAiLCJ1c2VybmFtZSI6ImFkbWluIiwicGVybWlzc
2lvbnMiOlsidmlldy1zaXRlcyIsIm1hbmFnZS1zaXRlcyIsInZpZXctdGVuYW50cyIsIm1hbmFnZS10Z
W5hbnRzIiwidmlldy10ZW5hbnQtc2NoZW1hcyIsIm1hbmFnZS10ZW5hbnQtc2NoZW1hcyIsInZpZXctc2
NoZW1hcyIsIm1hbmFnZS1zY2hlbWFzIiwidmlldy11c2VycyIsIm1hbmFnZS11c2VycyIsInZpZXctcm9s
ZXMiLCJtYW5hZ2Utcm9sZXMiLCJ2aWV3LWxhYmVscyIsIm1hbmFnZS1sYWJlbHMiLCJwbGF0Zm9ybS1sb
2dzIl19.KU5I4qynMKvj2ye0f3yzEKdABkE6uQNjGXj6Z3bbbb",
  "permissions": [
    "view-sites",
[TRUNCATED] ...
  ]
}


The following is an example to get a list of tenants.

GET https://<host>:<port>/api/v1/tenants
-H 'Authorization': 'Bearer {token}'     

{
  "tenants": [
    {
      "id": "0000ffff0000000000000010",
      "name": "common",
      "displayName": "common",
      "siteAssociations": [
        {
          "siteId": "596e52244800007400840196",
          "securityDomains": []
        },
        {
          "siteId": "596e522a4800007700840198",
          "securityDomains": []
        }
      ],
      "userAssociations": [
        {
          "userId": "0000ffff0000000000000020"
        }
      ],
      "description": "Common tenant for use with all other tenants"
    }
  ]
}

APIs for Labels

Create a New Label

The following is an example of how to create a new label.

POST:

POST https://<host>:<port>/api/v1/labels 

Request:

{
  "name" : "devops",
  "type" : "site" 
}

Response:

HTTP/1.1 201
Location: /api/v1/labels/58202f7066e6e10001c41236
{
  "id": "58202f7066e6e10001c41236",
  "name" : "devops",
  "type" : "site"
}

Read Label Information

The following is an example of how to read label information.

GET:

GET https://<host>:<port>/api/v1/labels/58202f7066e6e10001c41236

Request:

<empty>

Response:

HTTP/1.1 200
{
  "id": "58202f7066e6e10001c41236",
  "name" : "devops",
  "type" : "site"
}

Update a Label

The following is an example of how to update a label.

PUT:

PUT https://<host>:<port>/api/v1/labels/58202f7066e6e10001c41236

Request:

{
    "id": "58202f7066e6e10001c41236",
    "name" : "test",
    "type" : "site" 
}

Response:

HTTP/1.1 200
{
  "id": "58202f7066e6e10001c41236",
  "name" : "test",
  "type" : "site"
}

Delete Labels

The following is an example of how to delete a label.

DELETE:

DELETE https://<host>:<port>/api/v1/labels/58202f7066e6e10001c41236


Request:

<empty>

Response:

HTTP/1.1 204

List Labels

The following is an example of how to list labels.

GET:

GET https://<host>:<port>/api/v1/labels


Note


Filtering, pagination, and sorting is currently not supported.


Request:

<empty>

Response:

HTTP/1.1 200
{
  "labels": [
    {
      "id": "58202f7066e6e10001c41236",
      "name" : "devops",
      "type" : "site"    
    },
    {
      "id": "58202fc466e6e10001c41237",
      "name" : "prod",
      "type" : "site"
    }
  ]
}

APIs for Roles

Read Role Information

The following is an example of how to read role information.

GET:

GET https://<host>:<port>/api/v1/role/591f58c1220000e406fa80b5 

Request:

<empty>

Response:

HTTP/1.1 200
{
  "id": "591f58c1220000e406fa80b5",
  "name": "role1",
  "displayName": "Role 1",
  "description": "Description for Role 1",
  "permissions": [
    "view-sites",
    "manage-sites",
    "view-tenants",
    "manage-tenants",
    "view-tenant-schemas",
    "view-schemas",
    "manage-schemas",
    "view-users",
    "manage-users",
    "view-roles",
    "manage-roles"
  ]
}

List Roles

The following is an example of how to list roles.

GET:

GET https://<host>:<port>/api/v1/roles 

Request:

<empty>

Response:

HTTP/1.1 200
{
  "roles": [
    {
      "id": "591f58c1220000e406fa80b5",
      "name": "role1",
      "displayName": "Role 1",
      "description": "Description for Role 1",
      "permissions": [
        "view-sites",
        "manage-sites",
        "view-tenants",
        "manage-tenants",
        "view-tenant-schemas",
        "view-schemas",
        "manage-schemas",
        "view-users",
        "manage-users",
        "view-roles",
        "manage-roles"
      ]
    },
    {
      "id": "591f5903220000f106fa80b6",
      "name": "role2",
      "displayName": "Role 2",
      "description": "Description for Role 2",
      "permissions": [
        "view-sites",
        "manage-sites",
        "view-tenants",
        "manage-tenants"
      ]
    }
  ]
}

APIs for Users

Create a New User

The following is an example of how to create a new user.

POST:

POST https://<host>:<port>/api/v1/users

 

Request:

{
 "username": "user1",
 "password": "Cisco@123!",
 "firstName": "Foo",
 "lastName": "Bar",
 "emailAddress": "noreply@cisco.com",
 "phoneNumber": "408-527-0000",
 "accountStatus": "active",
  "roles": [
    {
      "roleId": "591f5903220000f106fa80b6"
    }
  ]

Response:

HTTP/1.1 201
Location: /api/v1/users/58202f7066e6e10001c41236
{
  "id": "58202f7066e6e10001c41236",
  "username": "user1",
  "password": "******",
  "firstName": "Foo",
  "lastName": "Bar",
  "emailAddress": "noreply@cisco.com",
  "phoneNumber": "408-527-0000",
  "accountStatus": "active",
  "roles": [
    {
      "roleId": "591f5903220000f106fa80b6"
    }
  ]
}

Reset Password for an Existing User

The following is an example of how to reset the password for an existing user.

PUT:

PUT https://<host>:<port>/api/v1/users/58202f7066e6e10001c41236

 

Request:

{
  "currentPassword": "Cisco@123!",
   "newPassword":    "Cisco@456!"
}

Response:

HTTP/1.1 200 OK


Note


If a user password is system generated or generated by a user-manager in Multi-Site, then upon login, that user (including the admin) will be required to reset their own password.

The minimum requirements for the password field are as follows:

  • Minimum 6 characters must be used

  • At least one letter must be included

  • At least one number must be included

  • At least 1 special character must be used. But space and * are not supported.


Read User Information

The following is an example of how to read user information.

GET:

GET https://<host>:<port>/api/v1/users/58202f7066e6e10001c41236

 

Request:

<empty>

Response:

HTTP/1.1 200
{
  id": "58202f7066e6e10001c41236",
  "username": "user1",
  "password": "******",
  "firstName": "Foo",
  "lastName": "Bar",
  "emailAddress": "noreply@cisco.com",
  "phoneNumber": "408-527-0000",
  "accountStatus": "active",
  "roles": [
    {
      "roleId": "591f5903220000f106fa80b6"
    }
  ]
}

Update an Existing User

The following is an example of how to update an existing user.

PUT:

PUT https://<host>:<port>/api/v1/users/58202f7066e6e10001c41236

 

Request:

{
  id": "58202f7066e6e10001c41236",
  "username": "user1",
  "password": "******",
  "firstName": "Foo",
  "lastName": "Bar",
  "emailAddress": "noreply@cisco.com",
  "phoneNumber": "408-527-0000",
  "accountStatus": "active",
  "roles": [
    {
      "roleId": "591f58c1220000e406fa80b5"
    },
    {
      "roleId": "591f5903220000f106fa80b6"
    }
  ]
}

Response:

HTTP/1.1 200
{
  id": "58202f7066e6e10001c41236",
  "username": "user1",
  "password": "******",
  "firstName": "Foo",
  "lastName": "Bar",
  "emailAddress": "noreply@cisco.com",
  "phoneNumber": "408-527-0000",
  "accountStatus": "active",
  "roles": [
    {
      "roleId": "591f58c1220000e406fa80b5"
    },
    {
      "roleId": "591f5903220000f106fa80b6"
    }
  ]
}

Delete a User

The following is an example of how to delete a user.

DELETE:

DELETE https://<host>:<port>/api/v1/users/58202f7066e6e10001c41236

 

Request:

<empty>

Response:

HTTP/1.1 204

List Users

The following is an example of how to list users.

GET:

GET https://<host>:<port>/api/v1/users

 

Request:

<empty>

Response:

HTTP/1.1 200
{
  "users": [
    {
      "id": "58202f7066e6e10001c41236",
      "username": "user1",
      "password": "",
      "firstName": "Foo",
      "lastName": "Bar",
      "emailAddress": "noreply@cisco.com",
      "phoneNumber": "408-527-000",
      "accountStatus": "active",
      "roles": [
        {
          "roleId": "591f5903220000f106fa80b6"
        }
      ]
    },
    {
      "id": "58202fc466e6e10001c41237",
      "username": "user2",
      "password": "",
      "firstName": "Foo2",
      "lastName": "Bar2",
      "emailAddress": "noreply@cisco.com",
      "phoneNumber": "408-527-0000",
      "accountStatus": "Inactive",
      "roles": []
    }
  ]
}

List Roles That May Be Associated With Users

The following is an example of how to list roles that may be associated with users.

GET:

GET https://<host>:<port>/api/v1/users/allowed-roles

 

Request:

<empty>

Response:

HTTP/1.1 200
{
  "roles": [
    {
      "id": "591f58c1220000e406fa80b5",
      "displayName": "Role 1",
      "permissions": [
        "view-sites",
        "manage-sites",
        "view-tenants",
        "manage-tenants",
        "view-tenant-schemas",
        "view-schemas",
        "manage-schemas",
        "view-users",
        "manage-users",
        "view-roles",
        "manage-roles"
      ]
    },
    {
      "id": "591f5903220000f106fa80b6",
      "displayName": "Role 2",
      "permissions": [
        "view-sites",
        "manage-sites",
        "view-tenants",
        "manage-tenants"
      ]
    }
  ]
}

Retrieve Roles Associated With a User

The following is an example of how to retrieve roles associated with a user.

GET:

GET https://<host>:<port>/api/v1/users/58202f7066e6e10001c41236/roles

 

Request:

<empty>

Response:

HTTP/1.1 200
{
  "roles": [
    {
      "id": "591f58c1220000e406fa80b5",
      "displayName": "Role 1",
      "permissions": [
        "view-sites",
        "manage-sites",
        "view-tenants",
        "manage-tenants",
        "view-tenant-schemas",
        "view-schemas",
        "manage-schemas",
        "view-users",
        "manage-users",
        "view-roles",
        "manage-roles"
      ]
    }
  ]
}

Retrieve Permissions Associated With a User

The following is an example of how to retrieve permissions associated with a user.

GET:

GET https://<host>:<port>/api/v1/users/58202f7066e6e10001c41236/permissions

 

Request:

<empty>

Response:

HTTP/1.1 200
{
  "permissions": [
    "view-sites",
    "manage-sites",
    "view-tenants",
    "manage-tenants",
    "view-tenant-schemas",
    "view-schemas",
    "manage-schemas",
    "view-users",
    "manage-users",
    "view-roles",
    "manage-roles"
  ]
}

APIs for Fabric Connectivity

Get Fabric Connectivity for a Site

The following is an example of how to get fabric connectivity for a site.

GET:

GET https://<host>:<port>/api/v1/sites/fabric-connectivity

Request:

   <empty>

Response:

HTTP/1.1 200HTTP/1.1 200 {
"controlPlaneBgpConfig" : {
    "peeringType" : "full-mesh | route-reflector",
    "ttl" : 16,
    "keepAliveInterval" : 60,
    "holdInterval" : 180,
    "staleInterval" : 300,  
    "gracefulRestartEnabled" : true,
    "maxAsLimit" : 0
  },
  "ospfPolicies" : [ {
    "name" : "msc-ospf-policy-default",
    "networkType" : "broadcast | point-to-point | unspecified",
    "priority" : 1,
    "interfaceCost" : 1,
    "interfaceControls" : [ "advertise-subnet", "mtu-ignore", "bfd", "passive-participation" ], // Array of strings.. values are optional.. those are all possible values
    "helloInterval" : 10,
    "deadInterval" : 40,
    "retransmitInterval" : 5,
    "transmitDelay" : 1
  } ],
  "sites" : [ {
    "id" : "5935b0b633000088017723a4",
    "apicSiteId" : 1,
    "fabricId" : 1,
    "msiteEnabled" : true,  
    "msiteDataPlaneMulticastTep" : "11.30.1.1",
    "bgpAsn" : 1234,
    "bgpCommunity" : "extended:as2-nn4:4:15",
    "bgpPassword" : "",
    "ospfAreaId" : "57",      // Number or in IP address format
    "ospfAreaType" : "nssa | regular | stub",
    "ospfAreaCost" : 1,  
    "externalRoutedDomain" : "uni/l3dom-MultisiteL3Domain1-DoNotDelete",  
    "externalSubnetsToImport" : [ "20.23.10.0/16", "20.23.12.0/16"],
    "pods" : [ {
      "podId" : 1,
      "name" : "pod-1",    
      "msiteDataPlaneUnicastTep" : "11.20.1.1",
      "spines" : [ {
        "nodeId" : 201,
        "name" : "spine1",
        "ports" : [ {
          "portId" : "1/29",
          "ipAddress" : "20.23.10.1/24",
          "mtu": "inherit",      // value is ‘inherit’ or number from range 576 to 9000        
          "routingPolicy" : "msc-ospf-policy-default"
        } ],      
        "bgpPeeringEnabled" : true,      
        "msiteControlPlaneTep" : "11.11.11.11",   
        "routeReflectorEnabled" : true,
        "health" : {
          "score" : 93
        },
        "faults" : [ {
          "type" : "minor",
          "message" : "This fault occurs when a ntp configuration on a controller has problems",
          "code" : "F1700"
        }, {
          "type" : "minor",
          "message" : "This fault occurs when an End Point Group is incompletely or incorrectly configured.",
          "code" : "F0467"
        } ]
      } ],
      "health" : {
        "score" : 87
      },
      "faults" : [ {
        "type" : "major",
        "message" : "This fault occurs when vpc interface goes down while peer interface is also down.",
        "code" : "F1296"
      }, { "type" : "minor",
        "message" : "This fault occurs when psu is shut down",
        "code" : "F1451"
      } ]
    } ],
    "status" : {
      "state" : "success"
    },
    "health" : {
      "score" : 87
    },
    "faults" : [ {
      "type" : "major",
      "message" : "This fault occurs when a physical interface on a controller is in the link-down state.",
      "code" : "F0103"
    }, {
      "type" : "major",
      "message" : "Task or FSM failure on object of class dhcpPool",
      "code" : "F608160"
    } ]
  } ]
}

The following is an example of how to include fabric connectivity status for a site.

GET:

GET https://<host>:<port>/api/v1/sites/fabric-connectivity?include=status

Request:

   <empty>

Response:

HTTP/1.1 200
{
  ...
 
  "sites" : [ {
    "id" : "58dd7707120000370089450f",
    ...
    "status" : {
        "state" : "success"
    }
  }, {
    "id" : "58dd77071200003600894510",
    ...
    "status" : {
        "state" : "in-progress"
    }
  }, {
    "id" : "58dd77071200003600894520",
    ...
    "status" : {
        "state" : "failure",
        "message" : "Failed to sync with site 58dd77071200003600894520."
    }
  } ]
}

The following is an example of how to obtain fabric connectivity health faults.

GET:

GET https://<host>:<port>/api/v1/sites/fabric-connectivity?include=health,faults

Request:

   <empty>

Response:

HTTP/1.1 200HTTP/1.1 200
{
  ...
 
  "sites" : [ {
    "id" : "58dd7707120000370089450f",
    ...
    "pods" : [ {
        "podId" : 1,
        "name" : "pod-1",
        ...
        "spines" : [ {
            "nodeId" : 201,
            "name" : "spine1",
            ...
            "health" : { "score": 100 }
            "faults" : [ {
               "code":"F0103",
               "message": "...",
               "type": "minor"
             } ]
        } ]
    } ]
  } ]
}

Update Fabric Connectivity

The following is an example of how to get an update for fabric connectivity.

PUT:

PUT https://<host>:<port>/api/v1/sites/fabric-connectivity

Request:

{
"controlPlaneBgpConfig" : {
    "peeringType" : "full-mesh | route-reflector",
    "ttl" : 16,
    "keepAliveInterval" : 60,
    "holdInterval" : 180,
    "staleInterval" : 300,  
    "gracefulRestartEnabled" : true,
    "maxAsLimit" : 0
  },
  "ospfPolicies" : [ {
    "name" : "msc-ospf-policy-default",
    "networkType" : "broadcast | point-to-point | unspecified",
    "priority" : 1,
    "interfaceCost" : 1,
    "interfaceControls" : [ "advertise-subnet", "mtu-ignore", "bfd", "passive-participation" ], //values are optional
    "helloInterval" : 10,
    "deadInterval" : 40,
    "retransmitInterval" : 5,
    "transmitDelay" : 1
  } ],
  "sites" : [ {
    "id" : "5935b0b633000088017723a4",
    "apicSiteId" : 1,
    "fabricId" : 1,
    "msiteEnabled" : true,  
    "msiteDataPlaneMulticastTep" : "11.30.1.1",
    "bgpAsn" : 1234,
    "bgpCommunity" : "extended:as2-nn4:4:15",
    "bgpPassword" : "",
    "ospfAreaId" : "57",      // Number or in IP address format
    "ospfAreaType" : "nssa | regular | stub",
    "ospfAreaCost" : 1,  
    "externalRoutedDomain" : "uni/l3dom-MultisiteL3Domain1-DoNotDelete",  
    "externalSubnetsToImport" : [ "20.23.10.0/16", "20.23.12.0/16"],
    "pods" : [ {
      "podId" : 1,
      "name" : "pod-1",    
      "msiteDataPlaneUnicastTep" : "11.20.1.1",
      "spines" : [ {
        "nodeId" : 201,
        "name" : "spine1",
        "ports" : [ {
          "portId" : "1/29",
          "ipAddress" : "20.23.10.1/24",
          "mtu" : "inherit",      // value is ‘inherit’ or number from range 576 to 9000        
          "routingPolicy" : "msc-ospf-policy-default"
        } ],      
        "bgpPeeringEnabled" : true,      
        "msiteControlPlaneTep" : "11.11.11.11",   
        "routeReflectorEnabled" : true,
          } ],
    } ],
  } ]
}
 

Response:

{
"controlPlaneBgpConfig" : {
    "peeringType" : "full-mesh | route-reflector",
    "ttl" : 16,
    "keepAliveInterval" : 60,
    "holdInterval" : 180,
    "staleInterval" : 300,  
    "gracefulRestartEnabled" : true,
    "maxAsLimit" : 0
  },
  "ospfPolicies" : [ {
    "name" : "msc-ospf-policy-default",
    "networkType" : "broadcast | point-to-point | unspecified",
    "priority" : 1,
    "interfaceCost" : 1,
    "interfaceControls" : [ "advertise-subnet", "mtu-ignore", "bfd", "passive-participation" ], // Array of strings.. values are optional.. those are all possible values
    "helloInterval" : 10,
    "deadInterval" : 40,
    "retransmitInterval" : 5,
    "transmitDelay" : 1
  } ],
  "sites" : [ {
    "id" : "5935b0b633000088017723a4",
    "apicSiteId" : 1,
    "fabricId" : 1,
    "msiteEnabled" : true,  
    "msiteDataPlaneMulticastTep" : "11.30.1.1",
    "bgpAsn" : 1234,
    "bgpCommunity" : "extended:as2-nn4:4:15",
    "bgpPassword" : "",
    "ospfAreaId" : "57",      // Number or in IP address format
    "ospfAreaType" : "nssa | regular | stub",
    "ospfAreaCost" : 1,  
    "externalRoutedDomain" : "uni/l3dom-MultisiteL3Domain1-DoNotDelete",  
    "externalSubnetsToImport" : [ "20.23.10.0/16", "20.23.12.0/16"],
    "pods" : [ {
      "podId" : 1,
      "name" : "pod-1",    
      "msiteDataPlaneUnicastTep" : "11.20.1.1",
      "spines" : [ {
        "nodeId" : 201,
        "name" : "spine1",
        "ports" : [ {
          "portId" : "1/29",
          "ipAddress" : "20.23.10.1/24",
          "mtu" : "inherit",      // value is ‘inherit’ or number from range 576 to 9000        
          "routingPolicy" : "msc-ospf-policy-default"
        } ],      
        "bgpPeeringEnabled" : true,      
        "msiteControlPlaneTep" : "11.11.11.11",   
        "routeReflectorEnabled" : true,        
      } ],
    } ],
  } ]
}

Refresh Fabric Connectivity for a Site

The following is an example of how to refresh fabric connectivity for a site.

GET:

GET https://<host>:<port>/api/v1/sites/:id/fabric-connnectivity/refresh

Example: GET /api/v1/sites/58dd77071200003600894510/fabric-connectivity/refresh

Request:

   <empty>

Response:

HTTP/1.1 200
{
    "id" : "5935b0b633000088017723a4",
    "apicSiteId" : 1,
    "fabricId" : 1,
    "msiteEnabled" : true,  
    "msiteDataPlaneMulticastTep" : "11.30.1.1",
    "bgpAsn" : 1234,
    "bgpCommunity" : "extended:as2-nn4:4:15",
    "bgpPassword" : "",
    "ospfAreaId" : "57",      // Number or in IP address format
    "ospfAreaType" : "nssa | regular | stub",
    "ospfAreaCost" : 1,  
    "externalRoutedDomain" : "uni/l3dom-MultisiteL3Domain1-DoNotDelete",  
    "externalSubnetsToImport" : [ "20.23.10.0/16", "20.23.12.0/16"],
    "pods" : [ {
      "podId" : 1,
      "name" : "pod-1",    
      "msiteDataPlaneUnicastTep" : "11.20.1.1",
      "spines" : [ {
        "nodeId" : 201,
        "name" : "spine1",
        "ports" : [ {
          "portId" : "1/29",
          "ipAddress" : "20.23.10.1/24",
          "mtu" : "inherit",      // value is ‘inherit’ or number from range 576 to 9000        
          "routingPolicy" : "msc-ospf-policy-default"
        } ],      
        "bgpPeeringEnabled" : true,      
        "msiteControlPlaneTep" : "11.11.11.11",   
        "routeReflectorEnabled" : true,        
      } ]   
}

Fabric Leaf Switches and Physical Interfaces

Get Nodes

The following is an example of how to get nodes.

GET:

GET https://<host>:<port>/api/v1/aci/sites/:id/nodes?type=<leaf,spine> 

Request:

<empty>

Response:

HTTP/1.1 200
{
    "nodes" : [ {
        "dn" : "topology/pod-1/node-101",
        "name" : "leaf1",
        "type" : "leaf"
    }, {
        "dn" : "topology/pod-1/node-102",
        "name" : "leaf2",
        "type" : "leaf"
    } ]
}

Get Physical Interfaces Details

The following is an example of how to get physical interfaces details.

GET:

GET https://<host>:<port>/api/v1/aci/sites/:id/nodes/interfaces?node=<node_dn>&type=physical

Request:

<empty>

Response:

HTTP/1.1 200HTTP/1.1 200
{
  "interfaces": [
    {
      "dn": "topology/pod-1/paths-101/pathep-[eth1/1]",
      "name": "eth1/1",
      "type": "physical"
    },
    {
      "dn": "topology/pod-1/paths-101/pathep-[eth1/10]",
      "name": "eth1/10",
      "type": "physical"
    }
 ]
}

The following is an example of how to get physical interfaces, direct port channel type.

GET:

GET https://<host>:<port>/api/v1/aci/sites/:id/nodes/interfaces?type=dpc

Request:

<empty>

Response:

HTTP/1.1 200HTTP/1.1 200
{
  "interfaces": [
    {
      "dn": "topology/pod-1/paths-101/pathep-[Switch101_1-ports-3-4_PolGrp]",
      "name": "Switch101_1-ports-3-4_PolGrp",
      "type": "dpc"
    }
  ]
}

The following is an example of how to get physical interfaces, virtual port channel type.

GET:

GET https://<host>:<port>/api/v1/aci/sites/:id/nodes/interfaces?type=vpc

Request:

<empty>

Response:

HTTP/1.1 200HTTP/1.1 200
{
  "interfaces": [
    {
      "dn": "topology/pod-1/protpaths-101-102/pathep-[Switch101-102_1-ports-5_PolGrp]",
      "name": "Switch101-102_1-ports-5_PolGrp",
      "type": "vpc"
    }
  ]
}

APIs for Tenants

Create a Tenant

The following is an example of how to create a Tenant.

POST:

POST https://<host>:<port>/api/v1/tenants

Request:

{
    "displayName": "Tenant 2",
    "name": "Tenant2",
    "description": "Description for Tenant 2",
    "siteAssociations": [
        {
        "siteId": "58dfeae2fd0000fd00cee617",
        "securityDomains": ["TestSecurityDomain", "domain-mgmt"]
        }
    ],
    "userAssociations": [
        { "userId": "58202f7066e6e10001c41236" }
        { "userId": "58202fc466e6e10001c41237" }
    ]
}

Response:

HTTP/1.1 201
Location: /api/v1/tenants/58202f7066e6e10001c41236
{
  "id": "58ed806aa10000bb0044da1e",
  "name": "Tenant2",
  "displayName": "Tenant 2",
  "description": "Description for Tenant 2",
  "siteAssociations": [
    {
      "siteId": "58dfeae2fd0000fd00cee617",
      "securityDomains": [
        "TestSecurityDomain",
        "mgmt"
      ]
    }
  ],
  "userAssociations": [
    { "userId": "58202f7066e6e10001c41236" }
    { "userId": "58202fc466e6e10001c41237" }
  ]
}

Read Tenant Information

The following is an example of how to read Tenant information.

GET:

GET https://<host>:<port>/api/v1/tenants/58202f7066e6e10001c41236

Request:

<empty> 

Response:

HTTP/1.1 200
{
  "id": "58ed806aa10000bb0044da1e",
  "name": "Tenant2",
  "displayName": "Tenant 2",
  "description": "Description for Tenant 2",
  "siteAssociations": [
    {
      "siteId": "58dfeae2fd0000fd00cee617",
      "securityDomains": [
        "TestSecurityDomain",
        "mgmt"
      ]
    }
  ],
  "userAssociations": [
    { "userId": "58202f7066e6e10001c41236" }
    { "userId": "58202fc466e6e10001c41237" }
  ]
}

Update an Existing Tenant

The following is an example of how to update an existing Tenant.

PUT:

PUT https://<host>:<port>/api/v1/tenants/58202f7066e6e10001c41236

Request:

{
  {
  "id": "58ed806aa10000bb0044da1e",
  "name": "Tenant2",
  "displayName": "Tenant 2 (Updated)",
  "description": "Description for Tenant 2",
  "siteAssociations": [
    {
      "siteId": "58dfeae2fd0000fd00cee617",
      "securityDomains": [
        "TestSecurityDomain",
        "mgmt"
      ]
    }
  ],
  "userAssociations": [
    { "userId": "58202f7066e6e10001c41236" }
    { "userId": "58202fc466e6e10001c41237" }
    { "userId": "58202fc466e6e10001c41238" }
  ]
}

Note


"id" is optional, other attributes are mandatory even if unchanged.


Response:

HTTP/1.1 200
{
    "id": "58ed806aa10000bb0044da1e",
    "displayName": "Tenant 2 (Updated)",
    "name": "Tenant2",
    "description": "Description for Tenant 2",
    "siteAssociations": [
        {
        "siteId": "58dfeae2fd0000fd00cee617",
        "securityDomains": ["TestSecurityDomain", "mgmt"]
        }
    ],
    "userAssociations": [
      { "userId": "58202f7066e6e10001c41236" }
      { "userId": "58202fc466e6e10001c41237" }
      { "userId": "58202fc466e6e10001c41238" }
    ]
}

Delete a Tenant

The following is an example of how to delete a Tenant.

PUT:

DELETE https://<host>:<port>/api/v1/tenants/58202f7066e6e10001c41236

Request:

 <empty> 

Response:

HTTP/1.1 204

List Tenants

The following is an example of how to list Tenants.

PUT:

PUT https://<host>:<port>/api/v1/tenants/58202f7066e6e10001c41236

Request:

<empty>


Note


Filtering, pagination, and sorting is currently not supported.


Response:

HTTP/1.1 200
{
  "tenants": [
    {
      "id": "58ed7f22a10000a10044da19",
      "name": "test",
      "displayName": "test",
      "description": "Description for test",
      "siteAssociations": [
        {
          "siteId": "58dfeae2fd0000fd00cee617",
          "securityDomains": []
        }
      ],
      "userAssociations": [
      { "userId": "58202f7066e6e10001c41236" }
      { "userId": "58202fc466e6e10001c41237" }
      { "userId": "58202fc466e6e10001c41238" }
     ]
    },
    {
      "id": "58ed7f46a10000a50044da1a",
      "name": "Tenant1",
      "displayName": "Tenant 1",
      "description": "Description for Tenant 1",
      "siteAssociations": [
        {
          "siteId": "58dfeae2fd0000fd00cee617",
          "securityDomains": []
        }
      ],
      "userAssociations": [
      { "userId": "58202f7066e6e10001c41236" }
     ]
    },
    {
      "id": "58ed806aa10000bb0044da1e",
      "name": "Tenant2",
      "displayName": "Tenant 2 (Updated)",
      "description": "Description for Tenant 2",
      "siteAssociations": [
        {
          "siteId": "58dfeae2fd0000fd00cee617",
          "securityDomains": [
            "TestSecurityDomain",
            "mgmt"
          ]
        }
      ],
      "userAssociations": [
      { "userId": "58202f7066e6e10001c41236" }
     ]
    }
  ]
}

List Sites Associated with a Tenant

The following is an example of how to list sites associated with a Tenant.

GET:

GET /api/v1/tenants/allowed-sites

Request:

<empty>

Response:

HTTP/1.1 200
{
  "sites": [
    {
      "id": "591b6e5172040072044258ea",
      "name": "site1",
      "urls": [
        "https://10.23.236.232"
      ],
      "username": "admin",
      "password": "******",
      "siteId": "1"
    },
    {
      "id": "591b71353f00002700a2e8b1",
      "name": "site2",
      "urls": [
        "https://10.23.236.233"
      ],
      "username": "admin",
      "password": "******",
      "siteId": "2"
    }
  ]
}

List Users Associated with a Tenant

The following is an example of how to list users associated with a Tenant.

GET:

GET /api/v1/tenants/allowed-users

Request:

<empty>

Response:

HTTP/1.1 200
{
  "users": [
    {
      "id": "0000ffff0000000000000020",
      "username": "admin",
      "password": "******",
      "firstName": "Admin",
      "lastName": "Admin",
      "emailAddress": "admin@msc.com",
      "phoneNumber": "(888) 123-4567",
      "accountStatus": "active",
      "roles": [
        {
          "roleId": "0000ffff0000000000000031"
        }
      ]
    },
    {
      "id": "593b12e62000004b00f13b21",
      "username": "bob",
      "password": "******",
      "firstName": "Bob",
      "lastName": "Smith",
      "emailAddress": "bob@gmail.com",
      "phoneNumber": "(888) 123-7890",
      "accountStatus": "active",
      "roles": [
        {
          "roleId": "0000ffff0000000000000034"
        }
      ]
    },
    {
      "id": "593b12f62000005200f13b22",
      "username": "russ",
      "password": "******",
      "firstName": "Russ",
      "lastName": "King",
      "emailAddress": "russ@gmail.com",
      "phoneNumber": "(800) 123-4545",
      "accountStatus": "active",
      "roles": [
        {
          "roleId": "0000ffff0000000000000033"
        },
        {
          "roleId": "0000ffff0000000000000035"
        },
        {
          "roleId": "0000ffff0000000000000032"
        }
      ]
    }
  ]
}

List Schemas Associated with a Tenant

The following is an example of how to list Schemas associated with a Tenant.

GET:

GET /api/v1/tenants/:id/schemas

Request:

<empty>

Response:

{
  "schemas": [
    {
      "id": "594170153200003000a8b4fc",
      "displayName": "Schema 1",
      "templates": [],
      "sites": []
    },
    {
      "id": "594170153200003200a8b4fd",
      "displayName": "Schema 2",
      "templates": [],
      "sites": []
    },
    {
      "id": "594170153200003300a8b4ff",
      "displayName": "Schema 4",
      "templates": [],
      "sites": []
    }
  ]
}

List Schemas Associated with all Tenants

The following is an example of how to list Schemas associated with all Tenants.

GET:

GET /api/v1/tenants/schemas

Request:

<empty>

Response:

{
  "tenants": {
    "59416f953200004c008cc048": [
      {
        "id": "59416f9532000030008cc04a",
        "displayName": "Schema 1",
        "templates": [],
        "sites": []
      },
      {
        "id": "59416f9532000033008cc04b",
        "displayName": "Schema 2",
        "templates": [],
        "sites": []
      },
      {
        "id": "59416f9532000033008cc04d",
        "displayName": "Schema 4",
        "templates": [],
        "sites": []
      }
    ],
    "59416f9532000036008cc049": [
      {
        "id": "59416f9532000052008cc04c",
        "displayName": "Schema 3",
        "templates": [],
        "sites": []
      },
      {
        "id": "59416f9532000033008cc04d",
        "displayName": "Schema 4",
        "templates": [],
        "sites": []
      }
    ]
  }
}

Create a New Tenant Network Mapping

The following is an example of how to create a new Tenant network mapping.

PUT:

PUT /api/v1/tenants/:id/infra

Request:

{
  "externalEpgMappings": [
    {
      "siteMappings": [
        {
          "siteId": "59726e7a490000ea095b4cc8",
          "mapping": "uni/tn-Pepsi/out-L3Out-1/instP-Network"
        }
      ]
    }
  ]
}

Response:

HTTP/1.1 201
{
  "externalEpgMappings": [
    {
      "siteMappings": [
        {
          "siteId": "59726e7a490000ea095b4cc8",
          "mapping": "uni/tn-Pepsi/out-L3Out-1/instP-Network"
        }
      ]
    }
  ]
}

Get Existing Tenant Network Mappings

The following is an example of how to list existing Tenant network mappings.

GET:

GET /api/v1/tenants/:id/infra

Request:

<empty>

Response:

HTTP/1.1 201
{
  "externalEpgMappings": [
    {
      "siteMappings": [
        {
          "siteId": "59726e7a490000ea095b4cc8",
          "mapping": "uni/tn-Pepsi/out-L3Out-1/instP-Network"
        }
      ]
    }
  ]
}

APIs for Schemas

Create a New Schema

The following is an example of how to create a new Schema.

POST:

POST  https://<host>:<port>/api/v1/schemas

Request:

{
  "displayName": "Schema 1",
  "templates": [
    {
      "name": "template1",
      "displayName": "Template 1",
      "tenantId": "592c7c482501002501061578",
      "anps": [
        {
          "name": "anp1",
          "displayName": "Anp 1",
          "epgs": [
            {
              "name": "epg1",
              "displayName": "EPG 1",
              "contractRelationships": [
                {
                  "contractRef": "/templates/template1/contracts/contract1",
                  "relationshipType": "provider|consumer"
                }
              ],
              "subnets": [ {
                    "ip": "192.168.132.1/24",
                    "description": "Subnet for IT department",
                    "scope" : "private"
                    "shared": true
                }, {
                    "ip": "192.168.133.1/24",
                    "description": "Subnet for sales department",
                    "scope" : "public"
                    "shared": false
                }],
              "uSegEpg" : true,
              "uSegAttrs" : [ {
                        "name" : "IP1",
                        "displayName" : "...",
                        "description" : "...",
                        "type" : "ip",
                        "fvSubnet" : true,
                        "value" : "0.0.0.0"
                     }, {
                        "name" : "IP2",
                        "displayName" : "...",
                        "description" : "...",
                        "type" : "ip",
                        "fvSubnet" : false,
                        "value" : "192.168.132.1"
                     }, {
                        "name" : "MAC",
                        "displayName" : "...",
                        "description" : "...",
                        "type" : "mac",
                        "value" : "aa:bb:cc:dd:ee:ff"
                     }, {
                        "name" : "VM Name",
                        "displayName" : "...",
                        "description" : "...",
                        "type" : "vm-name",
                        "operator" : "equals | contains | startsWith | endsWith",
                        "value" : "..."
                     }, {
                        "name" : "VM Data Center",
                        "displayName" : "...",
                        "description" : "...",
                        "type" : "rootContName",
                        "operator" : "...",
                        "value" : "..."
                    }, {
                        "name" : "VM Hypervisor Identifier",
                        "displayName" : "...",
                        "description" : "...",
                        "type" : "hv",
                        "operator" : "...",
                        "value" : "..."
                    }, {
                        "name" : "VmOperatingSystem",
                        "displayName" : "...",
                        "description" : "...",
                        "type" : "guest-os",
                        "operator" : "...",
                        "value" : "..."
                    }, {
                        "name" : "VM Tag",
                        "displayName" : "...",
                        "description" : "...",
                        "type" : "tag",
                        "operator" : "...",
                        "category" : "...",
                        "value" : "..."
                    }, {
                        "name" : "Vm Identifier",
                        "displayName" : "...",
                        "description" : "...",
                        "type" : "vm",
                        "operator" : "...",
                        "value" : "..."
                    }, {
                        "name" : "Vm Vmm Domain",
                        "displayName" : "...",
                        "description" : "...",
                        "type" : "domain",
                        "operator" : "...",
                        "value" : "..."
                    }, {
                        "name" : "Vm Vnic Dn",
                        "displayName" : "...",
                        "description" : "...",
                        "type" : "vnic",
                        "operator" : "...",
                        "value" : "..."
                    } ],
              "bdRef": "/templates/template1/bds/bd1"
            },
            {
              "name": "epg2",
              "displayName": "EPG 2",
              "contractRelationships": [
                {
                  "contractRef": "/templates/template1/contracts/contract2",
                  "relationshipType": "provider|consumer"
                }
              ],
              "bdRef": "templates/template1/bds/bd1"
            }
          ]
        }
      ],
      "vrfs": [
        {
          "name": "vrf1",
          "displayName": "VRF 1"
        }
      ],
      "bds": [
        {
          "name": "bd1",
          "displayName": "BD 1",
          "l3UnknownMulticastFlooding": "flood|opt-flood",
          "intersiteBumTrafficAllow": true,
          "multiDestinationFlooding": "bd-flood|drop|encap-flood",
          "l2UnknownUnicast": "flood|proxy",
          "l2Stretch": true,
          "subnets": [ ... ],
          "vrfRef": "templates/template1/vrfs/vrf1"
        }
      ],
      "contracts": [
        {
          "name": "contract1",
          "displayName": "Contract 1",
          "filters": "80",
          "filterRelationships": [
            {
              "filterRef": "/templates/template1/filters/filter1",
              "directives": [
                "log|none"
              ]
            }
          ],
          "scope": "global|tenant|context|application-profile"
        },
        {
          "name": "contract2",
          "displayName": "Contract 2",
          "filters": "80",
          "scope": "global|tenant|context|application-profile"
        }
      ],
      "filters": [
        {
          "name": "filter1",
          "displayName": "Filter 1",
          "description": "",
          "entries": [
            {
              "name": "filterEntry11",
              "displayName": "Filter Entry 11",
              "description": "",
              "etherType": "ip",
              "ipProtocol": "icmp"
            },
            {
              "name": "filterEntry12",
              "displayName": "Filter Entry 12",
              "description": "",
              "etherType": "ip",
              "ipProtocol": "udp",
              "matchOnlyFragments": false,
              "sourceFrom": "dns",
              "sourceTo": "http",
              "destinationFrom": "dns",
              "destinationTo": "80"
            }
          ]
        },
        {
          "name": "filter2",
          "displayName": "Filter 2",
          "description": "",
          "entries": [
            {
              "name": "filterEntry21",
              "displayName": "Filter Entry 21",
              "description": "",
              "etherType": "arp|fcoe|ip|mac_security|mpls_ucast|trill|unspecified",
              "arpFlag": "request|reply|unspecified",
              "ipProtocol": "eigrp|egp|icmp|icmpv6|igmp|igp|l2tp|ospfigp|pim|tcp|udp|unspecified",
              "matchOnlyFragments": false,
              "stateful": false,
              "sourceFrom": "dns|ftp-data|http|https|pop3|rtsp|smtp|unspecified|[0..65535]",
              "sourceTo": "dns|ftp-data|http|https|pop3|rtsp|smtp|unspecified|[0..65535]",
              "destinationFrom": "dns|ftp-data|http|https|pop3|rtsp|smtp|unspecified|[0..65535]",
              "destinationTo": "dns|ftp-data|http|https|pop3|rtsp|smtp|unspecified|[0..65535]",
              "tcpSessionRules": [
                "acknowledgement|established|finish|synchronize|reset|unspecified",
                "acknowledgement|established|finish|synchronize|reset|unspecified"
              ]
            }
          ]
        }
      ]
    }
  ],
  "sites": [
    {
      "siteId": "58202f7066e6e10001c41236",
      "templateName": "template1",
      "bds": [
        {
          "bdRef": "/templates/template1/bds/bd1",
          "subnets": [ ... ]
        }
      ]
    },
    {
      "siteId": "69202f7066e6e10001c41247",
      "templateName": "template1",
      "anps": [
        {
          "anpRef": "/templates/template1/anps/anp1",
          "epgs": [
            {
              "epgRef": "/templates/template1/anps/anp1/epgs/epg1",
              "domainAssociations": [
                {
                  "dn": "uni/vmmp-VMware/dom-TestVMMDomain-DoNotDelete",
                  "domainType": "vmmDomain",
                  "deployImmediacy": "On Demand|Immediate",
                  "resolutionImmediacy": "On Demand|Immediate|Pre-provision",
                  "allowMicroSegmentation": true,
                  "allowPromiscuous": true,
                  "macChanges": false,
                  "allowForgedTransmits": true,
                  "delimiter": "delimiter",
                  "portEncapVlan": {
                    "vlanType": "vlan",
                    "vlan": 400
                  },
                  "deployImmediacy": "lazy",
                  "microSegVlan": {
                    "vlanType": "vlan",
                    "vlan": 450
                  },
                  "vlanEncapMode": "static"
                },
                {
                  "dn": "uni/phys-testPhysicalDomain-DoNotDelete",
                  "domainType": "physicalDomain",
                  "deployImmediacy": "On Demand|Immediate",
                  "resolutionImmediacy": "On Demand|Immediate|Pre-provision"
                },
                {
                  "dn": "uni/l2dom-TestL2Domain-DoNotDelete",
                  "domainType": "l2ExtDomain",
                  "deployImmediacy": "On Demand|Immediate",
                  "resolutionImmediacy": "On Demand|Immediate|Pre-provision"
                },
                {
                  "dn": "uni/l3dom-TestL3Domain-DoNotDelete",
                  "domainType": "l3ExtDomain",
                  "deployImmediacy": "On Demand|Immediate",
                  "resolutionImmediacy": "On Demand|Immediate|Pre-provision"
                },
                {
                  "dn": "uni/fc-TestFibreChannelDomain",
                  "domainType": "fibreChannelDomain",
                  "deployImmediacy": "On Demand|Immediate",
                  "resolutionImmediacy": "On Demand|Immediate|Pre-provision"
                }
              ],
              "staticPorts": [
                {
                    "type" : "port",
                    "path" : "topology/pod-1/paths-101/pathep[eth1/11]",
                    "portEncapVlan": 10,
                    "microSegVlan" : 8,
                    "deploymentImmediacy" : "immediate|lazy",
                    "mode" : "regular|native|untagged"
                }, {
                    "type" : "VPC",
                    "path" : "Topology/pod-1/protpaths-101-102/pathep[NFS-Storage]",
                    "portEncapVlan": 10,
                    "microSegVlan" : 8,
                    "deploymentImmediacy" : "Immediate",
                    "mode" : "Access"
                }, {
                    "type" : "DPC",
                    "path" : "...",
                    "portEncapVlan": 9,
                    "microSegVlan" : 8,
                    "deploymentImmediacy" : "OnDemand",
                    "mode" : "AccessUntagged"
                }
              ],
              "staticLeafs": [
                {
                    "path" : "topology/pod-1/node-201",
                    "portEncapVlan": 10
                }
              ]
            }
          ]
        }
      ],
      "bds": [
        {
          "bdRef": "/templates/template1/bds/bd1",
          "subnets": [ (see POST /templates) ]
        }
      ],
      "contracts": [
        {
          "contractRef": "/templates/template1/contracts/contract1",
          "serviceGraphTemplate": {
            "name": "SGT1"
          }
        }
      ]
    }
  ]
}

Response:

HTTP/1.1 201
Location: /api/v1/schemas/583c7c482501002501061985
{
  "id": "583c7c482501002501061985",
  "displayName": "Schema 1",
  "templates": [
    {
      "name": "template1",
      "displayName": "Template 1",
      "tenantId": "592c7c482501002501061578",
      "anps": [
        {
          "name": "anp1",
          "displayName": "Anp 1",
          "anpRef": "/schemas/583c7c482501002501061985/templates/template1/anps/anp1",
          "epgs": [
            {
              "name": "epg1",
              "displayName": "EPG 1",
              "epgRef": "/schemas/583c7c482501002501061985/templates/template1/anps/anp1/epgs/epg1",
              "contractRelationships": [
                {
                  "contractRef": "/schemas/583c7c482501002501061985/templates/template1/contracts/contract1",
                  "relationshipType": "provider|consumer"
                }
              ],
              "subnets": [ {
                    "ip": "192.168.132.1/24",
                    "description": "Subnet for IT department",
                    "scope" : "private"
                    "shared": true
                }, {
                    "ip": "192.168.133.1/24",
                    "description": "Subnet for sales department",
                    "scope" : "public"
                    "shared": false
                }],
              "uSegEpg" : true,
              "uSegAttrs" : [ {
                        "name" : "IP1",
                        "displayName" : "...",
                        "description" : "...",
                        "type" : "ip",
                        "fvSubnet" : true,
                        "value" : "0.0.0.0"
                     }, {
                        "name" : "IP2",
                        "displayName" : "...",
                        "description" : "...",
                        "type" : "ip",
                        "fvSubnet" : false,
                        "value" : "192.168.132.1"
                     }, {
                        "name" : "MAC",
                        "displayName" : "...",
                        "description" : "...",
                        "type" : "mac",
                        "value" : "aa:bb:cc:dd:ee:ff"
                     }, {
                        "name" : "VM Name",
                        "displayName" : "...",
                        "description" : "...",
                        "type" : "vm-name",
                        "operator" : "equals | contains | startsWith | endsWith",
                        "value" : "..."
                     }, {
                        "name" : "VM Data Center",
                        "displayName" : "...",
                        "description" : "...",
                        "type" : "rootContName",
                        "operator" : "...",
                        "value" : "..."
                    }, {
                        "name" : "VM Hypervisor Identifier",
                        "displayName" : "...",
                        "description" : "...",
                        "type" : "hv",
                        "operator" : "...",
                        "value" : "..."
                    }, {
                        "name" : "VmOperatingSystem",
                        "displayName" : "...",
                        "description" : "...",
                        "type" : "guest-os",
                        "operator" : "...",
                        "value" : "..."
                    }, {
                        "name" : "VM Tag",
                        "displayName" : "...",
                        "description" : "...",
                        "type" : "tag",
                        "operator" : "...",
                        "category" : "...",
                        "value" : "..."
                    }, {
                        "name" : "Vm Identifier",
                        "displayName" : "...",
                        "description" : "...",
                        "type" : "vm",
                        "operator" : "...",
                        "value" : "..."
                    }, {
                        "name" : "Vm Vmm Domain",
                        "displayName" : "...",
                        "description" : "...",
                        "type" : "domain",
                        "operator" : "...",
                        "value" : "..."
                    }, {
                        "name" : "Vm Vnic Dn",
                        "displayName" : "...",
                        "description" : "...",
                        "type" : "vnic",
                        "operator" : "...",
                        "value" : "..."
                    } ],
              "bdRef": "/schemas/583c7c482501002501061985/templates/template1/bds/bd1"
            },
            {
              "name": "epg2",
              "displayName": "EPG 2",
              "epgRef": "/schema/583c7c482501002501061985/template/template1/anp/anp1/epg/epg2",
              "contractRelationships": [
                {
                  "contractRef": "/schemas/583c7c482501002501061985/templates/template1/contracts/contract2",
                  "relationshipType": "provider|consumer"
                }
              ],
              "bdRef": "/schemas/583c7c482501002501061985/templates/template1/bds/bd1"
            }
          ]
        }
      ],
      "vrfs": [
        {
          "name": "vrf1",
          "displayName": "VRF 1",
          "vrfRef": "/schemas/583c7c482501002501061985/templates/template1/vrfs/vrf1"
        }
      ],
      "bds": [
        {
          "name": "bd1",
          "displayName": "BD 1",
          "bdRef": "/schemas/583c7c482501002501061985/templates/template1/bds/bd1",
          "l3UnknownMulticastFlooding": "flood|opt-flood",
          "intersiteBumTrafficAllow": true,
          "multiDestinationFlooding": "bd-flood|drop|encap-flood",
          "l2UnknownUnicast": "flood|proxy",
          "l2Stretch": true,
          "subnets": [ ... ],
          "vrfRef": "/schemas/583c7c482501002501061985/templates/template1/vrfs/vrf1"
        }
      ],
      "contracts": [
        {
          "name": "contract1",
          "displayName": "Contract 1",
          "contractRef": "/schemas/583c7c482501002501061985/templates/template1/contracts/contract1",
          "filters": "80",
          "filterRelationships": [
            {
              "filterRef": "/schemas/583c7c482501002501061985/templates/template1/filters/filter1",
              "directives": [
                "log"
              ]
            }
          ],
          "scope": "global|tenant|context|application-profile"
        },
        {
          "name": "contract2",
          "displayName": "Contract 2",
          "contractRef": "/schemas/583c7c482501002501061985/templates/template1/contracts/contract2",
          "filters": "80",
          "filterRelationships": [],
          "scope": "global|tenant|context|anp"
        }
      ],
      
      "filters": [
        {
          "name": "filter1",
          "displayName": "Filter 1",
          "description": "",
          "filterRef": "/schemas/583c7c482501002501061985/templates/template1/filters/filter1",
          "entries": [
            {
              "name": "filterEntry11",
              "displayName": "Filter Entry 11",
              "description": "",
              "etherType": "ip",
              "ipProtocol": "icmp"
            },
            {
              "name": "filterEntry12",
              "displayName": "Filter Entry 12",
              "description": "",
              "etherType": "ip",
              "ipProtocol": "udp",
              "matchOnlyFragments": false,
              "sourceFrom": "dns",
              "sourceTo": "http",
              "destinationFrom": "dns",
              "destinationTo": "http"
            }
          ]
        },
        {
          "name": "filter2",
          "displayName": "Filter 2",
          "description": "",
          "filterRef": "/schemas/583c7c482501002501061985/templates/template1/filters/filter2",
          "entries": [...]
        }
      ]
    }
  ],
  "sites": [
    {
      "siteId": "58202f7066e6e10001c41236",
      "templateName": "template1",
      "bds": [
        {
          "bdRef": "/schemas/583c7c482501002501061985/templates/template1/bds/bd1",
          "subnets": [ ... ]
        }
      ]
    },
    {
      "siteId": "69202f7066e6e10001c41247",
      "templateName": "template1",
      "anps": [
        {
          "anpRef": "/schemas/583c7c482501002501061985/templates/template1/anps/anp1",
          "epgs": [
            {
              "epgRef": "/schemas/583c7c482501002501061985/templates/template1/anps/anp1/epgs/epg1",
              "domainAssociations": [
                {
                  "dn": "uni/vmmp-VMware/dom-TestVMMDomain-DoNotDelete",
                  "domainType": "vmmDomain",
                  "deployImmediacy": "On Demand",
                  "resolutionImmediacy": "Immediate",
                  "allowMicroSegmentation": true,
                  "allowPromiscuous": true,
                  "macChanges": false,
                  "allowForgedTransmits": true,
                  "delimiter": "delimiter",
                  "microSegVlan": {
                    "vlanType": "vlan",
                    "vlan": 450
                  },
                  "portEncapVlan": {
                    "vlanType": "vlan",
                    "vlan": 400
                  },
                  "vlanEncapMode": "static"
                },
                {
                  "dn": "uni/phys-testPhysicalDomain-DoNotDelete",
                  "domainType": "physicalDomain",
                  "deployImmediacy": "On Demand",
                  "resolutionImmediacy": "Immediate"
                },
                {
                  "dn": "uni/l2dom-TestL2Domain-DoNotDelete",
                  "domainType": "l2ExtDomain",
                  "deployImmediacy": "On Demand",
                  "resolutionImmediacy": "Immediate"
                },
                {
                  "dn": "uni/l3dom-TestL3Domain-DoNotDelete",
                  "domainType": "l3ExtDomain",
                  "deployImmediacy": "On Demand",
                  "resolutionImmediacy": "Immediate"
                },
                {
                  "dn": "uni/fc-TestFibreChannelDomain",
                  "domainType": "fibreChannelDomain",
                  "deployImmediacy": "On Demand",
                  "resolutionImmediacy": "Immediate"
                }
              ],
            "staticPorts": [
                {
                    "type" : "port",
                    "path" : "topology/pod-1/paths-101/pathep[eth1/11]",
                    "portEncapVlan": 10,
                    "microSegVlan" : 8,
                    "deploymentImmediacy" : "immediate|lazy",
                    "mode" : "regular|native|untagged"
                }, {
                    "type" : "VPC",
                    "path" : "Topology/pod-1/protpaths-101-102/pathep[NFS-Storage]",
                    "portEncapVlan": 10,
                    "microSegVlan" : 8,
                    "deploymentImmediacy" : "Immediate",
                    "mode" : "Access"
                }, {
                    "type" : "DPC",
                    "path" : "...",
                    "portEncapVlan": 9,
                    "microSegVlan" : 8,
                    "deploymentImmediacy" : "OnDemand",
                    "mode" : "AccessUntagged"
                }
              ],
              "staticLeafs": [
                {
                    "path" : "topology/pod-1/node-201",
                    "portEncapVlan": 10
                }
 
              ]
            }
          ]
        }
      ],
      "bds": [
        {
          "bdRef": "/schemas/583c7c482501002501061985/templates/template1/bds/bd1",
          "subnet": [ (see POST /templates) ]
        }
      ],
      "contracts": [
        {
          "contractRef": "/schemas/583c7c482501002501061985/templates/template1/contracts/contract1",
          "serviceGraphTemplate": {
            "name": "SGT1"
          }
        }
      ]
    }
  ]
}

Read a Schema

The following is an example for reading a Schema.

GET

GET https://<host>:<port>/api/v1/schemas/583c7c482501002501061985

REQUEST

GET
Request Body:
  <empty>

RESPONSE

HTTP/1.1 200
{
  "id": "583c7c482501002501061985",
  "displayName": "Schema 1",
  ...
  << additional attributes >>
}

Schema Health Summary

The following is an example of a Schema health summary.


Note


This API call returns a summary of the health of all Schemas to which the currently logged in user has access. The summary includes aggregated health of all policies in a Schema that has been pushed to a site, on a per template/site basis, as well as template/tenant identity information. This API is used for the Policy Heatmap on the dashboard page in the GUI .

Only Schemas that have been deployed will have health information.


GET

GET /api/v1/schemas/health-summary

REQUEST


  <empty>

RESPONSE

{
  "schemas": [
    {
      "id": "5969609c400000570068d69d",
      "schemaId": "5965bb96340000d800908add",
      "displayName": "Schema-Provider-AD",
      "templates": [
        {
          "name": "Template1",
          "displayName": "AD-Template-500"
        }
      ],
      "healthFaults": [
        {
          "siteId": "595e9796c00000c00000d632",
          "templateName": "Template1"
        }
      ]
    },
    {
      "id": "596e94253e00005f01347df0",
      "schemaId": "596e93c0860000e802274ac6",
      "displayName": "Common Schema",
      "templates": [
        {
          "name": "Simulator1CommonTenant",
          "displayName": "Simulator 1 Common Tenant"
        },
        {
          "name": "ifav87-site3",
          "displayName": "ifav87-site3"
        }
      ],
      "healthFaults": [
        {
          "siteId": "596d00644400008d00ca4ed0",
          "templateName": "Simulator1CommonTenant",
          "health": {
            "score": 100
          }
        },
        {
          "siteId": "596ff6e61f00007a002d1880",
          "templateName": "ifav87-site3",
          "health": {
            "score": 100
          }
        }
      ]
    },
    {
      "id": "5971314e2100007800076f36",
      "schemaId": "59713115850000230144a54f",
      "displayName": "T2 Schema",
      "templates": [
        {
          "name": "Template1",
          "displayName": "Template 1"
        }
      ],
      "healthFaults": [
        {
          "siteId": "596d00644400008d00ca4ed0",
          "templateName": "Template1"
        }
      ]
    }
  ]
}

Schema Health Sync

The following is an example of how to sync health and fault information for all tenants in a schema from all the associated sites

GET

GET /api/v1/health/schemas/:schemaId/sync

REQUEST


  <empty>

RESPONSE

{
    "id": "5977ba963f0000de04760560",
    "schemaId": "5977ba913500006403c31911",
    "healthFaults": [
        {
            "siteId": "59726e7a490000ea095b4cc8",
            "templateName": "PespiTenant",
            "health": {
                "score": 100
            },
            "anps": [
                {
                    "anpRef": {
                        "schemaId": "5977ba913500006403c31911",
                        "templateName": "PespiTenant",
                        "anpName": "Pepsi-App"
                    },
                    "health": {
                        "score": 100
                    },
                    "faults": [],
                    "epgs": [
                        {
                            "epgRef": {
                                "schemaId": "5977ba913500006403c31911",
                                "templateName": "PespiTenant",
                                "anpName": "Pepsi-App",
                                "epgName": "App-EPG"
                            },
                            "health": {
                                "score": 100
                            },
                            "faults": []
                        }
                    ]
                }
            ],
            "vrfs": [
                {
                    "vrfRef": {
                        "schemaId": "5977ba913500006403c31911",
                        "templateName": "PespiTenant",
                        "vrfName": "TestVrf"
                    },
                    "health": {
                        "score": 100
                    },
                    "faults": []
                }
            ],
            "bds": [
                {
                    "bdRef": {
                        "schemaId": "5977ba913500006403c31911",
                        "templateName": "PespiTenant",
                        "bdName": "TestBD"
                    },
                    "health": {
                        "score": 100
                    },
                    "faults": []
                }
            ],
            "contracts": [
                {
                    "contractRef": {
                        "schemaId": "5977ba913500006403c31911",
                        "templateName": "PespiTenant",
                        "contractName": "TestContract"
                    },
                    "faults": []
                },
                {
                    "contractRef": {
                        "schemaId": "5977ba913500006403c31911",
                        "templateName": "PespiTenant",
                        "contractName": "TestContract2"
                    },
                    "faults": [
                        {
                            "type": "minor",
                            "message": "Configuration failed for Tenant Pepsi Contract TestContract2 due to Filter Not Present",
                            "code": "F1228"
                        }
                    ]
                }
            ]
        }
    ]
}

Delete Schema Health Information

The following is an example of how to delete health and fault information for a schema.

GET

GET /api/v1/schemas/health-summary

REQUEST


  <empty>

RESPONSE


  <empty>

Retrieving Schema Health and Faults

The following is an example for retrieving Schema health faults included.


Note


Health and Fault information is sideloaded with Schema configuration in a separate internal structure called "HealthFaults". This structure closely resembles the template structure in terms of hierarchy of policies, and it includes health information for policies that can have health (ANP, EPG, VRF, BD) and faults for all policies that can have faults (ANP, EPG, VRF, BD, Contract) . The HealthFaults structures exist on a per template/site basis. Health and fault data will only exist for policies that have been pushed.


GET

GET /api/v1/schemas/583c7c482501002501061985?include=health,faults

REQUEST

  <empty>

RESPONSE

HTTP/1.1 200
 
{
    "id": "5971480c1b000067319d7b3b",
    "displayName": "Schema 1",
    "templates": [
        {
            "name": "Template1",
            "displayName": "Template 1",
            "tenantId": "5952ebc21e00007b16c1a022",
            "anps": [
                {
                    "name": "ANP1",
                    "displayName": "ANP1",
                    "anpRef": "/schemas/5971480c1b000067319d7b3b/templates/Template1/anps/ANP1",
                    "epgs": [
                        {
                            "name": "EPG1",
                            "displayName": "EPG1",
                            "epgRef": "/schemas/5971480c1b000067319d7b3b/templates/Template1/anps/ANP1/epgs/EPG1",
                            "contractRelationships": [],
                            "subnets": [],
                            "uSegEpg": false,
                            "uSegAttrs": [],
                            "intraEpg": "unenforced",
                            "proxyArp": false,
                            "bdRef": "/schemas/5971480c1b000067319d7b3b/templates/Template1/bds/BD1"
                        }
                    ]
                }
            ],
            "vrfs": [
                {
                    "name": "VRF1",
                    "displayName": "VRF1",
                    "vrfRef": "/schemas/5971480c1b000067319d7b3b/templates/Template1/vrfs/VRF1"
                }
            ],
            "bds": [
                {
                    "name": "BD1",
                    "displayName": "BD1",
                    "bdRef": "/schemas/5971480c1b000067319d7b3b/templates/Template1/bds/BD1",
                    "l2UnknownUnicast": "proxy",
                    "intersiteBumTrafficAllow": true,
                    "optimizeWanBandwidth": false,
                    "l2Stretch": true,
                    "subnets": [],
                    "vrfRef": "/schemas/5971480c1b000067319d7b3b/templates/Template1/vrfs/VRF1"
                }
            ],
            "contracts": [
                {
                    "name": "Contract1",
                    "displayName": "Contract1",
                    "contractRef": "/schemas/5971480c1b000067319d7b3b/templates/Template1/contracts/Contract1",
                    "filterRelationships": [],
                    "scope": "context"
                },
                {
                    "name": "Contract2",
                    "displayName": "Contract2",
                    "contractRef": "/schemas/5971480c1b000067319d7b3b/templates/Template1/contracts/Contract2",
                    "filterRelationships": [
                        {
                            "filterRef": "/schemas/5971480c1b000067319d7b3b/templates/Template1/filters/Filter1",
                            "directives": [
                                "none"
                            ]
                        },
                        {
                            "filterRef": "/schemas/5971480c1b000067319d7b3b/templates/Template1/filters/Filter2",
                            "directives": [
                                "none"
                            ]
                        }
                    ],
                    "scope": "context"
                }
            ],
            "filters": [
                {
                    "name": "Filter1",
                    "displayName": "Filter1",
                    "filterRef": "/schemas/5971480c1b000067319d7b3b/templates/Template1/filters/Filter1",
                    "entries": []
                },
                {
                    "name": "Filter2",
                    "displayName": "Filter2",
                    "filterRef": "/schemas/5971480c1b000067319d7b3b/templates/Template1/filters/Filter2",
                    "entries": [
                        {
                            "name": "Entry1",
                            "displayName": "Entry1",
                            "description": "",
                            "etherType": "ip",
                            "ipProtocol": "tcp",
                            "matchOnlyFragments": false,
                            "stateful": false,
                            "sourceFrom": "unspecified",
                            "sourceTo": "unspecified",
                            "destinationFrom": "unspecified",
                            "destinationTo": "unspecified",
                            "tcpSessionRules": [
                                "unspecified"
                            ]
                        }
                    ]
                }
            ]
        }
    ],
    "sites": [
        {
            "siteId": "594b77e84400004000752a18",
            "templateName": "Template1",
            "anps": [],
            "vrfs": [],
            "bds": [],
            "contracts": []
        },
        {
            "siteId": "594b77dc4400004400752a17",
            "templateName": "Template1",
            "anps": [],
            "vrfs": [],
            "bds": [],
            "contracts": []
        }
    ],
    "healthFaults": [
        {
            "siteId": "594b77e84400004000752a18",
            "templateName": "Template1",
            "health": {
                "score": 100
            },
            "anps": [
                {
                    "anpRef": "/schemas/5971480c1b000067319d7b3b/templates/Template1/anps/ANP1",
                    "health": {
                        "score": 100
                    },
                    "faults": [
                        {
                            "type": "minor",
                            "message": "Configuration failed for EPG EPG1 due to BD IDs Not Allocated,Context IDs Not Allocated",
                            "code": "F0523"
                        }
                    ],
                    "epgs": [
                        {
                            "epgRef": "/schemas/5971480c1b000067319d7b3b/templates/Template1/anps/ANP1/epgs/EPG1",
                            "health": {
                                "score": 100
                            },
                            "faults": [
                                {
                                    "type": "minor",
                                    "message": "Configuration failed for EPG EPG1 due to BD IDs Not Allocated,Context IDs Not Allocated",
                                    "code": "F0523"
                                }
                            ]
                        }
                    ]
                }
            ],
            "vrfs": [
                {
                    "vrfRef": "/schemas/5971480c1b000067319d7b3b/templates/Template1/vrfs/VRF1",
                    "health": {
                        "score": 100
                    },
                    "faults": []
                }
            ],
            "bds": [
                {
                    "bdRef": "/schemas/5971480c1b000067319d7b3b/templates/Template1/bds/BD1",
                    "health": {
                        "score": 100
                    },
                    "faults": []
                }
            ],
            "contracts": [
                {
                    "contractRef": "/schemas/5971480c1b000067319d7b3b/templates/Template1/contracts/Contract1",
                    "faults": [
                        {
                            "type": "minor",
                            "message": "Configuration failed for Tenant DISA Contract Contract1 due to Filter Not Present",
                            "code": "F1228"
                        }
                    ]
                },
                {
                    "contractRef": "/schemas/5971480c1b000067319d7b3b/templates/Template1/contracts/Contract2",
                    "faults": []
                }
            ]
        },
        {
            "siteId": "594b77dc4400004400752a17",
            "templateName": "Template1",
            "health": {
                "score": 100
            },
            "anps": [
                {
                    "anpRef": "/schemas/5971480c1b000067319d7b3b/templates/Template1/anps/ANP1",
                    "health": {
                        "score": 100
                    },
                    "faults": [
                        {
                            "type": "minor",
                            "message": "Configuration failed for EPG EPG1 due to BD IDs Not Allocated",
                            "code": "F0523"
                        }
                    ],
                    "epgs": [
                        {
                            "epgRef": "/schemas/5971480c1b000067319d7b3b/templates/Template1/anps/ANP1/epgs/EPG1",
                            "health": {
                                "score": 100
                            },
                            "faults": [
                                {
                                    "type": "minor",
                                    "message": "Configuration failed for EPG EPG1 due to BD IDs Not Allocated",
                                    "code": "F0523"
                                }
                            ]
                        }
                    ]
                }
            ],
            "vrfs": [
                {
                    "vrfRef": "/schemas/5971480c1b000067319d7b3b/templates/Template1/vrfs/VRF1",
                    "health": {
                        "score": 100
                    },
                    "faults": []
                }
            ],
            "bds": [
                {
                    "bdRef": "/schemas/5971480c1b000067319d7b3b/templates/Template1/bds/BD1",
                    "health": {
                        "score": 100
                    },
                    "faults": []
                }
            ],
            "contracts": [
                {
                    "contractRef": "/schemas/5971480c1b000067319d7b3b/templates/Template1/contracts/Contract1",
                    "faults": [
                        {
                            "type": "minor",
                            "message": "Configuration failed for Tenant DISA Contract Contract1 due to Filter Not Present",
                            "code": "F1228"
                        }
                    ]
                },
                {
                    "contractRef": "/schemas/5971480c1b000067319d7b3b/templates/Template1/contracts/Contract2",
                    "faults": []
                }
            ]
        }
    ]
}

Update an Existing Schema

The following is an example for updating an existing Schema.

PUT

PUT  https://<host>:<port>/api/v1/schemas/583c7c482501002501061985

REQUEST

{
  "id": "583c7c482501002501061985",
  "displayName": "Schema 1 (Updated)",
  "templates": [...],
  "sites": [
    {
      "siteId": "58202f7066e6e10001c41236",
      "templateName": "template1",
      "vrfs": [
        {
          "vrfRef": "/schemas/583c7c482501002501061985/templates/template1/vrfs/vrf1",
          "bds": [
            {
              "bdRef": "/schemas/583c7c482501002501061985/templates/template1/vrfs/vrf1/bds/bd1",
              "subnet": "<subnet>"
            }
          ]
        }
      ]
    }
  ]
}

RESPONSE

HTTP/1.1 200
{
  "id": "583c7c482501002501061985",
  "displayName": "Schema 1 (Updated)",
  "templates": [...],
  "sites": [...]

Note


  • "id" is optional, other attributes are mandatory even if unchanged.

  • Many attributes in this example have been omitted for brevity, but they must be included in the PUT request. Refer to the full list of attributes in the POST example.

  • The "ref" values for existing sub-entities must be specified.


Delete a Schema

The following is an example for deleting a Schema.

DELETE

DELETE  https://<host>:<port>/api/v1/schemas/583c7c482501002501061985

REQUEST

DELETE
Request Body:
  <empty>
```

RESPONSE

HTTP/1.1 204

List Schema Identities

The following is an example for listing Schema identities.

GET

GET  https://<host>:<port>/api/v1/schemas/list-identity


Note


This provides a list of Schemas in the system with a few properties. Only template-tenant associations and template-site associations are returned. Policy configuration information in not included.


REQUEST

  <empty>

RESPONSE

HTTP/1.1 200
{
  "schemas": [
    {
      "id": "594b78792d00008000d5fb6f",
      "displayName": "Saad_Stretched",
      "templates": [
        {
          "name": "Template1",
          "displayName": "Template 3",
          "tenantId": "594b77c82d00006000d5fb6c",
          "anps": [],
          "vrfs": [],
          "bds": [],
          "contracts": [],
          "filters": []
        },
        {
          "name": "Template2",
          "displayName": "Template 2safsdf",
          "tenantId": "594b77c82d00006000d5fb6c",
          "anps": [],
          "vrfs": [],
          "bds": [],
          "contracts": [],
          "filters": []
        }
      ],
      "sites": [
        {
          "siteId": "594b77dc4400004400752a17",
          "templateName": "Template1",
          "anps": [],
          "vrfs": [],
          "bds": [],
          "contracts": []
        },
        {
          "siteId": "594b77e84400004000752a18",
          "templateName": "Template1",
          "anps": [],
          "vrfs": [],
          "bds": [],
          "contracts": []
        },
        {
          "siteId": "594b77e84400004000752a18",
          "templateName": "Template2",
          "anps": [],
          "vrfs": [],
          "bds": [],
          "contracts": []
        }
      ]
    },
    {
      "id": "594b790a2d0000a900d5fb70",
      "displayName": "SharedService",
      "templates": [
        {
          "name": "Template1",
          "displayName": "Template 1",
          "tenantId": "594b782d2d00006f00d5fb6d",
          "anps": [],
          "vrfs": [],
          "bds": [],
          "contracts": [],
          "filters": []
        }
      ],
      "sites": [
        {
          "siteId": "594b77dc4400004400752a17",
          "templateName": "Template1",
          "anps": [],
          "vrfs": [],
          "bds": [],
          "contracts": []
        }
      ]
    }
  ]
}

List Sites Associated to a Schema

The following is an example for listing sites associated to a Schema.

GET

GET https://<host>:<port>/api/v1/schemas/allowed-sites

REQUEST

GET
Request Body:
  <empty>

RESPONSE

HTTP/1.1 200
{
  "sites": [
    {
      "id": "591b6e5172040072044258ea",
      "name": "site1",
      "urls": [
        "https://10.23.236.232"
      ],
      "username": "admin",
      "password": "******",
      "siteId": "1"
    },
    {
      "id": "591b71353f00002700a2e8b1",
      "name": "site2",
      "urls": [
        "https://10.23.236.233"
      ],
      "username": "admin",
      "password": "******",
      "siteId": "2"
    }
  ]
}

List Tenants that Can Be Associated With a Schema

The following is an example of how to list Tenants that can be associated with a Schema.

POST:

POST  https://<host>:<port>/api/v1/schemas

Request:

<empty>

Response:

HTTP/1.1 200
{
  "tenants": [
    {
      "id": "591b6da1200000dc03b47a10",
      "name": "TenantA",
      "displayName": "Tenant A",
      "description": "Tenant A",
      "siteAssociations": [
        {
          "siteId": "591b6e5172040072044258ea",
          "securityDomains": []
        }
      ],
      "userAssociations": [
        {
          "userId": "0000ffff0000000000000020"
        },
        {
          "userId": "591b562f210000d000823836"
        }
      ]
    },
    {
      "id": "591b6e35200000f303b47a11",
      "name": "TenantB",
      "displayName": "Tenant B",
      "description": "Tenant B",
      "siteAssociations": [
        {
          "siteId": "591b6e5172040072044258ea",
          "securityDomains": []
        },
        {
          "siteId": "591b71353f00002700a2e8b1",
          "securityDomains": []
        }
      ],
      "userAssociations": [
        {
          "userId": "0000ffff0000000000000020"
        }
      ]
    }
  ]
}

List All Tenants Associated to Schemas

The following is an example of how to list all Tenants associated to Schemas:

Endpoint:

https://<host>:<port>/api/v1/schemas/sites

Request:

  <empty>

Response:

  
 HTTP/1.1 200
{
  "tenants": [
    {
      "id": "0000ffff0000000000000010",
      "name": "common",
      "displayName": "common",
      "siteAssociations": [],
      "userAssociations": [
        {
          "userId": "0000ffff0000000000000020"
        }
      ],
      "description": "Common tenant for use with all other tenants"
    },
    {
      "id": "593b102322000088009ff785",
      "name": "TenantA",
      "displayName": "Tenant A",
      "siteAssociations": [
        {
          "siteId": "593b101169000069002de4c6",
          "securityDomains": [
            "TestSecurityDomain"
          ]
        }
      ],
      "userAssociations": [
        {
          "userId": "593b12e62000004b00f13b21"
        }
      ],
      "description": ""
    },
    {
      "id": "593b12cc2300002600eb63bd",
      "name": "TenantB",
      "displayName": "Tenant B",
      "siteAssociations": [
        {
          "siteId": "593b101169000069002de4c6",
          "securityDomains": []
        }
      ],
      "userAssociations": [
        {
          "userId": "593b12f62000005200f13b22"
        },
        {
          "userId": "593eba36210000140183e1a1"
        }
      ],
      "description": ""
    }
  ]
}

List Sites That Can Be Associated With a Schema

The following is an example of how to list Sites that can be associated with a Schema.

POST:

POST  https://<host>:<port>/api/v1/schemas/allowed-sites

Request:

<empty>

Response:

HTTP/1.1 200
{
  "sites": [
    {
      "id": "591b6e5172040072044258ea",
      "name": "site1",
      "urls": [
        "https://10.23.236.232"
      ],
      "username": "admin",
      "password": "******",
      "siteId": "1"
    },
    {
      "id": "591b71353f00002700a2e8b1",
      "name": "site2",
      "urls": [
        "https://10.23.236.233"
      ],
      "username": "admin",
      "password": "******",
      "siteId": "2"
    }
  ]

List All Sites Associated to Schemas

The following is an example of all Sites associated to Schemas.

POST:

POST  https://<host>:<port>/api/v1/schemas/sites

Request:

<empty>

Response:

HTTP/1.1 200
{
  "sites": [
    {
      "id": "591b6e5172040072044258ea",
      "name": "site1",
      "urls": [
        "https://10.23.236.232"
      ],
      "username": "admin",
      "password": "******",
      "siteId": "1"
    },
    {
      "id": "591b71353f00002700a2e8b1",
      "name": "site2",
      "urls": [
        "https://10.23.236.233"
      ],
      "username": "admin",
      "password": "******",
      "siteId": "2"
    }
  ]
}

List Tenants That Can be Associated With a Schema

The following is an example of how to list Tenants that can be associated with a Schema.

POST:

POST  https://<host>:<port>/api/v1/schemas/allowed-tenants

Request:

<empty>

Response:

HTTP/1.1 200
{
  "tenants": [
    {
      "id": "591b6da1200000dc03b47a10",
      "name": "TenantA",
      "displayName": "Tenant A",
      "description": "Tenant A",
      "siteAssociations": [
        {
          "siteId": "591b6e5172040072044258ea",
          "securityDomains": []
        }
      ],
      "userAssociations": [
        {
          "userId": "0000ffff0000000000000020"
        },
        {
          "userId": "591b562f210000d000823836"
        }
      ]
    },
    {
      "id": "591b6e35200000f303b47a11",
      "name": "TenantB",
      "displayName": "Tenant B",
      "description": "Tenant B",
      "siteAssociations": [
        {
          "siteId": "591b6e5172040072044258ea",
          "securityDomains": []
        },
        {
          "siteId": "591b71353f00002700a2e8b1",
          "securityDomains": []
        }
      ],
      "userAssociations": [
        {
          "userId": "0000ffff0000000000000020"
        }
      ]
    }
  ]
}

List All Sites Associated to Schemas

The following is an example of all Sites associated to Schemas.

POST:

POST  https://<host>:<port>/api/v1/schemas/sites

Request:

<empty>

Response:

HTTP/1.1 200
{
  "sites": [
    {
      "id": "591b6e5172040072044258ea",
      "name": "site1",
      "urls": [
        "https://10.23.236.232"
      ],
      "username": "admin",
      "password": "******",
      "siteId": "1"
    },
    {
      "id": "591b71353f00002700a2e8b1",
      "name": "site2",
      "urls": [
        "https://10.23.236.233"
      ],
      "username": "admin",
      "password": "******",
      "siteId": "2"
    }
  ]
}

APIs for Import

Import a Tenant from APIC

The following is an example showing how to import a tenant from APIC.

GET

GET  https://<host>:<port>/api/v1/import/sites/:id/tenants/:tenantId/templates/:templateName

An example: /api/v1/import/sites/58b5f5ca390000390078e257/tenants/58b5f5ca390000390078e257/templates/template1

REQUEST

<empty>

RESPONSE

{
  "displayName": "",
  "templates": [
    {
      "name": "Template1",
      "displayName": "Template1",
      "tenantId": "5923588f800000e302e2a4fd",
      "anps": [
        {
          "name": "ANP1",
          "displayName": "ANP1",
          "anpRef": "/templates/Template1/anps/ANP1",
          "epgs": [
            {
              "name": "EPG1",
              "displayName": "EPG1",
              "epgRef": "/templates/Template1/anps/ANP1/epgs/EPG1",
              "contractRelationships": [
                {
                  "relationshipType": "provider",
                  "contractRef": "/templates/Template1/contracts/Contract1"
                }
              ],
              "subnets": [
                {
                  "ip": "10.0.0.1/24",
                  "scope": "private",
                  "shared": false
                },
                {
                  "ip": "5.5.5.5/21",
                  "scope": "private",
                  "shared": false
                }
              ],
              "uSegEpg": false,
              "uSegAttrs": [],
              "intraEpg": "unenforced",
              "bdRef": "/templates/Template1/bds/BD1"
            },
            {
              "name": "UntitledEPG1",
              "displayName": "UntitledEPG1",
              "epgRef": "/templates/Template1/anps/ANP1/epgs/UntitledEPG1",
              "contractRelationships": [],
              "subnets": [],
              "uSegEpg": false,
              "uSegAttrs": [],
              "intraEpg": "unenforced",
              "bdRef": "/templates/Template1/bds/BD1"
            }
          ]
        },
        {
          "name": "UntitledANP1",
          "displayName": "UntitledANP1",
          "anpRef": "/templates/Template1/anps/UntitledANP1",
          "epgs": [
            {
              "name": "EPG-Test",
              "displayName": "EPG-Test",
              "epgRef": "/templates/Template1/anps/UntitledANP1/epgs/EPG-Test",
              "contractRelationships": [],
              "subnets": [],
              "uSegEpg": false,
              "uSegAttrs": [],
              "intraEpg": "unenforced",
              "bdRef": "/templates/Template1/bds/BD1"
            }
          ]
        },
        {
          "name": "anp323",
          "displayName": "anp323",
          "anpRef": "/templates/Template1/anps/anp323",
          "epgs": [
            {
              "name": "sadfas",
              "displayName": "sadfas",
              "epgRef": "/templates/Template1/anps/anp323/epgs/sadfas",
              "contractRelationships": [],
              "subnets": [],
              "uSegEpg": false,
              "uSegAttrs": [],
              "intraEpg": "unenforced",
              "bdRef": "/templates/Template1/bds/BD1"
            }
          ]
        }
      ],
      "vrfs": [
        {
          "name": "VRF1",
          "displayName": "VRF1",
          "vrfRef": "/templates/Template1/vrfs/VRF1"
        },
        {
          "name": "VRF2",
          "displayName": "VRF2",
          "vrfRef": "/templates/Template1/vrfs/VRF2"
        }
      ],
      "bds": [
        {
          "name": "BD1",
          "displayName": "BD1",
          "bdRef": "/templates/Template1/bds/BD1",
          "l2UnknownUnicast": "proxy",
          "intersiteBumTrafficAllow": false,
          "l2Stretch": true,
          "subnets": [],
          "vrfRef": "/templates/Template1/vrfs/VRF1"
        }
      ],
      "contracts": [
        {
          "name": "Contract1",
          "displayName": "Contract1",
          "contractRef": "/templates/Template1/contracts/Contract1",
          "filterRelationships": [
            {
              "filterRef": "/templates/Template1/filters/Filter1",
              "directives": []
            }
          ],
          "scope": "global",
          "subjectName": "subj1"
        },
        {
          "name": "Contract2",
          "displayName": "Contract2",
          "contractRef": "/templates/Template1/contracts/Contract2",
          "filterRelationships": [
            {
              "filterRef": "/templates/Template1/filters/Filter2",
              "directives": []
            },
            {
              "filterRef": "/templates/Template1/filters/Filter3",
              "directives": []
            }
          ],
          "scope": "global",
          "subjectName": "msc-subject"
        },
        {
          "name": "Contract3",
          "displayName": "Contract3",
          "contractRef": "/templates/Template1/contracts/Contract3",
          "filterRelationships": [],
          "scope": "context",
          "subjectName": "msc-subject"
        }
      ],
      "filters": [
        {
          "name": "Filter1",
          "displayName": "Filter1",
          "filterRef": "/templates/Template1/filters/Filter1",
          "entries": []
        },
        {
          "name": "Filter2",
          "displayName": "Filter2",
          "filterRef": "/templates/Template1/filters/Filter2",
          "entries": [
            {
              "name": "Entry2",
              "displayName": "Entry2",
              "etherType": "ip",
              "arpFlag": "unspecified",
              "ipProtocol": "unspecified",
              "matchOnlyFragments": false,
              "stateful": false,
              "sourceFrom": "unspecified",
              "sourceTo": "unspecified",
              "destinationFrom": "unspecified",
              "destinationTo": "unspecified",
              "tcpSessionRules": [
                "unspecified"
              ]
            }
          ]
        },
        {
          "name": "Filter3",
          "displayName": "Filter3",
          "filterRef": "/templates/Template1/filters/Filter3",
          "entries": []
        }
      ]
    }
  ],
  "sites": [
    {
      "siteId": "591b427d820000a70055bbd5",
      "templateName": "Template1",
      "anps": [
        {
          "anpRef": "/templates/Template1/anps/ANP1",
          "epgs": [
            {
              "epgRef": "/templates/Template1/anps/ANP1/epgs/EPG1",
              "domainAssociations": [
                {
                  "dn": "uni/phys-testPhysicalDomain-DoNotDelete",
                  "domainType": "physicalDomain",
                  "deployImmediacy": "lazy",
                  "resolutionImmediacy": "lazy"
                },
                {
                  "dn": "uni/l3dom-TestL3Domain-DoNotDelete",
                  "domainType": "l3ExtDomain",
                  "deployImmediacy": "lazy",
                  "resolutionImmediacy": "lazy"
                },
                {
                  "dn": "uni/fc-TestFibreChannelDomain",
                  "domainType": "fibreChannelDomain",
                  "deployImmediacy": "lazy",
                  "resolutionImmediacy": "lazy"
                },
                {
                  "dn": "uni/l2dom-TestL2Domain-DoNotDelete",
                  "domainType": "l2ExtDomain",
                  "deployImmediacy": "lazy",
                  "resolutionImmediacy": "lazy"
                }
              ],
              "staticPorts": [
                {
                  "type": "port",
                  "path": "topology/pod-1/paths-101/pathep-[eth1/1]",
                  "portEncapVlan": 1234,
                  "deploymentImmediacy": "lazy",
                  "mode": "regular"
                }
              ],
              "staticLeafs": [
                {
                  "path": "topology/pod-1/node-101",
                  "portEncapVlan": 1234
                }
              ],
              "faults": []
            },
            {
              "epgRef": "/templates/Template1/anps/ANP1/epgs/UntitledEPG1",
              "domainAssociations": [
                {
                  "dn": "uni/vmmp-VMware/dom-Fab1-DVS1",
                  "domainType": "vmmDomain",
                  "deployImmediacy": "lazy",
                  "resolutionImmediacy": "immediate",
                  "vlanEncapMode": "dynamic",
                  "allowMicroSegmentation": true
                },
                {
                  "dn": "uni/vmmp-VMware/dom-TestDomain",
                  "domainType": "vmmDomain",
                  "deployImmediacy": "lazy",
                  "resolutionImmediacy": "immediate",
                  "portEncapVlan": {
                    "vlanType": "vlan",
                    "vlan": 3
                  },
                  "vlanEncapMode": "static",
                  "allowMicroSegmentation": false
                },
                {
                  "dn": "uni/vmmp-VMware/dom-TestDomain-DoNotDelete",
                  "domainType": "vmmDomain",
                  "deployImmediacy": "lazy",
                  "resolutionImmediacy": "immediate",
                  "microSegVlan": {
                    "vlanType": "vlan",
                    "vlan": 2
                  },
                  "portEncapVlan": {
                    "vlanType": "vlan",
                    "vlan": 1
                  },
                  "vlanEncapMode": "static",
                  "allowMicroSegmentation": true
                }
              ],
              "staticPorts": [
                {
                  "type": "dpc",
                  "path": "topology/pod-1/paths-101/pathep-[abc]",
                  "portEncapVlan": 1234,
                  "deploymentImmediacy": "lazy",
                  "mode": "regular"
                }
              ],
              "staticLeafs": [],
              "faults": []
            }
          ],
          "faults": []
        },
        {
          "anpRef": "/templates/Template1/anps/UntitledANP1",
          "epgs": [
            {
              "epgRef": "/templates/Template1/anps/UntitledANP1/epgs/EPG-Test",
              "domainAssociations": [
                {
                  "dn": "uni/vmmp-VMware/dom-TestDomain-DoNotDelete",
                  "domainType": "vmmDomain",
                  "deployImmediacy": "lazy",
                  "resolutionImmediacy": "immediate",
                  "portEncapVlan": {
                    "vlanType": "vlan",
                    "vlan": 243
                  },
                  "vlanEncapMode": "static",
                  "allowMicroSegmentation": false
                }
              ],
              "staticPorts": [],
              "staticLeafs": [],
              "faults": []
            }
          ],
          "faults": []
        },
        {
          "anpRef": "/templates/Template1/anps/anp323",
          "epgs": [
            {
              "epgRef": "/templates/Template1/anps/anp323/epgs/sadfas",
              "domainAssociations": [],
              "staticPorts": [
                {
                  "type": "vpc",
                  "path": "topology/pod-1/protpaths-101-102/pathep-[vpc1]",
                  "portEncapVlan": 1234,
                  "deploymentImmediacy": "lazy",
                  "mode": "regular"
                }
              ],
              "staticLeafs": [],
              "faults": []
            }
          ],
          "faults": []
        }
      ],
      "vrfs": [],
      "bds": [
        {
          "bdRef": "/templates/Template1/bds/BD1",
          "subnets": [],
          "faults": []
        }
      ],
      "contracts": [
        {
          "contractRef": "/templates/Template1/contracts/Contract1",
          "serviceGraphTemplate": {
            "name": "TestSGT"
          },
          "faults": []
        },
        {
          "contractRef": "/templates/Template1/contracts/Contract2",
          "serviceGraphTemplate": {
            "name": "TestSGT"
          },
          "faults": []
        },
        {
          "contractRef": "/templates/Template1/contracts/Contract3",
          "faults": []
        }
      ]
    }
  ],
  "messages": {
    "contractMessages": [
      {
        "contractRef": "/templates/Template1/contracts/Contract1",
        "message": "Contract has multiple subjects. Only the first subject is imported."
      }
    ],
    "vrfMessages": [
      {
        "vrfRef": "/templates/Template1/vrfs/VRF1",
        "message": "VRF contains vzAny contracts which are not imported."
      },
      {
        "vrfRef": "/templates/Template1/vrfs/VRF2",
        "message": "VRF contains vzAny contracts which are not imported."
      }
    ]
  }
}

APIs for Sites

Create a New Site

The following is an example of how to create a new Site.

POST:

POST https://<host>:<port>/api/v1/sites

Request:

{
  "name": "APIC Site San Francisco",
  "urls": "http://16.105.47.201:8982/sf",
  "username": "admin",
  "password": "w3lcome3",
  "apicSiteId" : "1"
}

Response:

HTTP/1.1 201
Location: /api/v1/sites/58202f7066e6e10001c41236
{
  "id": "58202f7066e6e10001c41236",
  "name": "APIC Site San Francisco",
  "urls": "http://16.105.47.201:8982/sf",
  "username": "admin",
  "password": "w3lcome3",
  "siteId" : "1"
}

Read Site Information

The following is an example of how to get basic information about a new Site:

Endpoint:

https://<host>:<port>/api/v1/sites/58202f7066e6e10001c41236

Request:

  GET
Request Body:
  <empty>

Response:

  HTTP/1.1 200
{
  "id": "58202f7066e6e10001c41236",
  "name": "APIC Site San Francisco",
  "urls": [
    "http://16.105.47.201:8982/sf"
  ],
  "username": "admin",
  "password": "******",
  "apicSiteId": "1"
}

Read Site Information That Contains Health Faults

The following is an example of how to get basic information about a new Site that also contains health faults:

Endpoint:

https://<host>:<port>/api/v1/sites/58202f7066e6e10001c41236?include=health,faults,cluster-status

Request:

  GET
Request Body:
  <empty>

Response:

  
HTTP/1.1 200
{
  "id": "58202f7066e6e10001c41236",
  "name": "APIC Site San Francisco",
  "urls": [
    "http://16.105.47.201:8982/sf"
  ],
  "username": "admin",
  "password": "******",
  "apicSiteId": "1",
  "labels" : ["58202f7066e6e10001c41240", "58202f7066e6e10001c41241"],
  "health": {
    "score": 97
  },
  "clusterStatus": [
    {
      "controllerId": 1,
      "controllerName": "apic1",
      "ipAddress": "10.0.0.1",
      "adminState": "in-service",
      "operationalState": "available",
      "health": "fully-fit"    
    },
    {
      "controllerId": 2,
      "controllerName": "apic2",
      "ipAddress": "10.0.0.2",
      "adminState": "in-service",
      "operationalState": "available",
      "health": "fully-fit"    
    },
    {
      "controllerId": 3,
      "controllerName": "apic3",
      "ipAddress": "10.0.0.3",
      "adminState": "in-service",
      "operationalState": "available",
      "health": "fully-fit"    
    }
  ],
 
  "faults": [
    {
      "count": 0,
      "type": "critical"
    },
    {
      "count": 2,
      "type": "major"
    },
    {
      "count": 736,
      "type": "minor"
    },
    {
      "count": 914,
      "type": "warning"
    }
  ]
}

Update an Existing Site

The following is an example for updating an existing Site.

Endpoint:

https://<host>:<port>/api/v1/sites/58202f7066e6e10001c41236

Request

PUT
  {
  "id": "58202f7066e6e10001c41236",
  "name": "APIC Site San Francisco (Updated)",
  "urls": "http://16.105.47.201:8982/sf",
  "username": "root",
  "password": "w3lcome3",
  "apicSiteId" : "1"
}

Response

HTTP/1.1 200  
{
  "id": "58202f7066e6e10001c41236",
  "name": "APIC Site San Francisco (Updated)",
  "urls": "http://16.105.47.201:8982/sf",
  "username": "root",
  "password": "w3lcome3",
  "apicSiteId" : "1"
}

Delete a Site

The following is an example of how to delete a Site:

Endpoint:

https://<host>:<port>/api/v1/sites/58202f7066e6e10001c41236

Request:

  DELETE
Request Body:
  <empty>

Response:

  
 HTTP/1.1 204
Response Body:
  <empty>

List Sites

The following is an example of how to list all Sites:

Endpoint:

https://<host>:<port>/api/v1/sites

Request:

  GET
Request Body:
  <empty>

Response:

  HTTP/1.1 200
{
  "sites": [
    {
      "id": "58202f7066e6e10001c41236",
      "name": "APIC Site San Francisco",
      "urls": [
        "http://16.105.47.201:8982/sf"
      ],
      "username": "admin",
      "password": "******",
      "apicSiteId": "1"
    },
    {
      "id": "58202fc466e6e10001c41237",
      "name": "APIC Site San Jose",
      "urls": [
        "http://16.105.47.201:8982/sjc"
      ],
      "username": "root",
      "password": "******",
      "apicSiteId": "1"
    }
  ]
}


Note


Filtering, pagination, and sorting is currently not supported.


List Labels

List Labels of Site Type Associated to a Site

The following is an example of how to list labels of site type associated to a site.

GET:

GET /api/v1/sites/allowed-labels

Request:

<empty>


Note


Filtering, pagination, and sorting is currently not supported.


Response:

HTTP/1.1 200
{
  "labels": [
    {
      "id": "58202f7066e6e10001c41240",
      "name" : "devops",
      "type" : "site"   
    },
    {
      "id": "58202fc466e6e10001c41241",
      "name" : "prod",
      "type" : "site"
    },
    {
      "id": "58202f7066e6e10001c41242",
      "name" : "prod2",
      "type" : "site"   
    },
  ]
}

List Labels associated to a Site

The following is an example of how to list labels associated to a site.

GET:

GET /api/v1/sites/58202f7066e6e10001c41236/labels

Request:

<empty>


Note


Filtering, pagination, and sorting is currently not supported.


Response:

HTTP/1.1 200
{
  "labels": [
    {
      "id": "58202f7066e6e10001c41240",
      "name" : "devops",
      "type" : "site"   
    },
    {
      "id": "58202fc466e6e10001c41241",
      "name" : "prod",
      "type" : "site"
    }
  ]
}

APIs for Template

Execute a Template

The following is an example of how to execute a Template under a Schema to its associated sites.

GET:

api/v1/execute/schema/{schema-id}/template/{template-name}

Request:


Response:

HTTP/1.1 200
{"msg":"Successfully deployed"}

Undeploy a Template

The following is an example of how to undeploy a Template from its associated sites.

GET:

api/v1/execute/schema/{schema-id}/template/{template-name}?undeploy={site-id}

Request:


Response:

HTTP/1.1 200
{"msg":"Successfully deployed"}

APIs for Entities

List Domains

The following is an example of how to list domains.

List Domains:

GET https://<host>:<port>/api/v1/sites/:siteId/aci/domains?type=:type 

Example:

GET https://<host>:<port>/api/v1/sites/58202f7066e6e10001c41236/aci/domains?type=vmm 

Domain Types:

  • vmm

  • physical

  • L2Ext

  • l3Ext

  • fibreChannel

Request:

{
  <empty>
}

Response:

{
  "domains": [
    {
      "name": "cSphere",
      "dn": "uni/vmmp-VMware/dom-cSphere"
    },
    {
      "name": "Fab1-DVS1",
      "dn": "uni/vmmp-VMware/dom-Fab1-DVS1"
    },
    {
      "name": "TestDomain-DoNotDelete",
      "dn": "uni/vmmp-VMware/dom-TestDomain-DoNotDelete"
    }
  ]
}

List Service Graph Templates

The following is an example for updating an existing Site.

GET:

GET https://<host>:<port>/api/v1/sites/:id/aci/tenants/:name/service-graph-templates

Example

GET https://<host>:<port>//api/v1/sites/58202f7066e6e10001c41236/aci/tenants/tn-Fab1-Tenant-Dev1/service-graph-templates 

Request

{
  <empty>
}

Response

{
  "serviceGraphTemplates": [
    {
      "name": "TestGraph",
      "dn": "uni/tn-Fab1-Tenant-Dev1/AbsGraph-TestGraph"
    },
    {
      "name": "TestGraph2",
      "dn": "uni/tn-Fab1-Tenant-Dev1/AbsGraph-TestGraph2"
    }
  ]
}

List L3Outs

The following is an example for listing L3Outs.

GET:

GET https://<host>:<port>/api/v1/sites/:id/aci/tenants/:name/l3-outs

Request

{
  <empty>
}

Response

{
  "l3Outs": [
    {
      "name": "TestL3Out-DoNotDelete",
      "dn": "uni/tn-TestTenant-DoNotDelete/out-TestL3Out-DoNotDelete",
      "networkInstanceProfiles": [
        {
          "name": "TestNIP-1-DoNotDelete",
          "dn": "uni/tn-TestTenant-DoNotDelete/out-TestL3Out-DoNotDelete/instP-TestNIP-1-DoNotDelete"
        },
        {
          "name": "TestNIP-2-DoNotDelete",
          "dn": "uni/tn-TestTenant-DoNotDelete/out-TestL3Out-DoNotDelete/instP-TestNIP-2-DoNotDelete"
        }
      ]
    },
    {
      "name": "TestL3Out2",
      "dn": "uni/tn-TestTenant-DoNotDelete/out-TestL3Out2",
      "networkInstanceProfiles": [
        {
          "name": "N1",
          "dn": "uni/tn-TestTenant-DoNotDelete/out-TestL3Out2/Instp-N1"
        }
      ]
    }
  ]
}

APIs for Platform

Read Node Information

The following is an example of how to read node information.

GET:

GET /api/v1/platform/nodes

Request:

<empty>

Response:

HTTP/1.1 200
{
    "nodes": [
        {
            "id": "cfihme4upn2yfpgadx7xyv9u7",
            "state": "ready",
            "ip": "192.168.65.2",
            "hostname": "moby"
        }
    ]
}

Download Troubleshooting Report

The following is an example of how to download troubleshooting report.

GET:

GET /api/v1/platform/logs?include=schemas,sites,tenants,users,infra_logs

Request:

<empty>

Response:

HTTP/1.1 200
zip file named msc_report_<timestamp>.zip

Expected HTTP Response Code Examples

The following are examples of a few HTTP response codes:

400: Bad Request

{
  "code": 125,
  "info": {
    "obj.password": [
      "Missing path"
    ],
    "obj.username": [
      "Missing path"
    ],
    "obj.urls": [
      "Invalid urls"
    ]
  },
  "message": "Malformed body"
}

404: Entity not found or invalid endpoint

{
  "code": 404,
  "message": "Not Found"
}

409: Conflict - Duplicate entity/resource

{
  "code": 140,
  "message": "Duplicate Resource"
}