Initiate A Block Storage Action By Volume Name
To initiate an action on a block storage volume by Name, send a POST request to ~/v2/volumes/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 |
| volume_name | The name of the block storage volume |
| 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 |
| volume_name | The name of the block storage volume |
| droplet_id | Set to the Droplet's ID |
| region | Set to the slug representing the region where the volume is located |
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"
}
}Changes
Changed in 4 of the 8 revisions of this API.15
- ○
the security scope
api:writewas added to the endpoint's security schemebearer_authapi-security-scope-added
- ○
api tag
DigitalOcean-public.v2-new_Block Storage Actionsaddedapi-tag-added
- ○
api tag
Block Storage Actionsremovedapi-tag-removed
This revision also has 3 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ○
- ○
endpoint added
endpoint-added
This revision also has 70 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ○
- ▲
api path removed without deprecation
api-path-removed-without-deprecation
This revision also has 436 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ▲
- ○
endpoint added
endpoint-added
This revision also has 70 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ○