Before you can use the Metrics API to retrieve virtual machine or edge gateway metrics from your environment, you must know the ID of the target object (virtual data center, virtual machine, or edge gateway).


Log in to vCloud Air. See Log in to vCloud Air for information.


Create a login session with vCloud Director. See Create a Session for a Virtual Data Center in a Service for information.

Using the vCloud API, query vCloud Director for the ID of an edge gateway, virtual data center, or virtual machine for which you require metrics:




For more information, see Typed Queries in the vCloud API Programmer's Guide.


Alternatively, you can use thevCloud API to navigate the vCloud Director Organization and virtual data center to obtain these IDs. After logging in and creating a session, the vCloud Air API returns the VCloudSessionType object.

The VCloudSessionType object represents a reference to a virtual data center on the vCloud instance. The virtual data center reference contains the full URL to the vCloud instance so that you can log in and navigate the Organization corresponding to the VDCReference. The returned virtual data center contains a list of all its gateways.