public.servers.metrics
const url = 'https://rest.watchtower15.com/v1/servers/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/metrics?family=cpu';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://rest.watchtower15.com/v1/servers/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/metrics?family=cpu' \ --header 'Authorization: Bearer <token>'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Query Parameters
Section titled “Query Parameters”A relative window ending now: 1 to 9999 minutes, hours, days or weeks (3h, 2w). Not with from and to. The operation names its longest window and its default.
The start of a pinned window, epoch milliseconds or RFC 3339 with an offset. Needs to. A start before the oldest data kept is served from it.
The end of a pinned window, epoch milliseconds or RFC 3339 with an offset, after from. A window that ends before the oldest data kept, or in the future, is refused.
Responses
Section titled “Responses”ServersMetricsResource
object
object
object
One of cpu, memory, load, disk, network, tcp, saturation, kernel_limits.
object
Epoch milliseconds: the start of the window answered, which can be later than asked for (the store’s floor).
Epoch milliseconds.
raw (the hot store, 30 days) or rollup (the hourly rollup).
The width of one step in seconds: a point is the aggregate of a step.
object
The internal series key, e.g. cpu_usage_percent, io_read_mbps.
One of percent, MB, GB, MB/s, bytes/s, count, per_second; null for a load average.
object
The mount point, on a per-mount series.
The block device, on a disk I/O series.
The network interface, on a network series.
A connection state, a CPU mode, a pressure line or a limit, on the series that split by one.
A core, cpu0 and on, on a per-core series.
One of peak_per_step, average_per_step, min_per_step, count_per_step, value_per_step: what a point is of its step.
[t, value] pairs, t epoch milliseconds, value a number or null.
Example generated
{ "data": { "server": { "uuid": "example", "name": "example" }, "family": "example", "window": { "from": 1, "to": 1 }, "source": "example", "step_seconds": 1, "series": [ { "name": "example", "unit": "example", "labels": { "mount": "example", "device": "example", "interface": "example", "state": "example", "cpu": "example" }, "point_meaning": "example", "points": [ [ 1 ] ] } ], "oom_kills_in_window": 1, "conntrack_loaded": true, "files_host_limited": true }}The API key is missing, malformed, expired or revoked.
object
https://docs.watchtower15.com/api/errors/<code>/
object
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "code": "example", "detail": "example", "request_id": "example", "errors": { "additionalProperty": [ "example" ] }, "limit": 1, "used": 1}The key or its owner does not hold what the operation needs.
object
https://docs.watchtower15.com/api/errors/<code>/
object
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "code": "example", "detail": "example", "request_id": "example", "errors": { "additionalProperty": [ "example" ] }, "limit": 1, "used": 1}No such record in this organisation (an absent id and another organisation’s answer alike).
object
https://docs.watchtower15.com/api/errors/<code>/
object
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "code": "example", "detail": "example", "request_id": "example", "errors": { "additionalProperty": [ "example" ] }, "limit": 1, "used": 1}The request is invalid; errors names the parameters.
object
https://docs.watchtower15.com/api/errors/<code>/
object
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "code": "example", "detail": "example", "request_id": "example", "errors": { "additionalProperty": [ "example" ] }, "limit": 1, "used": 1}A rate limit or the organisation’s daily limit is reached; Retry-After says when to retry.
object
https://docs.watchtower15.com/api/errors/<code>/
object
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "code": "example", "detail": "example", "request_id": "example", "errors": { "additionalProperty": [ "example" ] }, "limit": 1, "used": 1}An unexpected error.
object
https://docs.watchtower15.com/api/errors/<code>/
object
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "code": "example", "detail": "example", "request_id": "example", "errors": { "additionalProperty": [ "example" ] }, "limit": 1, "used": 1}A data store did not answer within the request’s 10 seconds; try again shortly (store_unavailable).
object
https://docs.watchtower15.com/api/errors/<code>/
object
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "code": "example", "detail": "example", "request_id": "example", "errors": { "additionalProperty": [ "example" ] }, "limit": 1, "used": 1}