Cloud Panel

Get metrics

GET/api/v1/vms/{vm_uuid}/metrics

CPU, disk and network from the host side, averaged over each point, for the window you ask for.

Parameters

NameInDescription
vm_uuidpath, stringrequiredServer id, from Create a VM or List VMs
windowquery, string5m, 15m, 30m, 1h, 2h, 6h, 12h, 24h, 3d, 7d or 30d; 1h when left out

Example request

curl -X GET "https://platform.serverscamp.com/api/v1/vms/$VM_UUID/metrics?window=1h" \
  -H "Authorization: Bearer $API_TOKEN"

Answer

Status 200 with this body.

FieldTypeDescription
vm_uuidstringrequired
windowstringrequiredThe window asked for
resolution_secondsintegerrequiredSeconds each point averages
currentVmMetricsPoint, optionalThe latest reading
current.tsintegerrequiredUnix time of the point
current.cpu_pctnumber, optionalCPU in use, percent of all the server's vCPUs
current.disk_rd_iopsnumber, optionalDisk reads a second
current.disk_wr_iopsnumber, optionalDisk writes a second
current.disk_rd_bpsnumber, optionalDisk reads, bytes a second
current.disk_wr_bpsnumber, optionalDisk writes, bytes a second
current.rx_bpsnumber, optionalTraffic into the server, bytes a second
current.tx_bpsnumber, optionalTraffic out of the server, bytes a second
pointslist of VmMetricsPointrequiredFrom the host side, oldest first
points[].tsintegerrequiredUnix time of the point
points[].cpu_pctnumber, optionalCPU in use, percent of all the server's vCPUs
points[].disk_rd_iopsnumber, optionalDisk reads a second
points[].disk_wr_iopsnumber, optionalDisk writes a second
points[].disk_rd_bpsnumber, optionalDisk reads, bytes a second
points[].disk_wr_bpsnumber, optionalDisk writes, bytes a second
points[].rx_bpsnumber, optionalTraffic into the server, bytes a second
points[].tx_bpsnumber, optionalTraffic out of the server, bytes a second
{
  "vm_uuid": "6f1c2a9e-4b3d-4e8a-9c71-2d5e8f0a1b34",
  "window": "1h",
  "resolution_seconds": 60,
  "current": {
    "ts": 1793532000,
    "cpu_pct": 7.4,
    "disk_rd_iops": 3,
    "disk_wr_iops": 41,
    "disk_rd_bps": 12288,
    "disk_wr_bps": 409600,
    "rx_bps": 18432,
    "tx_bps": 92160
  },
  "points": [
    {
      "ts": 1793531940,
      "cpu_pct": 6.9,
      "disk_rd_iops": 2,
      "disk_wr_iops": 38,
      "disk_rd_bps": 8192,
      "disk_wr_bps": 389120,
      "rx_bps": 17408,
      "tx_bps": 88064
    }
  ]
}

Errors

StatusWhen
400Not one of the windows
401No token, or a token that is not valid
422The body or a parameter is not what the operation takes

Every operation can also answer 401 without a valid token. All errors