Create
Create a New Block Storage Volume
client.gpuDroplets.volumes.create(VolumeCreateParamsbody, RequestOptionsoptions?): VolumeCreateResponse { volume }
/v2/volumes
To create a new volume, send a POST request to /v2/volumes
. Optionally, a filesystem_type
attribute may be provided in order to automatically format the volume's filesystem. Pre-formatted volumes are automatically mounted when attached to Ubuntu, Debian, Fedora, Fedora Atomic, and CentOS Droplets created on or after April 26, 2018. Attaching pre-formatted volumes to Droplets without support for auto-mounting is not recommended.
Parameters
Returns
Create a New Block Storage Volume
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
const volume = await client.gpuDroplets.volumes.create({
name: 'ext4-example',
region: 'nyc1',
size_gigabytes: 10,
description: 'Block store for examples',
filesystem_label: 'ext4_volume_01',
filesystem_type: 'ext4',
});
console.log(volume.volume);
{
"volume": {
"description": "Block store for examples",
"filesystem_label": "example",
"filesystem_type": "ext4",
"name": "example",
"size_gigabytes": 10,
"tags": [
"base-image",
"prod"
]
}
}
Returns Examples
{
"volume": {
"description": "Block store for examples",
"filesystem_label": "example",
"filesystem_type": "ext4",
"name": "example",
"size_gigabytes": 10,
"tags": [
"base-image",
"prod"
]
}
}