To generate a complete list of metrics for any virtual machine defined in the vCenter adapter model, you make a GET request to the URL with the adapter type and the object type.

Prerequisites

Verify that the following requirements are met:

Procedure

  1. Make a GET request to obtain the metadata for metrics.
    GET https://vrealize.example.com/suite-api/api/adapterkinds/VMWARE/resourcekinds/VirtualMachine/statkeys
    
  2. Compare the metrics listed in the response to metrics displayed in the user interface. See Virtual Machine Metrics from the API and in the User Interface

Virtual Machine Metrics from the API and in the User Interface

This example shows how the virtual machine metrics listed in the XML response compare to the metrics displayed in the vRealize Operations Manager user interface.

Request:

GET https://vrealize.example.com/suite-api/api/adapterkinds/VMWARE/resourcekinds/VirtualMachine/statkeys
Content-Type: application/json
Authorization: vRealizeOpsToken <vROps_token>
Accept: application/json

Where:

  • VMWARE is the adapterKindKey.

  • VirtualMachine is the resourceKindKey.

  • vROps_token is the token that you obtained from the response in Login Request and Response.

Snippet of the response in JSON:

200 OK

{      
  "key": "mem-consumed|waste",      
  "name": "Memory (Consumed)|Waste",      
  "description": "Waste",      
  "defaultMonitored": true,      
  "rollupType": "AVG",      
  "instanceType": "INSTANCED",      
  "unit": "%",      
  "monitoring": false,      
  "property": false    
},
{      
  "key": "mem-consumed|workload",      
  "name": "Memory (Consumed)|Workload",      
  "description": "Workload",      
  "defaultMonitored": true,      
  "rollupType": "AVG",      
  "instanceType": "INSTANCED",      
  "unit": "%",      
  "monitoring": false,      
  "property": false    
}

Every resource-kind-attribute in the response is a metric with metadata for a virtual machine object. The name corresponds to text displayed in the vRealize Operations Manager user interface. In this example, the snippet lists metrics for:

  • Memory (Consumed), Waste

  • Memory (Consumed), Workload

To compare metrics in the response with metrics in the user interface, log in to the vRealize Operations Manager instance running on vrealize.example.com and navigate to the metrics for a virtual machine. The following example shows where you find metrics for Memory (Consumed), Workload.

Metrics in UI

The example shows how to retrieve metrics for the virtual machine object type. To retrieve metrics for other object types, replace VirtualMachine in the GET request with other resourceKinds.