Class: Volume

Volume

new Volume()

Volume resource
Source:

Methods

action(volumeId, parametersOrType, callbackopt)

Create an action on the identified volume.
Parameters:
Name Type Attributes Description
volumeId string The id of the volume for which to create the action
parametersOrType string | object The name of the action to create or an object with key value pairs of parameters.
callback requestCallback <optional>
callback that handles the response
Source:

attach(volumeId, parametersOrDropletId, callbackopt)

Attach the identified volume to a given Droplet.
Parameters:
Name Type Attributes Description
volumeId string The id of the volume for which to create the action
parametersOrDropletId number | object If a number, the id of the droplet to which to attach the volume. Otherwise, an object with required keys of `droplet_id`. See the official docs for valid attributes.
callback requestCallback <optional>
callback that handles the response
Source:

create(attributes, callbackopt)

Create a volume object.
Parameters:
Name Type Attributes Description
attributes object The attributes with which to create the Volume. See the official docs for valid attributes.
callback requestCallback <optional>
callback that handles the response
Source:

delete(id, callbackopt)

Delete the identified volume object.
Parameters:
Name Type Attributes Description
id string The id of the volume to retrieve
callback requestCallback <optional>
callback that handles the response
Source:

detach(volumeId, callbackopt)

Detach the identified volume if it is attached to a Droplet.
Parameters:
Name Type Attributes Description
volumeId string The id of the volume for which to create the action
callback requestCallback <optional>
callback that handles the response
Source:

get(id, callbackopt)

Get the identified volume object.
Parameters:
Name Type Attributes Description
id string The id of the volume to retrieve
callback requestCallback <optional>
callback that handles the response
Source:

getAction(volumeId, id, callbackopt)

Get the identified action object.
Parameters:
Name Type Attributes Description
volumeId string The id of the volume for which to retrieve the action
id number The id of the action to retrieve
callback requestCallback <optional>
callback that handles the response
Source:

list(page or queryObjectopt, perPageopt, callbackopt)

List volume objects.
Parameters:
Name Type Attributes Description
page or queryObject number | object <optional>
page number to retrieve or key value pairs of query parameters
perPage number <optional>
number of result per page to retrieve
callback listRequestCallback <optional>
callback that handles the response
Source:

listActions(id, page or queryObjectopt, perPageopt, callbackopt)

List of action objects.
Parameters:
Name Type Attributes Description
id string ID of volume for which to retrieve actions
page or queryObject number | object <optional>
page number to retrieve or key value pairs of query parameters
perPage number <optional>
number of result per page to retrieve
callback listRequestCallback <optional>
callback that handles the response
Source:

resize(volumeId, parametersOrSizeGibabytes, region, callbackopt)

Increase the size of the identified volume.
Parameters:
Name Type Attributes Description
volumeId string The id of the volume for which to create the action
parametersOrSizeGibabytes number | object If a number, the size in gigabytes to which the volume should be resized. Otherwise, an object with required keys of `size_gigabytes` and `region`. See the official docs for valid attributes.
region string The slug of the region in which the drive was created
callback requestCallback <optional>
callback that handles the response
Source: