vCloud Air clients and servers communicate over HTTP, exchanging representations of vCloud Air objects. For the Metrics API, you use HTTP GET and POST requests to retrieve lists of metrics.

Issue a GET or POST request to a URI for a virtual machine, virtual data center, or edge gateway by using the following format:

GET|POST https://vchs.vmware.com/hybridity/api/metrics/target/targetID[?next=nexttoken&count=count]

Where /target/targetId are /vApp/vm-Id, /vcd/vdcId, and /gateways/edgeId

A GET request retrieves metrics for the last 5 minutes by default. Alternatively, issue A POST request and include a request body to specify a relative or absolute start and end time for the collection frequency:

{"relativeStartTime":{"interval":number,"unit":"MINUTE"},"relativeEndTime":{"interval":number,"unit":"MINUTE"}}

Where unit can be hours, minutes, or seconds

{"absoluteStartTime":{"time":"yyyy-mm-ddThh:mm:ss.sssZ"},"absoluteEndTime":{"time":"yyyy-mm-ddThh:mm:ss.000Z"}}

Where sssZ is milliseconds followed by a UTC time zone offset

In the request header you can include the following parameters with the URI:

count=count

At a maximum, the Metrics API returns paginated data with 10 one-minute samples per page. Use the count parameter to specify the number of records to return per page. For example, you might want to retrieve one data sample per page such that each page contains one entity or timestamp of the data sampling.

next=nexttoken

The first request header you issue does not contain a next parameter. When the response consists of more than one page of returned metrics, the response body will contain a token for the next page of data. Provide that token in the subsequent request header in the next parameter to retrieve the next page of metrics data.