See the following example for retrieving the previous 2 minutes of compute data for a virtual machine by displaying 1 record per page. The example returns two pages of data.

For the complete list of virtual machine metrics, see vCloud Air Virtual Machine Metrics.

If you specify a virtual data center as the target (/vcd/vcdId), the Metrics API returns data for all the virtual machines in that data center and sorts the data by timestamp; for example if you request 2 minutes of data and the virtual data center has 2 virtual machines, the API returns data in the order: vm1-timestamp1, vm2-timestamp1, vm1-timestamp2, vm2-timestamp 2.

Request Header 1 – Retrieve the First Page of Metrics

POST https://us-california-1-3.vchs.vmware.com/hybridity/api/metrics/vApp/vm-5f034b7f-66cc-4a9a-8df5-0802e5800564?count=1
Accept: application/json
Content-Type: application/json
X-Vcloud-Authorization: "d6eFLOqQYfuEn2MJTp7BQ2ISEO+ZYaEgTcqBy8wZQ6js="

Request Body 1 – Specify the Collection Interval

"relativeStartTime":{"interval":2,"unit":"MINUTE"},"relativeEndTime":{"interval":0,"unit":"MINUTE"

Response Body 1

{
  "count": 2,
  "rows": [
    {
      "entityId": "5f034b7f-66cc-4a9a-8df5-0802e5800564",
      "interval": "2",
      "timestamp": 1456259880,
      "vdc": "0b75613c-c0ed-4d5a-b3bb-9ad62e8e1e1c",
      "metrics": [
        {
          "name": "virtualDisk.write.average.scsi0:0",
          "value": "4.0"
        },
        {
          "name": "mem.swapped.average",
          "value": "0.0"
        },
        {
          "name": "cpu.usage.average",
          "value": "1.386666667"
        },
        {
          "name": "net.bytesRx.average.4000",
          "value": "0.0"
        },
        {
          "name": "cpu.ready.summation.0",
          "value": "26.0"
        },
        {
          "name": "cpu.ready.summation",
          "value": "26.0"
        },
        {
          "name": "virtualDisk.write.average",
          "value": "4.0"
        },
        {
          "name": "cpu.idle.summation.0",
          "value": "58947.0"
        },
        {
          "name": "net.transmitted.average.vmnic0",
          "value": "0.0"
        },
        {
          "name": "net.transmitted.average.vmnic1",
          "value": "0.0"
        },
        {
          "name": "net.packetsTx.summation",
          "value": "6.0"
        },
        {
          "name": "cpu.idle.summation",
          "value": "58947.0"
        },
        {
          "name": "cpu.entitlement.latest",
          "value": "12340.0"
        },
        {
          "name": "mem.active.average",
          "value": "89128.0"
        },
        {
          "name": "net.received.average.vmnic0",
          "value": "0.0"
        },
        {
          "name": "net.received.average.vmnic1",
          "value": "0.0"
        },
        {
          "name": "net.packetsTx.summation.4000",
          "value": "6.0"
        },
        {
          "name": "mem.shared.average",
          "value": "0.0"
        },
        {
          "name": "virtualDisk.totalWriteLatency.average.scsi0:0",
          "value": "29.0"
        },
        {
          "name": "virtualDisk.numberReadAveraged.average.scsi0:0",
          "value": "0.0"
        },
        {
          "name": "mem.overheadMax.average",
          "value": "17748.0"
        },
        {
          "name": "net.droppedTx.summation",
          "value": "0.0"
        },
        {
          "name": "net.packetsTx.summation.vmnic1",
          "value": "0.0"
        },
        {
          "name": "net.packetsTx.summation.vmnic0",
          "value": "0.0"
        },
        {
          "name": "cpu.wait.summation.0",
          "value": "59337.0"
        },
        {
          "name": "net.bytesTx.average.4000",
          "value": "0.0"
        },
        {
          "name": "net.bytesRx.average",
          "value": "0.0"
        },
        {
          "name": "cpu.wait.summation",
          "value": "59337.0"
        },
        {
          "name": "cpu.demand.average",
          "value": "19.666666667"
        },
        {
          "name": "sys.heartbeat.latest",
          "value": "30.0"
        },
        {
          "name": "net.packetsRx.summation.4000",
          "value": "0.0"
        },
        {
          "name": "sys.uptime.latest",
          "value": "355.0"
        },
        {
          "name": "mem.swapinRate.average",
          "value": "0.0"
        },
        {
          "name": "net.transmitted.average",
          "value": "0.0"
        },
        {
          "name": "net.packetsRx.summation.vmnic0",
          "value": "0.0"
        },
        {
          "name": "net.packetsRx.summation.vmnic1",
          "value": "2.0"
        },
        {
          "name": "mem.overhead.average",
          "value": "20629.333333333"
        },
        {
          "name": "cpu.used.summation.0",
          "value": "417.0"
        },
        {
          "name": "net.bytesRx.average.vmnic0",
          "value": "0.0"
        },
        {
          "name": "net.bytesRx.average.vmnic1",
          "value": "0.0"
        },
        {
          "name": "net.received.average.4000",
          "value": "0.0"
        },
        {
          "name": "net.transmitted.average.4000",
          "value": "0.0"
        },
        {
          "name": "mem.consumed.average",
          "value": "129640.0"
        },
        {
          "name": "net.usage.average",
          "value": "0.0"
        },
        {
          "name": "net.packetsRx.summation",
          "value": "0.0"
        },
        {
          "name": "net.bytesTx.average.vmnic0",
          "value": "0.0"
        },
        {
          "name": "net.bytesTx.average.vmnic1",
          "value": "0.0"
        },
        {
          "name": "sys.osUptime.latest",
          "value": "336.0"
        },
        {
          "name": "virtualDisk.read.average.scsi0:0",
          "value": "3.5"
        },
        {
          "name": "cpu.swapwait.summation.0",
          "value": "0.0"
        },
        {
          "name": "cpu.swapwait.summation",
          "value": "0.0"
        },
        {
          "name": "net.usage.average.4000",
          "value": "0.0"
        },
        {
          "name": "cpu.usagemhz.average.0",
          "value": "15.0"
        },
        {
          "name": "net.droppedTx.summation.4000",
          "value": "0.0"
        },
        {
          "name": "mem.swapoutRate.average",
          "value": "0.0"
        },
        {
          "name": "cpu.used.summation",
          "value": "417.0"
        },
        {
          "name": "virtualDisk.totalReadLatency.average.scsi0:0",
          "value": "8.666666667"
        },
        {
          "name": "net.usage.average.vmnic0",
          "value": "0.0"
        },
        {
          "name": "net.usage.average.vmnic1",
          "value": "0.0"
        },
        {
          "name": "net.droppedRx.summation.4000",
          "value": "0.0"
        },
        {
          "name": "net.droppedRx.summation",
          "value": "0.0"
        },
        {
          "name": "net.bytesTx.average",
          "value": "0.0"
        },
        {
          "name": "mem.granted.average",
          "value": "129640.0"
        },
        {
          "name": "net.received.average",
          "value": "0.0"
        },
        {
          "name": "virtualDisk.numberWriteAveraged.average.scsi0:0",
          "value": "0.5"
        },
        {
          "name": "mem.usage.average",
          "value": "67.99"
        },
        {
          "name": "virtualDisk.read.average",
          "value": "3.5"
        },
        {
          "name": "cpu.usagemhz.average",
          "value": "30.0"
        }
      ],
      "vmId": "5f034b7f-66cc-4a9a-8df5-0802e5800564"
    }
  ],
  "next": "MTQ2MTc5Njk4MHxiMjY2Yjc1OC0zMTU5LTRiNGMtODJjYS1mOTYzZmYyYTFlNzc="
}

Request Header 2

POST https://us-california-1-3.vchs.vmware.com/hybridity/api/metrics/vApp/vm-5f034b7f-66cc-4a9a-8df5-0802e5800564?next="MTQ2MTc5Njk4MHxiMjY2Yjc1OC0zMTU5LTRiNGMtODJjYS1mOTYzZmYyYTFlNzc="&count=1
Accept: application/json
Content-Type: application/json
X-Vcloud-Authorization: "d6eFLOqQYfuEn2MJTp7BQ2ISEO+ZYaEgTcqBy8wZQ6js="

Request Body 2 – Specify the Collection Interval

"relativeStartTime":{"interval":2,"unit":"MINUTE"},"relativeEndTime":{"interval":0,"unit":"MINUTE"

Response Body 2 – Second Page Returned

{
  "count": 1,
  "rows": [
    {
      "entityId": "b266b758-3159-4b4c-82ca-f963ff2a1e77",
      "interval": "2",
      "timestamp": 1456259878,
      "vdc": "0b75613c-c0ed-4d5a-b3bb-9ad62e8e1e1c",
      "metrics": [
        {
          "name": "virtualDisk.write.average.scsi0:0",
          "value": "0.666666667"
        },
        {
          "name": "mem.swapped.average",
          "value": "0.0"
        },
        {
          "name": "cpu.usage.average",
          "value": "0.8"
        },
        {
          "name": "net.bytesRx.average.4000",
          "value": "0.0"
        }
        …
       ],
      "vmId": "b266b758-3159-4b4c-82ca-f963ff2a1e77"
    }
]
}