Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/imallvir/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340
Retrieve Metrics Attribute Keys using vROps 6 REST API | I'm All vIRTUAL

Retrieve Metrics Attribute Keys using vROps 6 REST API

75-79Back 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:


Personally, I am using Chrome with the “Advanced REST Client” application. Firefox also has a good client called “RESTClient”.

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:

  1. Get the right Adapter Kind
  2. Choose a Resource Kind
  3. Retrieve all of the Resource Kind metrics attribute keys

To get the Adapter Kind, in the REST API documentation look for this part:

01Copy the path to your REST client in the following way:

02This will give you all the Adapter Kinds vROps is currently seeing. Look for the “VMWARE” Adapter Kind with its matching Resource Kinds:

03Now that we have both the Adapter Kind “VMWARE” and the Resource Kind names we can move forward.

The GET command we are looking for is also in the documentations:

04The same as we did in the previous step, copy the path to your REST client in the following way:

05That’s it, all you need to do now is select the metric attribute key you wish to add to the Interaction XML.

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  😎 


  1. Great post, I am following along but I am still unclear on how to actually get values back from queries. For instance how do I see Top25 Cluster CPU Demand and have it list out the values? I am new to REST so any help is appreciated.

Leave a Reply