Skip to content

Get the storage allowance of a VPS

GET /api/v2/vps/{id}/storage-quota

Returns how much attachable storage the VPS has bought and how much of it is free. It also returns the size of the main disk. Attachable storage is the pool that extra disks come from: new disks with POST /api/v2/vps/{id}/actions/add-disk and growth of disks other than the main disk. When a disk needs more than attachable.availableGb, buy more with additionalStorageGb on POST /api/v2/vps/{id}/actions/config. Then read this endpoint again. The main disk grows with the storageGb option instead.

Authentication: An API key with the scope read:vm. About keys and scopes

Request

Path parameters

idstringrequired
The VPS ID (vps_…).

Example

GET /api/v2/vps/{id}/storage-quota
curl "https://cloud.hostup.se/api/v2/vps/vps_01hxa3b4c5d6e7f8g9h0j1k2m3/storage-quota" \
-H "Authorization: Bearer $HOSTUP_API_KEY"

Responses

200 The attachable storage pool and the main disk size.

Response 200
{
"attachable": {
"purchasedGb": 100,
"usedGb": 40,
"availableGb": 60,
"upgradeAvailable": {
"allowed": true,
"reason": null
}
},
"mainDisk": {
"purchasedGb": 50
}
}
Response fields
attachableobject
Storage for extra disks.
purchasedGbnumber
Attachable storage bought for the VPS, in GB. Set with the additionalStorageGb option.
usedGbnumber
Attachable storage used by extra disks, in GB.
availableGbnumber
Attachable storage still free for new disks or growth of extra disks, in GB.
upgradeAvailableobject
allowed is true when the VPS already has attachable storage. It is false when none has been bought yet, even when it can be bought.
allowedboolean
reasonstring or null
codestring or null
A machine-readable code for why the action is blocked.
mainDiskobject
The main disk.
purchasedGbnumber
Size of the main disk you pay for, in GB. Set with the storageGb option.

Errors

Errors are Problem Details with a stable code. Branch on the code, not on the text.

400Invalid request. The response body is an RFC 7807 Problem Details document.
401Unauthorized. Authentication is required.
403Forbidden. The caller lacks a required scope or does not own the resource.
404Not found. The resource does not exist or is not owned by the caller; code is vps_not_found.
429Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers.
500Internal error. Retry later or contact support if the issue persists.