Get a site's resources
/v1/sites/{siteId}/resources Returns how much of its server the site may use: its CPU, memory and process limits, its CPU priority and its PHP settings (settings), whether they're in place on the server (status), what the server has (server), and the server's other sites with limits of their own (otherSites). blockedReason says when the site can't have settings of its own.
Scopes
The token needs this scope. Without it, the request is refused with insufficient_scope (see Scopes).
-
sites:read - View sites. See sites and their domains, CDN, firewall, malware protection, backups, staging, resources, SMTP and Media Offload. SMTP includes who each site's recent emails went to, their subjects, and the team's sign-in addresses.
Path parameters
| Field | Type and description |
|---|---|
siteId Required | string The site's id. |
Example request
curl "https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/resources" \
-H "Authorization: Bearer $RABBITFLARE_TOKEN" const res = await fetch("https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/resources", {
headers: {
Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,
},
});
if (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);
const { data } = await res.json();
console.log(data); import { Rabbitflare } from "@rabbitflare/api";
const rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });
const data = await rf.sites.resources.get({ siteId: "8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d" });
console.log(data); <?php
$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/resources');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 120,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),
],
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
if ($body === false || $status >= 400) {
throw new RuntimeException("Rabbitflare API error $status: $body");
}
print_r(json_decode($body, true)['data']); import os
import requests
response = requests.get(
"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/resources",
headers={
"Authorization": "Bearer " + os.environ["RABBITFLARE_TOKEN"],
},
timeout=120,
)
response.raise_for_status()
print(response.json()["data"]) Response
200 OK Returns the SiteResources object in data.
The SiteResources object's fields 28 fields
| Field | Type and description |
|---|---|
status | string Whether the settings are in place on the site's server: Known values: |
lastError | string or null Why the settings couldn't be put in place (with |
blockedReason | string or null Why the site can't have settings of its own right now: a staging copy (set them on the live site), a site on its server's original one-site setup, a site still installing, or a stopped server. Null when it can. |
settings | object The site's settings. A CPU, memory or process limit, or a priority other than |
cpuPercent | integer or null The share of the server's processor the site may use, in percent of all its cores. Null: no limit of its own. |
memoryMb | integer or null The memory the site may use (its PHP and scheduled tasks), in MB. Null: no limit of its own. |
processes | integer or null How many processes the site may run at once. Null: no limit of its own. |
priority | string The site's share of the processor when the server is busy: Known values: |
workers | integer or null How many PHP workers the site may run (requests served at once). Null: set by the server's memory ( |
phpMemoryMb | integer or null PHP's memory limit per request, in MB. Null: the server's (256 MB). |
timeLimit | integer or null How long one request may run, in seconds. Null: the server's (120 seconds). |
uploadMb | integer or null The largest upload, in MB. Null: the server's (64 MB). |
inputVars | integer or null The most form fields one request may send. Null: the server's (5,000). |
server | object What the site's server has, and what follows from it. |
vcpus | integer The server's vCPUs. |
memoryMb | integer The server's memory, in MB. |
maxMemoryMb | integer The largest memory limit a site on this server can have, in MB: the server's memory less what the system, database and web server need. |
autoWorkers | integer The PHP workers a site gets on this server when |
applied | object or null How the site runs on its server, as the server last reported. Null before it first did. |
mode | string
Known values: |
workers | integer How many PHP workers the site may run. |
otherSites | array of objects The server's other sites with limits or a priority of their own, by name. |
siteId | string The site's id. |
name | string The site's name. |
cpuPercent | integer or null Its CPU limit, in percent. Null: none. |
memoryMb | integer or null Its memory limit, in MB. Null: none. |
processes | integer or null Its process limit. Null: none. |
priority | string Its CPU priority: Known values: |
Example response
{
"data": {
"status": "applied",
"lastError": null,
"blockedReason": null,
"settings": {
"cpuPercent": 50,
"memoryMb": 1024,
"processes": null,
"priority": "normal",
"workers": 8,
"phpMemoryMb": 512,
"timeLimit": null,
"uploadMb": 128,
"inputVars": null
},
"server": {
"vcpus": 2,
"memoryMb": 4096,
"maxMemoryMb": 3840,
"autoWorkers": 24
},
"applied": {
"mode": "isolated",
"workers": 8
},
"otherSites": [
{
"siteId": "9b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
"name": "Blog",
"cpuPercent": 25,
"memoryMb": null,
"processes": null,
"priority": "low"
}
]
}
} 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 code | When, and what to do |
|---|---|
403 feature_ | This product isn't open to the account. Contact support if you'd like it opened. |
404 not_ | The resource doesn't exist, or isn't this account's. Check the id. Ids of other accounts' resources answer the same way. |