VMware vRealize Operations API

VMware vRealize Operations API

Getting Started

Welcome to the vRealize Operations API Reference Guide. This guide contains information about the APIs that you can use to interact with vRealize Operations. This information includes API authentication, status codes, rate limiting, and usage examples.

Authentication

vRealize Operations requires API requests to be authenticated. The first step in this workflow is to obtain an authentication token.
Obtain Authentication Token
The first setup is to acquire an authentication token using the following API:

POST Acquire Token
Using API Tokens
On subsequent API calls you will need to include the token returned in the above call using an HTTP header as follows:
 Authorization: vRealizeOpsToken <token_value> 
Handling Token Expiration
The API response will include the validity and expiresAt keys indicating the expiration details of the token. After this expiration period, subsequent calls to any vRealize Operations API will return the following error:
 {
  "message": "The provided token for auth scheme \"vRealizeOpsToken\" is either invalid or has expired.",
  "httpStatusCode": 401,
  "apiErrorCode": 1512
} 
When an API call fails with the above error, your script/program must acquire a token again, and afterwards use the newly retrieved one.

Status Codes

Refer the following table for generic status codes that apply to all the APIs. For more information, see the HTTP status code registry from the Related Files.
HTTP Status Code Error Code Description
301 Moved The requested resource must be accessed through the returned URI in the location header.
401 Unauthorized The credentials could not be verified.
403 Forbidden This operation is not allowed for your account type or the user does not have the role capability to perform this action.
404 Not Found The requested resource could not be found.
405 Method Unsupported Unsupported method for URL.
415 Content Type Invalid Invalid content type.
429 Rate Limit Exceeded The API request has exceeded the rate limit. For more information, refer the Rate Limiting/Concurrency guide.
500 Internal Error Internal server error.
503 Service Unavailable Service is currently unavailable.

Rate Limiting/Concurrency

There is a configured throttle of 300 concurrent requests with an additional throttle of 50 concurrent requests from a single client (defined as an IP address).

REST API Usage Examples

To get the adapter kinds, make a GET call that returns the adapter kind collection available in the environment.

1. Make a GET call. On success, you will get back all the available adapter kinds in the response.

 {
  "adapter-kind": [
    {
      "key": "ADAPTER_KEY",
      "name": "ADAPTER_KIND_NAME",
      "adapterKindType": "TYPE",
      "describeVersion": 10,
      "identifiers": [],
      "resourceKinds": [
          "RESOURCE_KIND",
          ...
      ]
    },
      ....
  ]
} 

2. Make a GET call with the desired adapter kind got from the above API call and retrieve all the resources having that adapter kind.

 {
  "pageInfo": {
    "totalCount": 1015,
    "page": 0,
    "pageSize": 1000
  },
  "resourceList": [{
    "creationTime": 1664767508088,
    "resourceKey": {
      "name": "RES_NAME",
      "adapterKindKey": "ADAPTER_KEY",
      "resourceKindKey": "RESOURCE_KIND",
      "resourceIdentifiers": [ ... ]
    },
    "resourceStatusStates": [ ... ],
                     ...,
    "identifier": "00697a47-a16b-4515-92e2-3567bc2c71e3"
  },
      ...
  ]}
} 

Getting Started with vRealize Operation REST APIs

vRealize Operations delivers a unified management platform to optimize, plan, and scale hybrid cloud deployments from applications to infrastructure, powered by AI/ML, as a service.

The vRealize Operations APIs provide information to developers who wish to build programmatic clients of vRealize Operations.

The information here is available for the On-prem and Cloud versions of vRealize Operations. The APIs follow the REST style and are available to all licensed users.