DeluxHostAPI Reference
Services & monitoring

Get service metrics

GET
/v1/services/{id}/metrics

What the server has been doing, from samples taken about every ten minutes. /usage answers the same question about right now with a live call to the panel; this one never leaves our process, which is why it can be polled and /usage cannot.

rxDeltaBytes and txDeltaBytes are traffic in that interval, not since the beginning: the panel's counters are cumulative and reset monthly. They are null on the first point, which has no previous sample to subtract.

An empty points is a normal answer — a service provisioned ten minutes ago has no samples, and one that is not a VirtFusion server never will.

Authorization

apiToken services:read
headerAuthorizationBearer <token>

A personal API token: Authorization: Bearer dh_live_…. See Authentication for scopes.

Scope: services:read

Path Parameters

id*integer

The service id, as returned by GET /v1/services.

Query Parameters

hours?integer

How far back to go.

Range1 <= value <= 168
Default24

Response Body

The samples, oldest first.

application/json
  1. response
points*array<>
curl -X GET 'https://api.deluxhost.net/v1/services/0/metrics' \  -H "Authorization: Bearer $DELUXHOST_TOKEN"
Example Response
{  "points": [    {      "ts": "2019-08-24T14:15:22Z",      "cpuPercent": 0,      "memPercent": 0,      "rxDeltaBytes": 0,      "txDeltaBytes": 0    }  ]}