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 DC 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.

Run API Requests on DC Assurance

To run API requests on DC 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 DC 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>

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

  4. To run the API request, authenticate your request by using the API tokens that are generated from DC 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.

    DC 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 DC Assurance

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

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