Skip to content

Check a server's room for a clone

GET /v1/sites/{siteId}/clone/room

Asks a destination server how much room it has for a clone of the site. Give the site's size from GET /sites/{siteId}/clone (filesBytes, databaseBytes) to have the room needed worked out and fits answered. A clone to another server needs more room there, as the site is packed and downloaded first. When the server doesn't answer, unknown is true; the clone checks again before copying.

Scopes

The token needs these scopes. Without them, the request is refused with insufficient_scope (see Scopes).

sites:create
Create sites. Install new WordPress sites on your servers. Cloning a site also needs Manage sites.
sites:write
Manage sites. Domains, SSL, CDN, cache, firewall, malware protection, resources, backups, staging, Media Offload, SMTP and RabbitPress Cache. Choosing Rabbitflare Backup for a site's backups, and turning on Media Offload or a site's malware protection, also need Turn on paid features: they start monthly charges.

Path parameters

FieldType and description
siteId Required

string

The id of the site to clone.

Query parameters

FieldType and description
serverId Required

string

The destination server's id.

filesBytes

integer 0 to 10,995,116,277,760

The site's files in bytes (sizes.filesBytes in GET /sites/{siteId}/clone), to work out the room needed. Default 0.

databaseBytes

integer 0 to 10,995,116,277,760

The site's database in bytes (sizes.databaseBytes). Default 0.

Example request

curl "https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/clone/room?serverId=3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d&filesBytes=48000000&databaseBytes=6400000" \
  -H "Authorization: Bearer $RABBITFLARE_TOKEN"

Response

200 OK Returns the CloneRoom object in data.

The CloneRoom object's fields 5 fields
FieldType and description
serverId

string

The destination server's id.

freeBytes

integer or null

Free room on the server's disk. Null when it couldn't be checked.

neededBytes

integer

The room the clone needs there while it's made, with what must stay free (0 when the site's size wasn't given).

fits

boolean or null

Whether the clone fits. Null when that couldn't be checked; the clone checks again before copying.

unknown

boolean

Whether the room couldn't be checked (the server didn't answer).

Example response

200 OK
{
  "data": {
    "serverId": "3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d",
    "freeBytes": 41871163392,
    "neededBytes": 330825728,
    "fits": true,
    "unknown": false
  }
}

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.

403 trial_locked

The site's server is on the free trial: WordPress sign-in, the File Manager and Cron Jobs switch on once it's kept.

Keep the server in the control panel: they switch on by themselves.

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.

Rate limit

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

Added on .

Popular

API docs