Skip to content

Get a server's graphs

GET /v1/servers/{serverId}/metrics

The server's graphs over a time range: processor, memory and disk use in percent, load, and bandwidth in and out. Each graph is a list of readings (t in Unix seconds). They're empty while the server isn't running; a new server's history fills in over its first minutes (notice says so).

Scopes

The token needs this scope. Without it, the request is refused with insufficient_scope (see Scopes).

servers:read
View servers. See servers, their graphs, snapshots, logs and security (Imunify360).

Path parameters

FieldType and description
serverId Required

string

The server's id.

Query parameters

FieldType and description
range

string Default "6h"

The time the graphs cover: 1h, 6h (the default), 24h or 7d.

One of: 1h6h24h7d

Example request

curl "https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/metrics?range=1h" \
  -H "Authorization: Bearer $RABBITFLARE_TOKEN"

Response

200 OK Returns the ServerMetrics object in data.

The ServerMetrics object's fields 20 fields
FieldType and description
range

string

The time the graphs cover: 1h, 6h, 24h or 7d.

Known values: 1h6h24h7d More can appear.

cpu

array of objects

Processor use, in percent (0 to 100).

t

integer

The time of the reading, in Unix seconds.

v

number

The reading.

memory

array of objects

Memory in use, in percent.

t

integer

The time of the reading, in Unix seconds.

v

number

The reading.

disk

array of objects

Disk space in use, in percent.

t

integer

The time of the reading, in Unix seconds.

v

number

The reading.

load

array of objects

The load average over one minute.

t

integer

The time of the reading, in Unix seconds.

v

number

The reading.

bandwidthIn

array of objects

Data received, in megabits per second.

t

integer

The time of the reading, in Unix seconds.

v

number

The reading.

bandwidthOut

array of objects

Data sent, in megabits per second.

t

integer

The time of the reading, in Unix seconds.

v

number

The reading.

notice

string or null

A note about the graphs, for example while a new server's history is still being collected. Null when there's none.

Example response

200 OK
{
  "data": {
    "range": "1h",
    "cpu": [
      {
        "t": 1763455200,
        "v": 12.4
      }
    ],
    "memory": [
      {
        "t": 1763455200,
        "v": 41.7
      }
    ],
    "disk": [
      {
        "t": 1763455200,
        "v": 21.3
      }
    ],
    "load": [
      {
        "t": 1763455200,
        "v": 0.18
      }
    ],
    "bandwidthIn": [
      {
        "t": 1763455200,
        "v": 0.42
      }
    ],
    "bandwidthOut": [
      {
        "t": 1763455200,
        "v": 1.35
      }
    ],
    "notice": null
  }
}

Errors

The errors this request can answer besides those every request can (a missing token, a missing scope, the rate limits). Each answer is an Error object (see Errors).

Status and codeWhen, and what to do
400 invalid_parameter

A query parameter is unknown or has a wrong value (fields names it), or the query is too long: over 16,384 characters, or a parameter's name over 64.

Correct or remove the parameter named in fields.

404 not_found

The resource doesn't exist, or isn't this account's.

Check the id. Ids of other accounts' resources answer the same way.

409 server_restoring

The server is being restored, and nothing else can change it or its sites until that's done.

Wait until the restore finishes (the server's pendingAction is null again), then try again. A restore that stopped partway keeps pendingAction: "restore", with the server's lastError set, until our team has checked the server.

502 server_unreachable

The server didn't answer, or didn't finish the request.

Check that the server is running, then try again in a minute.

Rate limit

Heavy requests: 20 a minute per token, 40 per account. More in Rate limits.

Added on .

Popular

API docs