Skip to content
  • Auto
  • Light
  • Dark

Retrieve

Retrieve an Existing Block Storage Volume
client.gpuDroplets.volumes.retrieve(stringvolumeID, RequestOptionsoptions?): VolumeRetrieveResponse { volume }
get/v2/volumes/{volume_id}

To show information about a block storage volume, send a GET request to /v2/volumes/$VOLUME_ID.

ParametersExpand Collapse
volumeID: string
ReturnsExpand Collapse
VolumeRetrieveResponse { volume }
volume?: Volume { id, created_at, description, 7 more }
id?: string

The unique identifier for the block storage volume.

created_at?: string

A time value given in ISO8601 combined date and time format that represents when the block storage volume was created.

description?: string

An optional free-form text field to describe a block storage volume.

droplet_ids?: Array<number> | null

An array containing the IDs of the Droplets the volume is attached to. Note that at this time, a volume can only be attached to a single Droplet.

filesystem_label?: string

The label currently applied to the filesystem.

filesystem_type?: string

The type of filesystem currently in-use on the volume.

name?: string

A human-readable name for the block storage volume. Must be lowercase and be composed only of numbers, letters and "-", up to a limit of 64 characters. The name must begin with a letter.

region?: Region { available, features, name, 2 more }

The region that the block storage volume is located in. When setting a region, the value should be the slug identifier for the region. When you query a block storage volume, the entire region object will be returned.

available: boolean

This is a boolean value that represents whether new Droplets can be created in this region.

features: Array<string>

This attribute is set to an array which contains features available in this region

name: string

The display name of the region. This will be a full name that is used in the control panel and other interfaces.

sizes: Array<string>

This attribute is set to an array which contains the identifying slugs for the sizes available in this region. sizes:read is required to view.

slug: string

A human-readable string that is used as a unique identifier for each region.

size_gigabytes?: number

The size of the block storage volume in GiB (1024^3). This field does not apply when creating a volume from a snapshot.

tags?: Array<string> | null

A flat array of tag names as strings applied to the resource.

Requires tag:read scope.

Retrieve an Existing Block Storage Volume
import Gradient from '@digitalocean/gradient';

const client = new Gradient();

const volume = await client.gpuDroplets.volumes.retrieve('7724db7c-e098-11e5-b522-000f53304e51');

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"
    ]
  }
}