Virtual Machine

Retrieve virtual machine performance metrics

Retrieves performance metrics data for a virtual machine. Provide the virtual machine ID in the path to retrieve the following data for the specified virtual machine: CPU usage, memory usage (RAM), network.in, network.out, disk.read, and disk.write. The optional duration parameter can be used to specify the period for retrieving performance metrics; the default value will retrieve all available data. To learn more about virtual machine performance metrics, see Performance metrics.

get/core/virtual-machines/{vm_id}/metrics

Request

  • Base URL: https://infrahub-api.nexgencloud.com/v1
  • URL: https://infrahub-api.nexgencloud.com/v1/core/virtual-machines/{vm_id}/metrics
  • Auth: API key in header api_key

Path parameters

vm_idinteger required

ID of the vm.

Query parameters

duration'1h' | '2h' | '4h' | '6h' | '12h' | '1d' | '3d' | '7d' | '15d' | '30d'

Time window for the metrics query. Accepts values like 1h, 6h, 24h, 7d.

Response

Virtual machine performance metrics have been successfully retrieved.

Example response

{
  "cpu": {
    "unit": "ns",
    "columns": [
      "time",
      "granularity",
      "value"
    ],
    "data": [
      [
        "2023-09-01T01:19:00+00:00",
        60,
        1041433070000000
      ],
      [
        "2023-09-01T01:24:00+00:00",
        60,
        1041441320000000
      ]
    ]
  },
  "memory.usages": {
    "unit": "ns",
    "columns": [
      "time",
      "granularity",
      "value"
    ],
    "data": [
      [
        "2023-09-01T01:19:00+00:00",
        60,
        1041433070000000
      ],
      [
        "2023-09-01T01:24:00+00:00",
        60,
        1041441320000000
      ]
    ]
  },
  "network.in": {
    "unit": "ns",
    "columns": [
      "time",
      "granularity",
      "value"
    ],
    "data": [
      [
        "2023-09-01T01:19:00+00:00",
        60,
        1041433070000000
      ],
      [
        "2023-09-01T01:24:00+00:00",
        60,
        1041441320000000
      ]
    ]
  },
  "network.out": {
    "unit": "ns",
    "columns": [
      "time",
      "granularity",
      "value"
    ],
    "data": [
      [
        "2023-09-01T01:19:00+00:00",
        60,
        1041433070000000
      ],
      [
        "2023-09-01T01:24:00+00:00",
        60,
        1041441320000000
      ]
    ]
  },
  "disk.read": {
    "unit": "ns",
    "columns": [
      "time",
      "granularity",
      "value"
    ],
    "data": [
      [
        "2023-09-01T01:19:00+00:00",
        60,
        1041433070000000
      ],
      [
        "2023-09-01T01:24:00+00:00",
        60,
        1041441320000000
      ]
    ]
  },
  "disk.write": {
    "unit": "ns",
    "columns": [
      "time",
      "granularity",
      "value"
    ],
    "data": [
      [
        "2023-09-01T01:19:00+00:00",
        60,
        1041433070000000
      ],
      [
        "2023-09-01T01:24:00+00:00",
        60,
        1041441320000000
      ]
    ]
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.