pydo.volume_actions.post()
Generated on 8 May 2026
from pydo version
v0.34.0
Usage
client.volume_actions.post(
per_page=20,
page=1,
body={
"type": "attach",
"region": "nyc3",
"droplet_id": 11612190,
...,
},
)Description
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 |
Parameters
per_pageinteger optionalNumber of items returned per page
pageinteger optionalWhich 'page' of paginated results to return.
typestring requiredThe volume action to initiate.
regionstring optionalThe slug identifier for the region where the resource will initially be available.
droplet_idinteger requiredExample:
11612190The unique identifier for the Droplet the volume will be attached or detached from.
tagsarray of strings or null optionalExample:
['base-image', 'prod']A flat array of tag names as strings to be applied to the resource. Tag names may be for either existing or new tags.
Requirestag:createscope.
Request Sample
Response Example
More Information
See /v2/volumes/actions in the API reference for additional detail on responses, headers, parameters, and more.