Back at the days of 5.x, XML’s were used heavily when some widgets interactions was needed. For me personally, there wasn’t an engagement were I didn’t had to pull some metric attribute key out of vCOps. Let’s see how to find those in vROps 6.
Before diving into the vROps REST API stuff, check out this previous blog post of mine, which was part of the “1-Click Capacity Planning” series. This post will remind you how we used to retrieve metrics attribute keys in the previous version.
With the new “Views” concept, one can say that the use of interaction XML’s has reduced significantly but I believe it is still out there, kicking strong.
Why do you need the metric attribute key?
In order for you to get the right metric data when you are using Interaction XML’s you need a pointer, which is the attribute key. Using this pointer is the only way to present the right metric data in the receiving widget.
Before start digging into the API, I highly recommend for you to install a REST client in your browser. It is important to mention that there are both Java and Python clients available for download within vROps, those can be download from here:
vROps REST API documentation are located under https://<your_ops_instance>/suite-api/docs/REST/index.html/ which is your starting point for all that is API.
So, after reading my previous post you should all know by now how to get the metric attribute keys in 5.x.
In the following example I will show you how to do get the keys for a Virtual Machine vROps Resource Kind. What we will do is:
- Get the right Adapter Kind
- Choose a Resource Kind
- Retrieve all of the Resource Kind metrics attribute keys
To get the Adapter Kind, in the REST API documentation look for this part:
This will give you all the Adapter Kinds vROps is currently seeing. Look for the “VMWARE” Adapter Kind with its matching Resource Kinds:
The GET command we are looking for is also in the documentations:
Below, you can see an example on how CPU Ready Time % looks like in the query output:
I should warn you tough that there are a lot of those keys so happy RESTing to you all 😎