Plans in stock
GET/api/v1/vps/stock
VPS runs on capacity we have free, so a plan can sell out for a while. A create with a plan that is out gets 409.
Example request
curl -X GET "https://platform.serverscamp.com/api/v1/vps/stock" \
-H "Authorization: Bearer $API_TOKEN"import os, requests
token = os.environ["API_TOKEN"]
r = requests.get(
f"https://platform.serverscamp.com/api/v1/vps/stock",
headers={"Authorization": f"Bearer {token}"},
)
r.raise_for_status()
print(r.json())const r = await fetch(`https://platform.serverscamp.com/api/v1/vps/stock`, {
method: 'GET',
headers: { Authorization: `Bearer ${process.env.API_TOKEN}` },
});
console.log(r.status, await r.json());Answer
Status 200 with this body.
| Field | Type | Description |
|---|---|---|
| items | map of one of in, low, outrequired | Plan id to in (in stock), low (few left) or out (a create gets 409) |
{
"items": {
"vps2-075": "in",
"vps2-1": "in",
"vps2-16": "low",
"vps2-32": "out"
}
}Errors
| Status | When |
|---|---|
401 | No token, or a token that is not valid |
422 | The body or a parameter is not what the operation takes |
Every operation can also answer 401 without a valid token. All errors