Initiate A Block Storage Action By Volume Id
To initiate an action on a block storage volume by Id, send a POST request to ~/v2/volumes/$VOLUME_ID/actions. The body should contain the appropriate attributes for the respective action.
Attach a Block Storage Volume to a Droplet
| Attribute | Details |
|---|---|
| type | This must be attach |
| droplet_id | Set to the Droplet's ID |
| region | Set to the slug representing the region where the volume is located |
Each volume may only be attached to a single Droplet. However, up to fifteen volumes may be attached to a Droplet at a time. Pre-formatted volumes will be automatically mounted to Ubuntu, Debian, Fedora, Fedora Atomic, and CentOS Droplets created on or after April 26, 2018 when attached. On older Droplets, additional configuration is required.
Remove a Block Storage Volume from a Droplet
| Attribute | Details |
|---|---|
| type | This must be detach |
| droplet_id | Set to the Droplet's ID |
| region | Set to the slug representing the region where the volume is located |
Resize a Volume
| Attribute | Details |
|---|---|
| type | This must be resize |
| size_gigabytes | The new size of the block storage volume in GiB (1024^3) |
| region | Set to the slug representing the region where the volume is located |
Volumes may only be resized upwards. The maximum size for a volume is 16TiB.
Path parameters
The ID of the block storage volume.
Query parameters
Number of items returned per page
Which 'page' of paginated results to return.
Request body
Example request
{
"type": "attach",
"region": "nyc3",
"droplet_id": 11612190,
"tags": [
"base-image",
"prod"
]
}Response
The response will be an object with a key called action. The value of this will be an object that contains the standard volume action attributes
Example response
{
"action": {
"type": "create",
"resource_id": 3164444,
"id": 36804636,
"status": "completed",
"started_at": "2020-11-14T16:29:21Z",
"completed_at": "2020-11-14T16:30:06Z",
"resource_type": "droplet",
"region": {
"name": "New York 3",
"slug": "nyc3",
"features": [
"private_networking",
"backups",
"ipv6",
"metadata",
"install_agent",
"storage",
"image_transfer"
],
"available": true,
"sizes": [
"s-1vcpu-1gb",
"s-1vcpu-2gb",
"s-1vcpu-3gb",
"s-2vcpu-2gb",
"s-3vcpu-1gb",
"s-2vcpu-4gb",
"s-4vcpu-8gb",
"s-6vcpu-16gb",
"s-8vcpu-32gb",
"s-12vcpu-48gb",
"s-16vcpu-64gb",
"s-20vcpu-96gb",
"s-24vcpu-128gb",
"s-32vcpu-192g"
]
},
"region_slug": "nyc3"
}
}