Volumes v4.176.0

Volumes List

GET https://api.linode.com/v4/volumes

Returns a paginated list of Volumes you have permission to view.

Authorizations

personalAccessToken
oauthvolumes:read_only

Query Parameters

page
Type:
integer >= 1
Default: 1
Default:
1

The page of a collection to return.

page_size
Type:
integer 25..500
Default: 100
Default:
100

The number of items to return per page.

Request Samples

Response Samples

Responses

Volume Create

POST https://api.linode.com/v4/volumes

Creates a Volume on your Account. In order for this to complete successfully, your User must have the add_volumes grant. Creating a new Volume will start accruing additional charges on your account.

Authorizations

personalAccessToken
oauthvolumes:read_write

Request Samples

Request Body Schema

config_id
integer

When creating a Volume attached to a Linode, the ID of the Linode Config to include the new Volume in. This Config must belong to the Linode referenced by linode_id. Must not be provided if linode_id is not sent. If a linode_id is sent without a config_id, the volume will be attached:

  • to the Linode’s only config if it only has one config.
  • to the Linode’s last used config, if possible.

If no config can be selected for attachment, an error will be returned.

label
Required
string 1..32 characters

The Volume’s label, which is also used in the filesystem_path of the resulting volume.

linode_id
integer

The Linode this volume should be attached to upon creation. If not given, the volume will be created without an attachment.

region
string

The Region to deploy this Volume in. This is only required if a linode_id is not given.

size
integer
Default: 20

The initial size of this volume, in GB. Be aware that volumes may only be resized up after creation.

tags
array of strings

An array of Tags applied to this object. Tags are for organizational purposes only.

Response Samples

Responses

Volume Delete

DELETE https://api.linode.com/v4/volumes/{volumeId}

Deletes a Volume you have permission to read_write.

  • Deleting a Volume is a destructive action and cannot be undone.

  • Deleting stops billing for the Volume. You will be billed for time used within the billing period the Volume was active.

  • Volumes that are migrating cannot be deleted until the migration is finished.

Authorizations

personalAccessToken
oauthvolumes:read_write

Path Parameters

volumeIdinteger
Required

ID of the Volume to look up.

Request Samples

Response Samples

Responses

Volume View

GET https://api.linode.com/v4/volumes/{volumeId}

Get information about a single Volume.

Authorizations

personalAccessToken
oauthvolumes:read_only

Path Parameters

volumeIdinteger
Required

ID of the Volume to look up.

Query Parameters

page
Type:
integer >= 1
Default: 1
Default:
1

The page of a collection to return.

page_size
Type:
integer 25..500
Default: 100
Default:
100

The number of items to return per page.

Request Samples

Response Samples

Responses

Volume Update

PUT https://api.linode.com/v4/volumes/{volumeId}

Updates a Volume that you have permission to read_write.

Authorizations

personalAccessToken
oauthvolumes:read_write

Path Parameters

volumeIdinteger
Required

ID of the Volume to look up.

Request Samples

Request Body Schema

label
string 1..32 characters

The Volume’s label is for display purposes only.

tags
array of strings

An array of Tags applied to this object. Tags are for organizational purposes only.

Response Samples

Responses

Volume Attach

POST https://api.linode.com/v4/volumes/{volumeId}/attach

Attaches a Volume on your Account to an existing Linode on your Account. In order for this request to complete successfully, your User must have read_write permission to the Volume and read_write permission to the Linode. Additionally, the Volume and Linode must be located in the same Region.

Authorizations

personalAccessToken
oauthvolumes:read_write,linodes:read_write

Path Parameters

volumeIdinteger
Required

ID of the Volume to attach.

Request Samples

Request Body Schema

config_id
integer

The ID of the Linode Config to include this Volume in. Must belong to the Linode referenced by linode_id. If not given, the last booted Config will be chosen.

linode_id
Required
integer

The ID of the Linode to attach the volume to.

persist_across_boots
boolean

Defaults to true, if false is provided, the Volume will not be attached to the Linode Config. In this case more than 8 Volumes may be attached to a Linode if a Linode has 16GB of RAM or more. The number of volumes that can be attached is equal to the number of GB of RAM that the Linode has, up to a maximum of 64. config_id should not be passed if this is set to false and linode_id must be passed. The Linode must be running.

Response Samples

Responses

Volume Clone

POST https://api.linode.com/v4/volumes/{volumeId}/clone

Creates a Volume on your Account. In order for this request to complete successfully, your User must have the add_volumes grant. The new Volume will have the same size and data as the source Volume. Creating a new Volume will incur a charge on your Account.

  • Only Volumes with a status of “active” can be cloned.

Authorizations

personalAccessToken
oauthvolumes:read_write

Path Parameters

volumeIdinteger
Required

ID of the Volume to clone.

Request Samples

Request Body Schema

label
Required
string 1..32 characters

The Volume’s label is for display purposes only.

Response Samples

Responses

Volume Detach

POST https://api.linode.com/v4/volumes/{volumeId}/detach

Detaches a Volume on your Account from a Linode on your Account. In order for this request to complete successfully, your User must have read_write access to the Volume and read_write access to the Linode.

Volumes are automatically detached from deleted Linodes.

Authorizations

personalAccessToken
oauthvolumes:read_write,linodes:read_write

Path Parameters

volumeIdinteger
Required

ID of the Volume to detach.

Request Samples

Response Samples

Responses

Volume Resize

POST https://api.linode.com/v4/volumes/{volumeId}/resize

Resize an existing Volume on your Account. In order for this request to complete successfully, your User must have the read_write permissions to the Volume.

  • Volumes can only be resized up.
  • Only Volumes with a status of “active” can be resized.

Authorizations

personalAccessToken
oauthvolumes:read_write

Path Parameters

volumeIdinteger
Required

ID of the Volume to resize.

Request Samples

Request Body Schema

size
Required
integer

The Volume’s size, in GiB.

Response Samples

Responses