Volumes v4.176.0
List a Linode's volumes
View Block Storage Volumes attached to this Linode.
CLI.
linode-cli linodes volumes
OAuth.
linodes:read_only
Authorizations
personalAccessToken | |
oauth | linodes:read_only |
Path Parameters
linodeId | integer RequiredID of the Linode 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/linode/instances/123/volumes
linode-cli linode volumes 123
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 Read-only The current page. | ||||||||||||||||||||||||
pages | integer Read-only The total number of pages. | ||||||||||||||||||||||||
results | integer Read-only The total number of results. |
errors | array
of objects
|
List volumes
Returns a paginated list of Volumes you have permission to view.
OAuth.
volumes:read_only
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 Read-only The current page. | ||||||||||||||||||||||||
pages | integer Read-only The total number of pages. | ||||||||||||||||||||||||
results | integer Read-only The total number of results. |
errors | array
of objects
|
Create a volume
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.
CLI.
linode-cli volumes create
OAuth.
volumes:read_write
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> Read-only When this Volume was created. |
filesystem_path | string Read-only 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 Read-only The storage type of this Volume. |
id | integer Read-only 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 Read-only If a Volume is attached to a specific Linode, the label of that Linode will be displayed here. |
region | string Read-only The unique ID of this Region. |
size | integer The Volume’s size, in GiB. |
status | string Enum:
creating
active
resizing Read-only 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> Read-only When this Volume was last updated. |
errors | array
of objects
|
Delete a volume
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.
OAuth.
volumes: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 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
|
Get a volume
Get information about a single Volume.
CLI.
linode-cli volumes view
OAuth.
volumes:read_only
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> Read-only When this Volume was created. |
filesystem_path | string Read-only 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 Read-only The storage type of this Volume. |
id | integer Read-only 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 Read-only If a Volume is attached to a specific Linode, the label of that Linode will be displayed here. |
region | string Read-only The unique ID of this Region. |
size | integer The Volume’s size, in GiB. |
status | string Enum:
creating
active
resizing Read-only 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> Read-only When this Volume was last updated. |
errors | array
of objects
|
Update a volume
Updates a Volume that you have permission to read_write
.
CLI.
linode-cli volumes update
OAuth.
volumes: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> Read-only When this Volume was created. |
filesystem_path | string Read-only 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 Read-only The storage type of this Volume. |
id | integer Read-only 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 Read-only If a Volume is attached to a specific Linode, the label of that Linode will be displayed here. |
region | string Read-only The unique ID of this Region. |
size | integer The Volume’s size, in GiB. |
status | string Enum:
creating
active
resizing Read-only 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> Read-only When this Volume was last updated. |
errors | array
of objects
|
Attach a volume
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.
CLI.
linode-cli volumes attach
OAuth.
volumes:read_write
linodes:read_write ```
[Learn more...](https://techdocs.akamai.com/linode-api/reference/oauth)
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> Read-only When this Volume was created. |
filesystem_path | string Read-only 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 Read-only The storage type of this Volume. |
id | integer Read-only 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 Read-only If a Volume is attached to a specific Linode, the label of that Linode will be displayed here. |
region | string Read-only The unique ID of this Region. |
size | integer The Volume’s size, in GiB. |
status | string Enum:
creating
active
resizing Read-only 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> Read-only When this Volume was last updated. |
errors | array
of objects
|
Clone a volume
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.
CLI.
linode-cli volumes clone
OAuth.
volumes:read_write
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> Read-only When this Volume was created. |
filesystem_path | string Read-only 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 Read-only The storage type of this Volume. |
id | integer Read-only 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 Read-only If a Volume is attached to a specific Linode, the label of that Linode will be displayed here. |
region | string Read-only The unique ID of this Region. |
size | integer The Volume’s size, in GiB. |
status | string Enum:
creating
active
resizing Read-only 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> Read-only When this Volume was last updated. |
errors | array
of objects
|
Detach a volume
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.
CLI.
linode-cli volumes detach
OAuth.
volumes:read_write
linodes:read_write ```
[Learn more...](https://techdocs.akamai.com/linode-api/reference/oauth)
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
|
Resize a volume
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.
CLI.
linode-cli volumes resize
OAuth.
volumes:read_write
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> Read-only When this Volume was created. |
filesystem_path | string Read-only 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 Read-only The storage type of this Volume. |
id | integer Read-only 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 Read-only If a Volume is attached to a specific Linode, the label of that Linode will be displayed here. |
region | string Read-only The unique ID of this Region. |
size | integer The Volume’s size, in GiB. |
status | string Enum:
creating
active
resizing Read-only 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> Read-only When this Volume was last updated. |
errors | array
of objects
|