Skip to content
pols.so docs
Esc
↑↓navigate↵open⌘Jpreview

CPU, memory and disk use summed over the org's running sandboxes

Sums the current resource sample of every running sandbox (see GET /v1/sandboxes/{sandbox}/stats) and sets it against what those sandboxes are allotted by their size. A sandbox that has just started and has no sample yet is counted in running_sandboxes but not in the sums. Answers 503 when the deployment does not sample resources.

GET/v1/org/stats
Authorization
AuthorizationBearer token · headerrequired

Org-scoped API key, pols_....

Responses
200

The org's current resource use.

running_sandboxesintegerrequired

Sandboxes running now.

sampled_sandboxesintegerrequired

The running sandboxes with a current sample; the sums below cover these.

cpu_coresnumber<double>

Busy vCPUs, summed over the sampled sandboxes that have a CPU reading.

cpu_vcpusinteger

vCPUs allotted to the sampled sandboxes that have a CPU reading; cpu_cores / cpu_vcpus is their CPU share. Present with cpu_cores.

vcpusintegerrequired

vCPUs the sampled sandboxes are allotted.

memory_used_bytesinteger<int64>required
memory_total_bytesinteger<int64>required
disk_used_bytesinteger<int64>required
disk_total_bytesinteger<int64>required
sampled_atstring<date-time>

When the oldest of the summed samples was taken; absent when nothing was sampled.

429

Rate limited (rate_limited): too many requests or failed authentications from this address, too many requests or lifecycle calls for this org, or too many of its exec, file, computer and CDP calls in progress at once. Retry after Retry-After seconds.

errorobjectrequired
Show properties
codestringrequired

Stable machine-readable code: bad_request (400), unauthorized (401), forbidden (403), quota_exceeded (403), not_found (404), conflict (409), rate_limited (429, see Retry-After), internal (500), runtime_error (502, the sandbox host failed), unavailable (503, the feature is not configured on this deployment), timeout (504, or 408 when a request body stalls).

messagestringrequired
default

Error.

errorobjectrequired
Show properties
codestringrequired

Stable machine-readable code: bad_request (400), unauthorized (401), forbidden (403), quota_exceeded (403), not_found (404), conflict (409), rate_limited (429, see Retry-After), internal (500), runtime_error (502, the sandbox host failed), unavailable (503, the feature is not configured on this deployment), timeout (504, or 408 when a request body stalls).

messagestringrequired
Request
curl -X GET 'https://api.pols.so/v1/org/stats' \
  -H 'Authorization: Bearer YOUR_TOKEN'
Response
{
  "running_sandboxes": 0,
  "sampled_sandboxes": 0,
  "cpu_cores": 0.1,
  "cpu_vcpus": 0,
  "vcpus": 0,
  "memory_used_bytes": 0,
  "memory_total_bytes": 0,
  "disk_used_bytes": 0,
  "disk_total_bytes": 0,
  "sampled_at": "2019-08-24T14:15:22Z"
}