Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Access Data Center Assurance Using APIs

This topic describes how to use REST API requests to read and monitor network resources from Data Center Assurance.

Data Center Assurance API Architecture

The API architecture of Data Center Assurance supports monitoring the performance of applications, services, and devices from the Data Center Assurance portal. Many of the monitoring actions that you can do in the portal, you can automate at scale by using APIs. APIs allow for a defined and faster way for machines to communicate with each other.

Many enterprise networks have existing workflows and systems to manage their network infrastructure. The ability to integrate Data Center Assurance to these workflows provides developers with access to the monitoring capabilities of Data Center Assurance.

The API endpoints for Data Center Assurance are designed in accordance with Representational State Transfer (REST) architectural principles, using standard HTTP methods, status codes, and JavaScript Object Notation (JSON)-based payloads to ensure simplicity, interoperability, and ease of adoption. The REST API exposes a set of well-defined, resource-oriented endpoints that allow you to programmatically access, manage, and automate key functions of the platform.

Currently, the REST APIs can be used to perform the same action as the Data Center Assurance dashboards to read and monitor some of the resources in the network infrastructure using the GET method. You can also execute CLI commands on specific systems in the network using the POST method.

Run API Requests on Data Center Assurance

To run API requests on Data Center Assurance by using REST APIs, you should be familiar working with tools such as Postman or CURL. This workflow shows how to monitor data on an organization using the Postman application.

You will need the following parameters to monitor network devices:

  • The URL to the environment where Data Center Assurance is running
  • ID of the organization that you want to monitor
  • Username for accessing the organization
  • Password for accessing the organization

To access Data Center Assurance using API requests on Postman:

  1. Download the Postman application from https://www.postman.com/downloads/.
  2. Install and configure Postman on your system.

    For information about working with Postman application, see Postman documentation.

  3. Select GET method from the drop-down. Enter your API request in the following format:
    https://dc.ai.juniper.net/<api-endpoint>

    Select POST method for the run command API endpoint.

    See Supported API Endpoints for a list of the API endpoints supported on Data Center Assurance.

    See Network Sustainability Analytics: API Endpoints and Parameters for information about accessing Data Center Assurance sustainability data using APIs.

  4. To run the API request, authenticate your request by using the API tokens that are generated from Data Center Assurance.
    1. Generate an API token by following the steps described in Add an API Token.
    2. Copy the generated token key.
    3. Add a key in the Header section with the following inputs:
    Note:
    • You can use API requests to access only the site(s) or site groups selected while creating the API token.

    • You must add an authorization key to the header for each HTTP request you run.

  5. Add parameters for the API endpoints in the Params section as required.

    See Supported Parameters for more information.

  6. Run the API request.

    Data Center Assurance returns an output to your API request in JSON format along with a HTTP response code.

    See REST API HTTP Response Codes for a list of possible HTTP responses and their descriptions.

Sample Output for an API Request to Data Center Assurance

The following is an example of an API request sent to Data Center Assurance with additional parameters:

The following is the output received from Data Center Assurance along with a 200 OK HTTP response: