Skip to content

List VPS disks

GET /api/v2/vps/{id}/disks

List the disks attached to the VPS, with size, use, I/O totals and what you can do with each. id (vpsdisk_…) is the ID to pass to DELETE /api/v2/vps/{id}/disks/{diskName}. name is the virtual slot, such as scsi0. guestDevice is the name the operating system uses, such as /dev/sdb. Check actions.canDetach before you delete a disk. The boot disk cannot be removed. GET /api/v2/vps/{id}/storage has the same disks plus the filesystems inside the server.

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

Request

Path parameters

idstringrequired
The VPS ID (vps_…).

Example

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

Responses

200 The VPS’s disks.

Response 200
[
{
"id": "vpsdisk_01hxa3b4c5d6e7f8g9h0j1k2m3",
"name": "scsi0",
"type": "SCSI",
"device": "/dev/scsi0",
"guestDevice": "/dev/sda",
"isCdrom": false,
"bootOrder": 1,
"capacity": {
"totalGb": 50,
"usedGb": 24.45,
"freeGb": 25.55,
"usagePercent": 49
},
"io": {
"readGb": 6.61,
"writeGb": 75.45,
"readOperations": 226663,
"writeOperations": 2953598
},
"actions": {
"canDetach": {
"allowed": false,
"reason": "Cannot detach root disk."
},
"canResize": {
"allowed": false,
"reason": "To expand your main disk, use Billing -> Add Resources."
},
"canExpand": {
"allowed": true,
"reason": null
}
}
}
]

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.