Baking Clouds Ltd

Baking Clouds provide tailored IT consultancy services to small and medium-sized companies; we cover all aspects of IT without any hidden costs.

vRealize Operations Tenant App 2.5 API reference

This post is about vRealize Operations Tenant App API documentation reference to help you know what can be done with the API

Tenant APP has been covered few times in our blog. If you did not have the chance to read the articles have at look on them if falls within your list of interest

https://bakingclouds.com/vmware-vrealize-operations-tenant-app-2-5-released/

https://bakingclouds.com/fix-unable-to-register-plugin-vrealize-operations-tenant-app-2-5-for-cloud-director/

https://bakingclouds.com/tenant-app-plugin-displays-access-denied-error-in-the-vcloud-director-user-interface/

https://bakingclouds.com/vrealize-operations-tenant-app-for-vcloud-director-2-0-reset-root-password/

Reason for this post to exist came during a conversation about Tenant APP 2.5 API to integrate with other solutions and realising is not documented in code.vmware.com and vRealize Operations API reference is for version 6.7

API Reference Index for VMware products on this link

Latest version of VMware vRealize Operations is 8.3 released on 2021-02-04 as was announced here

VMware vRealize Operations is 8.3 can be downloaded here

Tenant APP API Documentation

For the complete Swagger API JSON file check our GitHub link below

https://github.com/bakingclouds/vRealize-Operations-Tenant-App/blob/main/swagger.json

Authentication
Acquiring vROPs Token
POST
/suite-api/api/auth/token/acquire
acquire vROPs Token
Pricing Setting
Pricing Setting
GET
/suite-api/api/deployment/config/globalsettings/PROPAGATE_STORAGE_PROFILE_PRICE
get pricing setting
PUT
/suite-api/api/deployment/config/globalsettings/PROPAGATE_STORAGE_PROFILE_PRICE/{value}
set pricing setting
Pricing Policy Management
Pricing Policy Management
GET
/suite-api/internal/metering
get pricing policies list
POST
/tenant-app-api/pricingpolicy
create pricing policy
GET
/tenant-app-api/pricingpolicy/{id}
get pricing policy
PUT
/tenant-app-api/pricingpolicy/{id}
update pricing policy
DELETE
/tenant-app-api/pricingpolicy/{id}
delete pricing policy
Associate policy with OVDC
Associate policy with OVDC
POST
/suite-api/api/resources/{id}/properties
add properties to policy
Bill Management
Bill Management
POST
/tenant-app-api/bills
create bill
GET
/tenant-app-api/bills/{id}
get bill
DELETE
/tenant-app-api/bills/{id}
delete bill
POST
/tenant-app-api/bills/query
query bills
POST
/tenant-app-api/bills/schedule
schedule bill
GET
/tenant-app-api/bills/schedule
get bill schedules
Report Management
Report Management
POST
/suite-api/api/reports
create report
GET
/suite-api/api/reports
get reports
GET
/suite-api/api/reports/{id}
get report
DELETE
/suite-api/api/reports/{id}
delete report
GET
/suite-api/api/reports/{id}/download
Download report
Metric Management
Metric Management
GET
/suite-api/api/resources/{id}/statkeys
get metrics list
POST
/suite-api/api/resources/query
get resource list
GET
/suite-api/api/resources/stats
get metric as csv
POST
/suite-api/api/resources/stats/query
get metric value
GET
/tenant-app-api/access/pricesetting/PRICE_VALUE_TENANT
get price value of tenant
POST
/tenant-app-api/access/pricesetting/PRICE_VALUE_TENANT/{value}
show/hide price value to tenant
User Management
User Management
GET
/tenant-app-api/users
getAllUsers
POST
/tenant-app-api/users
createUser
GET
/tenant-app-api/users/{username}
getUser
DELETE
/tenant-app-api/users/{username}
deleteUser

Understanding vRealize Operations Tenant App API

Excerp of “Using vRealize Operations Tenant App for vCenter as a Service Provider” about using Tenant APP API as published here is below

Service Providers can use the API to build interactive clients of vRealize Operations Tenant App. The API follows the REST style and is available to all licensed users.

The Tenant App clients communicate with the server over HTTP, exchanging representations of Tenant App objects. These representations take the form of JSON elements. You use HTTP GET requests to retrieve the current representation of an object, HTTP POST, and PUT requests to create or modify an object, and HTTP DELETE requests to delete an object.

How the Tenant App API Works

Use a web browser to communicate with the vRealize Operations Tenant App analytics engine, either through the product user interface or through API calls.

The adapter instance collects data from objects in your monitored environment. The Tenant App analytics engine processes the data and displays the complete model in the graphical interface.

Why Use the API

The API is most useful when there is a need to automate a well-defined workflow, such as repeating the same tasks to configure the access control for new Tenant App users. The API is also useful when performing queries on the Tenant App data repository, such as retrieving data for particular assets in your virtual environment. In addition, you can use the API to extract all data from the Tenant App data repository and load it into a separate analytics system.

vRealize Operations Tenant App Terminology

The JSON syntax you use to describe the objects for an adapter corresponds to the API code syntax but differs from what you find in the user interface. The following terms appear in the user interface. Included with the description of each term is the corresponding JSON syntax used in an API call.

Adapter typesDefines the adapter used to discover particular object types. For example, the vCenter adapter discovers objects connected to vSphere data centers. The EMC adapter discovers EMC storage system objects.
JSON syntax: adapterkinds.
Object typesThe class of entities that represent objects or information sources. Objects report data to the vRealize Operations Manager analytics engine. Virtual machines, datastores, and host systems are examples of object types defined in a vCenter adapter model.
JSON syntax: resourcekinds.

Getting Started with the API

API clients and Tenant App servers communicate over HTTPS, exchanging JSON representations of API objects.

Acquire an Authentication Token

The Tenant App requires API requests to be authenticated. The first step in this workflow is to obtain an authentication token.

To obtain an authentication token, the login request supplies the user credentials in a form that Basic HTTP authentication requires. In this example, the user is logging in to a Tenant App instance with URL https://tenantapp.example.com/.

Procedure

POST a request to the login URL to acquire a token.

POST https://tenantapp.example.com/suite-api/api/auth/token/acquire

Examine the response.
A successful request returns an ops authorization token, which you must include in subsequent API requests.

This example shows a request and response for a user with login user name: tenantapp-user and password: tenantapp-dummy-password.

Request header:

POST https://tenantapp.example.com/suite-api/api/auth/token/acquire Content-Type: application/json
Accept: application/json

Request body in JSON format:

{
"username" : "tenantapp-user", "password" : "tenantapp-dummy-password"
}

Response in JSON:

200 OK
{
"token": "8f868cca-27cc-43d6-a838-c5467e73ec45::77cea9b2-1e87-490e-b626-e878beeaa23b", "validity": 1470421325035,
"expiresAt": "Friday, November 5, 2019 6:22:05 PM UTC",
"roles": []
}

The response code indicates whether the request succeeded, or how it failed.

  • If the request is successful, the server returns HTTP response code 200 (OK) and reusable ops authorization token that expires after six hours. This token must be included in each subsequent API request.
  • If the credentials supplied in the POST body are invalid, the server returns HTTP response code 401.

What to do next

The obtained token must be included in each subsequent API request as the Authorization header.

Include the Authorization header in the format: vRealizeOpsToken <token value>.
If the token supplied in the Authorization header is invalid or expired, the server returns HTTP

response code 401

For information on individual APIs, open the tenant app api documentation url in the format:

https://tenantapp.example.com/tenant-app-api/swagger-ui-html
vRealize Operations Tenant App 2.5 API reference
Scroll to top