Playing with vRealize Operations Manager REST API
There is already a lot of good stuff embedded in vRealize Operations Manager:** **out of the box dashboards, views, reports, dynamic objects grouping (with custom groups), recommendations and so on. Maybe the next natural step is to test and use the REST API?
Wait, there is an API available for vROps? :)
Now, if you are wondering where is the vROps API documentation because you didn’t find it in the VMware website, don’t panic! :)
The reason is that the vRealize Operations Manager API documentation is embedded in vROps, you just need to know the correct URL. The landing page is: https://
It’s worth mentioning that the landing page has 3 different clients available to consume vRealize Operations REST APIs:
-
Java client
-
Python client
-
Ruby client (still experimental)
Regarding the vROps REST API documentation you will find it at the following URL: https://
There are many examples already included in the documentation, just use the various green buttons labelled Show when they are present. To work with vROps using API calls, you will have to configure the authentication and the content type before starting:
-
Authentication: Basic
-
If you are using XML: Content-Type: application/xml;charset=utf-8
-
If you are using JSON: Content-Type: application/json;charset=utf-8
vROps Suite API
The Suite API is the only officially supported API for vRealize Operations Manager. As you might have seen in the previous screenshot, the Suite API is broken down into 2 parts:
-
Public API
-
Internal API (which may not be supported in future releases)
You can for example create a new recommendation with the following request:
POST https:///suite-api/api/recommendations
Request body:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ops:recommendation xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ops="http://webservice.vmware.com/vRealizeOpsMgr/1.0/">
Romain's new recommendation
</ops:recommendation>
The new recommendation can be found in the web interface.
If you want to use the vROps Internal API, you have to add an additional header: X-vRealizeOps-API-use-unsupported to set to true. If you don’t, you will end up with an error message similar to: HTTP Status 403 - Internal API cannot be accessed without setting header ‘X-vRealizeOps-API-use-unsupported’ to true.
vROps CaSA API
CaSA stands for Cluster and Slice Administration. The CaSA API manages the internal working of vRealize Operations Manager and runs on a standalone vFabric tcServer (to avoid a chicken and egg scenario). I have provided a few examples below.
Disclaimer: The CaSA API is currently a private API and is not documented publicly. Use it at your own risk!
Get Adapters Statistics
To retrieve a list of all adapters in the cluster, with their associated information (numbers of metrics and objects collected for example):
GET https:///casa/stats/adapters/cluster
Get Cluster State & Role per Slice
To get the cluster state and the roles per slice (node of cluster):
**GET** https:///casa/view/cluster
Get Cluster Total Numbers for Objects & Metrics
To retrieve a list of relevant counts for the cluster (total numbers of metrics and objects for the entire cluster):
GET https:///casa/stats/counts
Get the online_state for all Slices in the Cluster
To retrieve the online_state for the cluster and each of the slices:
GET https:///casa/sysadmin/cluster/online_state
Get Cluster Info
To retrieve various cluster info:
GET https:///casa/deployment/cluster/info
Have fun!