API Endpoints and Parameters
This topic lists the supported API endpoints, parameters, and the REST API HTTP Response Codes for accessing Data Center Assurance using external APIs.
Supported API Endpoints
Data Center Assurance supports API requests for the following resources:
-
Sites
-
Systems
-
Links
-
Interfaces
-
Pods
-
Racks
-
Tags
There are two types of API endpoints built for each resource type:
-
Collection Retrieval endpoints–used to access groups of related resources. For example,
GET /api/v1/datacenter/orgs/<org-id>/inventory/systems -
Instance Retrieval endpoints–used to access a single, specific resource identified by a unique ID. For example,
GET /api/v1/datacenter/orgs/<org-id>/inventory/systems/<system-id>
Table 1 lists the API endpoints supported on Data Center Assurance to retrieve inventory information for each resource type.
Table 2 lists the API endpoints supported on Data Center Assurance to retrieve observability information from the data center network.
Table 3 lists the API endpoints supported on Data Center Assurance to execute certain operations in the data center network.
| Resource Type | API Endpoints |
|---|---|
|
Sites |
|
|
Systems |
|
|
Links |
|
|
Interfaces |
|
|
Pods |
|
|
Racks |
|
|
Tags |
|
| Type | Description | API Endpoints |
|---|---|---|
|
Anomalies |
Retrieves information about the anomalies raised in the network, and the list of impacted services or clients for specified anomalies. |
|
| Operation | Description | API Endpoints |
|---|---|---|
|
MAC Address Lookup Query |
Locates a MAC address within a particular site. |
See MAC Address Lookup Query for more details. |
|
Run System Command |
Executes a command on a system and creates a one-time retrievable resource with the results. |
Note:
You must have administrator privileges to execute the run command API endpoints. See Run System Command for more details. |
MAC Address Lookup Query
Table 4 lists the parameters supported by the API endpoints for MAC address lookup query.
| Parameter | Description |
|---|---|
|
|
The full or partial MAC address that you want to search for. Repeat this parameter to query multiple MAC addresses. |
|
|
The UUID of a system where you want to search for the MAC addresses. |
|
|
The ID of a VLAN where you want to search for the MAC addresses. Repeat this parameter to specify multiple VLAN IDs. |
|
|
The VXLAN Network Identifier (VNI) of a VXLAN where you want to search for the MAC addresses. Repeat this parameter to specify multiple VXLAN VNIs. |
|
|
The maximum number of items to return in the response. Default value is 100. |
|
|
The number of items to skip before starting to return results. Default value is 0. |
Run System Command
To execute a command on a system, you must use the two run command API endpoints in combination:
-
A POST request to run a CLI command on the specified system:
POST /api/v1/datacenter/orgs/<org-id>/operations/sites/<site-id>/systems/<system-id>/run-command -
A GET request to retrieve the result and output of the executed command:
GET /api/v1/datacenter/orgs/<org-id>/operations/sites/<site-id>/systems/<system-id>/run-command/request-id
The POST request to run the command must include the following fields:
| Field | Description |
|---|---|
|
|
The CLI command to be executed. |
|
|
The format of the CLI command output. The possible values are:
|
Executing this POST request returns a request ID assigned to the CLI command.
After you execute the POST request, run the GET request using the returned request ID to retrieve the result and output of the executed command in the format that you specified.
The POST endpoint can be invoked only once. Upon retrieval, the command result will be automatically removed.
Supported Parameters
You can add parameters to modify the output of your API request as per your requirements.
The table below describes the supported parameters and their functions, along with their values and examples.
| Parameter | Value | Description | Example |
|---|---|---|---|
|
|
Field name(s) |
Enter a comma-separated list of additional field names to include in the response. |
|
|
|
Reference name(s) |
Enter a reference name to view the name field for that reference. |
|
|
|
Filter conditions |
Select a subset of resources based on field values, logical conditions, and grouping. |
See the Supported Operators for Filtering section below for more information. |
|
|
Field name |
Sort by the specified field, either in ascending or descending order. |
|
|
|
Number |
Maximum number of items to return in the response. Default value is 100. |
|
|
|
Number |
Number of items to skip before starting to return results. Default value is 0. |
|
Supported Operators for Filtering
The following table lists the comparison operators supported for the
filter parameter.
| Operator | Description | Example |
|---|---|---|
|
|
Equals |
|
|
|
Not equals |
|
|
|
Greater than |
|
|
|
Greater or equal |
|
|
|
Less than |
|
|
|
Less or equal |
|
|
|
|
|
The following table lists the logical operators supported for the
filter parameter.
| Operator | Description | Example |
|---|---|---|
|
|
Logical AND |
|
|
|
Logical OR |
|
|
|
Logical NOT |
|
Output Fields of Endpoint Requests
Each resource type defines its fields in two categories:
- Core fields–represent the minimal, commonly required attributes of a resource.
- Additional fields–represent less commonly used or optional attributes that require more processing power.
The output for a collection retrieval endpoint returns only the core fields by
default. To include additional fields in the output, use the fields
query parameter.
The output for an instance retrieval endpoint displays both core and additional fields by default.
REST API HTTP Response Codes
After you run the API request on Data Center Assurance, it returns an output along with one of the following HTTP response codes.
| Status | Description |
|---|---|
200 |
OK. The Data Center Assurance API understood the call and answered it without errors. |
400 |
Bad Request. The API endpoint exists but its syntax/payload is incorrect. |
401 |
Unauthorized. The authentication toward the Data Center Assurance API failed. You could receive this code if your token is wrong, or if your token was not sent to the API with the proper format. Validate your authentication information. |
404 |
Not found. The API endpoint doesn’t exist, or the resource doesn’t exist. |