List disks
GET/api/v1/storage-classes
The disks. Ask with line=v2 for the ones on sale: standard and enterprise, each also dedicated. Their ids go into Create a volume and Change the disk.
Parameters
| Name | In | Description |
|---|---|---|
| line | query, string, optional | v2 for the disks on sale; all when left out |
Example request
curl -X GET "https://platform.serverscamp.com/api/v1/storage-classes?line=v2" \
-H "Authorization: Bearer $API_TOKEN"import os, requests
token = os.environ["API_TOKEN"]
r = requests.get(
f"https://platform.serverscamp.com/api/v1/storage-classes?line=v2",
headers={"Authorization": f"Bearer {token}"},
)
r.raise_for_status()
print(r.json())const r = await fetch(`https://platform.serverscamp.com/api/v1/storage-classes?line=v2`, {
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 | list of VmDiskrequired | |
| items[].id | integerrequired | Disk id, for storage_class_id in Create a VM and Change the disk |
| items[].name | stringrequired | standard, enterprise, standard-dedicated or enterprise-dedicated |
| items[].dedicated | booleanrequired | Keeps its full performance when the storage cluster runs short |
| items[].read_iops_limit | integerrequired | Read operations a second, at most |
| items[].write_iops_limit | integerrequired | Write operations a second, at most |
| items[].read_bandwidth_limit | integerrequired | Read throughput, MB/s, at most |
| items[].write_bandwidth_limit | integerrequired | Write throughput, MB/s, at most |
| items[].min_size_gb | integerrequired | Smallest disk, GB |
| items[].max_size_gb | integerrequired | Largest disk, GB |
| items[].free_size_gb | integerrequired | GB of a root disk that are free; 25 on standard, 0 on the others |
| items[].price_per_gb_hour_millicents | numberrequired | Price of a GB an hour in millicents: 10,000 make 1 EUR |
| items[].line | one of legacy, v2required | v2 for the disks on sale |
| total | integerrequired |
{
"items": [
{
"id": 18,
"name": "standard",
"dedicated": false,
"read_iops_limit": 100000,
"write_iops_limit": 100000,
"read_bandwidth_limit": 1024,
"write_bandwidth_limit": 1024,
"min_size_gb": 25,
"max_size_gb": 5000,
"free_size_gb": 25,
"price_per_gb_hour_millicents": 1.1111,
"line": "v2"
}
],
"total": 1
}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