/ #api #vrops 

Playing with vRealize Operations Manager REST API

vRealize Operations Manager (vROps): dashboardsThere 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:///suite-api/

vRealize Operations Manager API root web page

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:///suite-api/docs/rest/index.html

vRealize Operations Manager API Documentation

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>

Creating a new vROps recommendation via REST API

The new recommendation can be found in the web interface.

New recommendation created by API

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

vROps CaSA API: retrieve a list of all adapters in a cluster, including the number of associated metrics and objects

Get Cluster State & Role per Slice

To get the cluster state and the roles per slice (node of cluster):

**GET** https:///casa/view/cluster

vROps CaSA API: view cluster state and roles per slice

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

vROps CaSA API: retrieve counts of metrics and resources for a vROps cluster

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

vROps CaSA API: get cluster online state per node / slice

Get Cluster Info

To retrieve various cluster info:

GET https:///casa/deployment/cluster/info

vROps CaSA API: get cluster info

Have fun!

Author

Romain

Staff Architect & Member of the CTO Ambassador Program at VMware, focusing on NSX and Cloud-Native Applications. He is a double VCDX (DCV and NV, #120), VCDX panelist, frequent VMUG/VMworld speaker and contributor to the community via this blog or social media (follow him on Twitter @woueb).