Backups on or off
POST/api/v1/vps/{vps_uuid}/backups
On, a backup is taken every night at a time of the server's own and the last 5 are kept; the plan price grows by its backup share. Off deletes every backup of the server.
Parameters
| Name | In | Description |
|---|---|---|
| vps_uuid | path, stringrequired | VPS id, from Create a VPS or List VPS |
Request body
| Field | Type | Description |
|---|---|---|
| enabled | booleanrequired | Daily backups on or off (adds the plan's backup share to the price) |
Example request
curl -X POST "https://platform.serverscamp.com/api/v1/vps/$VPS_UUID/backups" \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"enabled": true
}'import os, requests
token = os.environ["API_TOKEN"]
vps_uuid = "12d46f8c-d66e-4163-99aa-1245d5b06e5b"
r = requests.post(
f"https://platform.serverscamp.com/api/v1/vps/{vps_uuid}/backups",
headers={"Authorization": f"Bearer {token}"},
json={
"enabled": True
},
)
r.raise_for_status()
print(r.json())const vpsUuid = '12d46f8c-d66e-4163-99aa-1245d5b06e5b';
const r = await fetch(`https://platform.serverscamp.com/api/v1/vps/${vpsUuid}/backups`, {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.API_TOKEN}`, 'Content-Type': 'application/json' },
body: JSON.stringify({
"enabled": true
}),
});
console.log(r.status, await r.json());curl -X POST "https://platform.serverscamp.com/api/v1/vps/$VPS_UUID/backups" \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"enabled": false
}'import os, requests
token = os.environ["API_TOKEN"]
vps_uuid = "12d46f8c-d66e-4163-99aa-1245d5b06e5b"
r = requests.post(
f"https://platform.serverscamp.com/api/v1/vps/{vps_uuid}/backups",
headers={"Authorization": f"Bearer {token}"},
json={
"enabled": False
},
)
r.raise_for_status()
print(r.json())const vpsUuid = '12d46f8c-d66e-4163-99aa-1245d5b06e5b';
const r = await fetch(`https://platform.serverscamp.com/api/v1/vps/${vpsUuid}/backups`, {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.API_TOKEN}`, 'Content-Type': 'application/json' },
body: JSON.stringify({
"enabled": false
}),
});
console.log(r.status, await r.json());Answer
Status 200 with this body.
| Field | Type | Description |
|---|---|---|
| vps_uuid | stringrequired | |
| enabled | booleanrequired | Daily backups on |
{
"vps_uuid": "12d46f8c-d66e-4163-99aa-1245d5b06e5b",
"enabled": true
}Errors
| Status | When |
|---|---|
401 | No token, or a token that is not valid |
409 | A backup is running; turn backups off when it is done |
422 | The body or a parameter is not what the operation takes |
Every operation can also answer 401 without a valid token. All errors