Skip to main content

volume_actions

Overview

Namevolume_actions
TypeResource
Iddigitalocean.block_storage.volume_actions

Fields

NameDatatypeDescription
idintegerA unique numeric ID that can be used to identify and reference an action.
action_resource_idintegerA unique identifier for the resource that the action is associated with.
action_typestringThis is the type of action that the object represents. For example, this could be "transfer" to represent the state of an image transfer action.
completed_atstringA time value given in ISO8601 combined date and time format that represents when the action was completed.
regionobject
region_slugstringA human-readable string that is used as a unique identifier for each region.
resource_idinteger
resource_typestringThe type of resource that the action is associated with.
started_atstringA time value given in ISO8601 combined date and time format that represents when the action was initiated.
statusstringThe current status of the action. This can be "in-progress", "completed", or "errored".
typestringThis is the type of action that the object represents. For example, this could be "attach_volume" to represent the state of a volume attach action.

Methods

NameAccessible byRequired ParamsDescription
volumeActions_getSELECTaction_id, volume_idTo retrieve the status of a volume action, send a GET request to /v2/volumes/$VOLUME_ID/actions/$ACTION_ID.

volumeActions_listSELECTvolume_idTo retrieve all actions that have been executed on a volume, send a GET request to /v2/volumes/$VOLUME_ID/actions.

volumeActions_postINSERTTo 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 five
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 |
_volumeActions_getEXECaction_id, volume_idTo retrieve the status of a volume action, send a GET request to /v2/volumes/$VOLUME_ID/actions/$ACTION_ID.

_volumeActions_listEXECvolume_idTo retrieve all actions that have been executed on a volume, send a GET request to /v2/volumes/$VOLUME_ID/actions.

volumeActions_post_byIdEXECvolume_idTo 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 seven
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.