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
- You are logged in to the vRealize Operations instance.
- You know the adapterKind value for the vCenter adapter and the resourceKinds value for the virtual machine. See Determine the Adapter Type and Object Types for the vCenter Adapter
Procedure
Example: 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 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
- VMWARE is the adapterKindKey.
- VirtualMachine is the resourceKindKey.
- vROps_token is the token that you obtained from the response in Acquire an Authentication Token.
200 OK
{ "resourceTypeAttributes": [ ... { "key": "mem|host_workload", "name": "Memory|Host Workload", "description": "Host Workload (%)", "defaultMonitored": false, "rollupType": "AVG", "instanceType": "INSTANCED", "unit": "%", "dataType2": "FLOAT", "monitoring": false, "property": false }, ... ] }
Every resourceTypeAttribute in the response is a metric with metadata for a virtual machine object. The name corresponds to text displayed in the vRealize Operations user interface. In this example, the snippet lists metrics for Memory and Host Workload.
To compare metrics in the response with metrics in the user interface, log in to the vRealize Operations 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(Host) and Workload.
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.