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 VMware Aria 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 VMware Aria Operations user interface.
Request:
GET https://www.mgmt.cloud.vmware.com/vrops-cloud/suite-api/api/adapterkinds/VMWARE/resourcekinds/VirtualMachine/statkeys Content-Type: application/json Authorization: CSPToken <csp auth token> Accept: application/json
- VMWARE is the adapterKindKey.
- VirtualMachine is the resourceKindKey.
- csp auth token is the token that you obtained from the response in Generate Cloud Services Authentication Tokens.
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 VMware Aria 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 VMware Aria Operations instance running on mgmt.cloud.vmware.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.