Volumes API

Volumes are persistent block storage devices that can be attached to Droplets. Each volume is backed by a Kubernetes PersistentVolumeClaim.

List Volumes

GET /api/v1/volumes
Response:
[
  {
    "id": "vol_a1b2c3d4",
    "project_id": "proj_default",
    "name": "data-volume",
    "size_gb": 50,
    "status": "attached",
    "attached_to": "dpl_e5f6g7h8",
    "region": "nyc1",
    "created_at": "2024-01-15T10:30:00Z"
  }
]

Create a Volume

POST /api/v1/volumes
name
string
required
Volume name
size_gb
integer
required
Size in gigabytes
region
string
required
Deployment region
{
  "name": "data-volume",
  "size_gb": 50,
  "region": "nyc1"
}
Response: 201 Created
{
  "id": "vol_a1b2c3d4",
  "name": "data-volume",
  "size_gb": 50,
  "status": "creating",
  "region": "nyc1",
  "created_at": "2024-01-15T10:30:00Z"
}

Get a Volume

GET /api/v1/volumes/{id}

Delete a Volume

DELETE /api/v1/volumes/{id}
A volume must be detached from all Droplets before it can be deleted. Data is permanently lost.

Volume Status

StatusDescription
creatingPVC is being provisioned
availableReady to attach to a Droplet
attachedCurrently mounted on a Droplet
deletingBeing permanently removed

Attaching Volumes

Volumes are attached to Droplets at creation time via the volume_ids field, or can be managed through Droplet update operations.
POST /api/v1/droplets
{
  "name": "db-server",
  "image": "ubuntu-22-04",
  "plan_id": "s-2vcpu-2gb",
  "region": "nyc1",
  "volume_ids": ["vol_a1b2c3d4"]
}