Volumes v4.176.0
Volumes List
Returns a paginated list of Volumes you have permission to view.
Authorizations
personalAccessToken | |
oauth | volumes:read_only |
Query Parameters
page |
The page of a collection to return. |
page_size |
The number of items to return per page. |
Request Samples
curl -H "Authorization: Bearer $TOKEN" \
https://api.linode.com/v4/volumes
linode-cli volumes list
Response Samples
{
"data": [
{
"created": "2018-01-01T00:01:01",
"filesystem_path": "/dev/disk/by-id/scsi-0Linode_Volume_my-volume",
"hardware_type": "nvme",
"id": 12345,
"label": "my-volume",
"linode_id": 12346,
"linode_label": "linode123",
"region": "us-east",
"size": 30,
"status": "active",
"tags": [
"example tag",
"another example"
],
"updated": "2018-01-01T00:01:01"
}
],
"page": 1,
"pages": 1,
"results": 1
}
{
"errors": [
{
"field": "fieldname",
"reason": "fieldname must be a valid value"
}
]
}
Responses
data | array
of objects
| ||||||||||||||||||||||||
page | integer The current page. | ||||||||||||||||||||||||
pages | integer The total number of pages. | ||||||||||||||||||||||||
results | integer The total number of results. |
errors | array
of objects
|
Volume Create
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 | |
oauth | volumes:read_write |
Request Samples
curl -H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-X POST -d '{
"label": "my-volume",
"size": 20,
"linode_id": 12346
}' \
https://api.linode.com/v4/volumes
linode-cli volumes create \
--label my-volume \
--size 20 \
--linode_id 12346 \
--no-defaults
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
If no config can be selected for attachment, an error will be returned. |
label Required | string
1..32
charactersThe Volume’s label, which is also used in the |
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
{
"created": "2018-01-01T00:01:01",
"filesystem_path": "/dev/disk/by-id/scsi-0Linode_Volume_my-volume",
"hardware_type": "nvme",
"id": 12345,
"label": "my-volume",
"linode_id": 12346,
"linode_label": "linode123",
"region": "us-east",
"size": 30,
"status": "active",
"tags": [
"example tag",
"another example"
],
"updated": "2018-01-01T00:01:01"
}
{
"errors": [
{
"field": "fieldname",
"reason": "fieldname must be a valid value"
}
]
}
Responses
created | string<date-time> When this Volume was created. |
filesystem_path | string The full filesystem path for the Volume based on the Volume’s label. Path is /dev/disk/by-id/scsi-0Linode_Volume_ + Volume label. |
hardware_type | string Enum:
hdd
nvme The storage type of this Volume. |
id | integer The unique ID of this Volume. |
label | string
1..32
charactersThe Volume’s label is for display purposes only. |
linode_id Nullable | integer If a Volume is attached to a specific Linode, the ID of that Linode will be displayed here. |
linode_label Nullable | string If a Volume is attached to a specific Linode, the label of that Linode will be displayed here. |
region | string The unique ID of this Region. |
size | integer The Volume’s size, in GiB. |
status | string Enum:
creating
active
resizing The current status of the volume. Can be one of:
|
tags | array
of strings An array of Tags applied to this object. Tags are for organizational purposes only. |
updated | string<date-time> When this Volume was last updated. |
errors | array
of objects
|
Volume Delete
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 | |
oauth | volumes:read_write |
Path Parameters
volumeId | integer RequiredID of the Volume to look up. |
Request Samples
curl -H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-X DELETE \
https://api.linode.com/v4/volumes/12345
linode-cli volumes delete 12345
Response Samples
{}
{
"errors": [
{
"field": "fieldname",
"reason": "fieldname must be a valid value"
}
]
}
Responses
errors | array
of objects
|
Volume View
Get information about a single Volume.
Authorizations
personalAccessToken | |
oauth | volumes:read_only |
Path Parameters
volumeId | integer RequiredID of the Volume to look up. |
Query Parameters
page |
The page of a collection to return. |
page_size |
The number of items to return per page. |
Request Samples
curl -H "Authorization: Bearer $TOKEN" \
https://api.linode.com/v4/volumes/12345
linode-cli volumes view 12345
Response Samples
{
"created": "2018-01-01T00:01:01",
"filesystem_path": "/dev/disk/by-id/scsi-0Linode_Volume_my-volume",
"hardware_type": "nvme",
"id": 12345,
"label": "my-volume",
"linode_id": 12346,
"linode_label": "linode123",
"region": "us-east",
"size": 30,
"status": "active",
"tags": [
"example tag",
"another example"
],
"updated": "2018-01-01T00:01:01"
}
{
"errors": [
{
"field": "fieldname",
"reason": "fieldname must be a valid value"
}
]
}
Responses
created | string<date-time> When this Volume was created. |
filesystem_path | string The full filesystem path for the Volume based on the Volume’s label. Path is /dev/disk/by-id/scsi-0Linode_Volume_ + Volume label. |
hardware_type | string Enum:
hdd
nvme The storage type of this Volume. |
id | integer The unique ID of this Volume. |
label | string
1..32
charactersThe Volume’s label is for display purposes only. |
linode_id Nullable | integer If a Volume is attached to a specific Linode, the ID of that Linode will be displayed here. |
linode_label Nullable | string If a Volume is attached to a specific Linode, the label of that Linode will be displayed here. |
region | string The unique ID of this Region. |
size | integer The Volume’s size, in GiB. |
status | string Enum:
creating
active
resizing The current status of the volume. Can be one of:
|
tags | array
of strings An array of Tags applied to this object. Tags are for organizational purposes only. |
updated | string<date-time> When this Volume was last updated. |
errors | array
of objects
|
Volume Update
Updates a Volume that you have permission to read_write
.
Authorizations
personalAccessToken | |
oauth | volumes:read_write |
Path Parameters
volumeId | integer RequiredID of the Volume to look up. |
Request Samples
curl -H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-X PUT -d '{
"label": "my-volume"
}' \
https://api.linode.com/v4/volumes/12345
linode-cli volumes update 12345 \
--label my_volume
Request Body Schema
label | string
1..32
charactersThe 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
{
"created": "2018-01-01T00:01:01",
"filesystem_path": "/dev/disk/by-id/scsi-0Linode_Volume_my-volume",
"hardware_type": "nvme",
"id": 12345,
"label": "my-volume",
"linode_id": 12346,
"linode_label": "linode123",
"region": "us-east",
"size": 30,
"status": "active",
"tags": [
"example tag",
"another example"
],
"updated": "2018-01-01T00:01:01"
}
{
"errors": [
{
"field": "fieldname",
"reason": "fieldname must be a valid value"
}
]
}
Responses
created | string<date-time> When this Volume was created. |
filesystem_path | string The full filesystem path for the Volume based on the Volume’s label. Path is /dev/disk/by-id/scsi-0Linode_Volume_ + Volume label. |
hardware_type | string Enum:
hdd
nvme The storage type of this Volume. |
id | integer The unique ID of this Volume. |
label | string
1..32
charactersThe Volume’s label is for display purposes only. |
linode_id Nullable | integer If a Volume is attached to a specific Linode, the ID of that Linode will be displayed here. |
linode_label Nullable | string If a Volume is attached to a specific Linode, the label of that Linode will be displayed here. |
region | string The unique ID of this Region. |
size | integer The Volume’s size, in GiB. |
status | string Enum:
creating
active
resizing The current status of the volume. Can be one of:
|
tags | array
of strings An array of Tags applied to this object. Tags are for organizational purposes only. |
updated | string<date-time> When this Volume was last updated. |
errors | array
of objects
|
Volume 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 | |
oauth | volumes:read_write,linodes:read_write |
Path Parameters
volumeId | integer RequiredID of the Volume to attach. |
Request Samples
curl -H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-X POST -d '{
"linode_id": 12346,
"config_id": 23456
}' \
https://api.linode.com/v4/volumes/12345/attach
linode-cli volumes attach 12345 \
--linode_id 12346 \
--config_id 23456
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 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. |
Response Samples
{
"created": "2018-01-01T00:01:01",
"filesystem_path": "/dev/disk/by-id/scsi-0Linode_Volume_my-volume",
"hardware_type": "nvme",
"id": 12345,
"label": "my-volume",
"linode_id": 12346,
"linode_label": "linode123",
"region": "us-east",
"size": 30,
"status": "active",
"tags": [
"example tag",
"another example"
],
"updated": "2018-01-01T00:01:01"
}
{
"errors": [
{
"field": "fieldname",
"reason": "fieldname must be a valid value"
}
]
}
Responses
created | string<date-time> When this Volume was created. |
filesystem_path | string The full filesystem path for the Volume based on the Volume’s label. Path is /dev/disk/by-id/scsi-0Linode_Volume_ + Volume label. |
hardware_type | string Enum:
hdd
nvme The storage type of this Volume. |
id | integer The unique ID of this Volume. |
label | string
1..32
charactersThe Volume’s label is for display purposes only. |
linode_id Nullable | integer If a Volume is attached to a specific Linode, the ID of that Linode will be displayed here. |
linode_label Nullable | string If a Volume is attached to a specific Linode, the label of that Linode will be displayed here. |
region | string The unique ID of this Region. |
size | integer The Volume’s size, in GiB. |
status | string Enum:
creating
active
resizing The current status of the volume. Can be one of:
|
tags | array
of strings An array of Tags applied to this object. Tags are for organizational purposes only. |
updated | string<date-time> When this Volume was last updated. |
errors | array
of objects
|
Volume 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 | |
oauth | volumes:read_write |
Path Parameters
volumeId | integer RequiredID of the Volume to clone. |
Request Samples
curl -H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-X POST -d '{
"label": "my-volume"
}' \
https://api.linode.com/v4/volumes/12345/clone
linode-cli volumes clone 12345 \
--label my-volume
Request Body Schema
label Required | string
1..32
charactersThe Volume’s label is for display purposes only. |
Response Samples
{
"created": "2018-01-01T00:01:01",
"filesystem_path": "/dev/disk/by-id/scsi-0Linode_Volume_my-volume",
"hardware_type": "nvme",
"id": 12345,
"label": "my-volume",
"linode_id": 12346,
"linode_label": "linode123",
"region": "us-east",
"size": 30,
"status": "active",
"tags": [
"example tag",
"another example"
],
"updated": "2018-01-01T00:01:01"
}
{
"errors": [
{
"field": "fieldname",
"reason": "fieldname must be a valid value"
}
]
}
Responses
created | string<date-time> When this Volume was created. |
filesystem_path | string The full filesystem path for the Volume based on the Volume’s label. Path is /dev/disk/by-id/scsi-0Linode_Volume_ + Volume label. |
hardware_type | string Enum:
hdd
nvme The storage type of this Volume. |
id | integer The unique ID of this Volume. |
label | string
1..32
charactersThe Volume’s label is for display purposes only. |
linode_id Nullable | integer If a Volume is attached to a specific Linode, the ID of that Linode will be displayed here. |
linode_label Nullable | string If a Volume is attached to a specific Linode, the label of that Linode will be displayed here. |
region | string The unique ID of this Region. |
size | integer The Volume’s size, in GiB. |
status | string Enum:
creating
active
resizing The current status of the volume. Can be one of:
|
tags | array
of strings An array of Tags applied to this object. Tags are for organizational purposes only. |
updated | string<date-time> When this Volume was last updated. |
errors | array
of objects
|
Volume 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 | |
oauth | volumes:read_write,linodes:read_write |
Path Parameters
volumeId | integer RequiredID of the Volume to detach. |
Request Samples
curl -H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-X POST \
https://api.linode.com/v4/volumes/12345/detach
linode-cli volumes detach 12345
Response Samples
{}
{
"errors": [
{
"field": "fieldname",
"reason": "fieldname must be a valid value"
}
]
}
Responses
errors | array
of objects
|
Volume 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 | |
oauth | volumes:read_write |
Path Parameters
volumeId | integer RequiredID of the Volume to resize. |
Request Samples
curl -H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-X POST -d '{
"size": 30
}' \
https://api.linode.com/v4/volumes/12345/resize
linode-cli volumes resize 12345 \
--size 30
Request Body Schema
size Required | integer The Volume’s size, in GiB. |
Response Samples
{
"created": "2018-01-01T00:01:01",
"filesystem_path": "/dev/disk/by-id/scsi-0Linode_Volume_my-volume",
"hardware_type": "nvme",
"id": 12345,
"label": "my-volume",
"linode_id": 12346,
"linode_label": "linode123",
"region": "us-east",
"size": 30,
"status": "active",
"tags": [
"example tag",
"another example"
],
"updated": "2018-01-01T00:01:01"
}
{
"errors": [
{
"field": "fieldname",
"reason": "fieldname must be a valid value"
}
]
}
Responses
created | string<date-time> When this Volume was created. |
filesystem_path | string The full filesystem path for the Volume based on the Volume’s label. Path is /dev/disk/by-id/scsi-0Linode_Volume_ + Volume label. |
hardware_type | string Enum:
hdd
nvme The storage type of this Volume. |
id | integer The unique ID of this Volume. |
label | string
1..32
charactersThe Volume’s label is for display purposes only. |
linode_id Nullable | integer If a Volume is attached to a specific Linode, the ID of that Linode will be displayed here. |
linode_label Nullable | string If a Volume is attached to a specific Linode, the label of that Linode will be displayed here. |
region | string The unique ID of this Region. |
size | integer The Volume’s size, in GiB. |
status | string Enum:
creating
active
resizing The current status of the volume. Can be one of:
|
tags | array
of strings An array of Tags applied to this object. Tags are for organizational purposes only. |
updated | string<date-time> When this Volume was last updated. |
errors | array
of objects
|