Linode Instances
Disks List
https://api.linode.com/v4/linode/instances/{linodeId}/disks
View Disk information for Disks associated with this Linode.
Path Parameters
ID of the Linode to look up.
Query Parameters
The page of a collection to return.
The number of items to return per page.
Request Samples
- Shell
- CLI
curl -H "Authorization: Bearer $TOKEN" \
https://api.linode.com/v4/linode/instances/123/disks
Response Samples
- 200
- default
{
"data": [
{
"id": "",
"created": "2018-01-01T00:01:01",
"status": "ready",
"label": "Debian 9 Disk",
"updated": "2018-01-01T00:01:01",
"size": 48640,
"filesystem": "ext4"
}
],
"page": 1,
"pages": 1,
"results": 1
}
Responses
200: Returns a paginated list of disks associated with this Linode.
This Disk's ID which must be provided for all operations impacting this Disk.
When this Disk was created.
A brief description of this Disk's current state. This field may change without direct action from you, as a result of operations performed to the Disk or the Linode containing the Disk.
The Disk's label is for display purposes only.
When this Disk was last updated.
The size of the Disk in MB.
The Disk filesystem can be one of:
- raw - No filesystem, just a raw binary stream.
- swap - Linux swap area.
- ext3 - The ext3 journaling filesystem for Linux.
- ext4 - The ext4 journaling filesystem for Linux.
- initrd - initrd (uncompressed initrd, ext2, max 32 MB).
The current page.
The total number of pages.
The total number of results.
default: Error
What happened to cause this error. In most cases, this can be fixed immediately by changing the data you sent in the request, but in some cases you will be instructed to open a Support Ticket or perform some other action before you can complete the request successfully.
The field in the request that caused this error. This may be a path, separated by periods in the case of nested fields. In some cases this may come back as "null" if the error is not specific to any single element of the request.
Disk Create
https://api.linode.com/v4/linode/instances/{linodeId}/disks
Adds a new Disk to a Linode.
You can optionally create a Disk from an Image or an Empty Disk if no Image is provided with a request.
When creating an Empty Disk, providing a
label
is required.If no
label
is provided, animage
is required instead.When creating a Disk from an Image,
root_pass
is required.The default filesystem for new Disks is
ext4
. If creating a Disk from an Image, the filesystem of the Image is used unless otherwise specified.When deploying a StackScript on a Disk:
- See StackScripts List (GET /linode/stackscripts) for a list of available StackScripts.
- Requires a compatible Image to be supplied.
- See StackScript View (GET /linode/stackscript/{stackscriptId}) for compatible Images.
- It is recommended to supply SSH keys for the root User using the
authorized_keys
field. - You may also supply a list of usernames via the
authorized_users
field.- These users must have an SSH Key associated with their Profiles first. See SSH Key Add (POST /profile/sshkeys) for more information.
Path Parameters
ID of the Linode to look up.
Request Body Schema
The size of the Disk in MB.
Images require a minimum size. Access the Image View (GET /images/{imageID}) endpoint to view its size.
A list of public SSH keys that will be automatically appended
to the root user's ~/.ssh/authorized_keys
file when deploying from an Image.
A list of usernames. If the usernames have associated SSH keys, the keys will be appended to the root users ~/.ssh/authorized_keys
file automatically when deploying from an Image.
The Disk filesystem can be one of:
- raw - No filesystem, just a raw binary stream.
- swap - Linux swap area.
- ext3 - The ext3 journaling filesystem for Linux.
- ext4 - The ext4 journaling filesystem for Linux.
- initrd - initrd (uncompressed initrd, ext2, max 32 MB).
An Image ID to deploy the Linode Disk from.
Access the Images List (GET /images) endpoint with authentication to view
all available Images. Official Linode Images start with linode/
, while your Account's Images start with private/
. Creating
a disk from a Private Image requires read_only
or read_write
permissions for that Image. Access the User's
Grant Update (PUT /account/users/{username}/grants) endpoint to
adjust permissions for an Account Image.
The Disk's label is for display purposes only.
This sets the root user's password on a newly-created Linode Disk when deploying from an Image.
Required when creating a Linode Disk from an Image, including when using a StackScript.
Must meet a password strength score requirement that is calculated internally by the API. If the strength requirement is not met, you will receive a
Password does not meet strength requirement
error.
This field is required only if the StackScript being deployed requires input data from the User for successful completion. See User Defined Fields (UDFs) for more details.
This field is required to be valid JSON.
Total length cannot exceed 65,535 characters.
A StackScript ID that will cause the referenced StackScript to be run during
deployment of this Linode. A compatible image
is required to use a
StackScript. To get a list of available StackScript and their permitted Images
see /stackscripts.
This field cannot be used when deploying from a Backup or a Private Image.
Request Samples
- Shell
- CLI
curl -H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-X POST -d '{
"label": "Debian 9 Disk",
"image": "linode/debian9",
"size": 1300,
"authorized_keys": [
"ssh-rsa AAAA_valid_public_ssh_key_123456785== user@their-computer"
],
"authorized_users": [
"myUser",
"secondaryUser"
],
"root_pass": "aComplexP@ssword",
"stackscript_id": 10079,
"stackscript_data": {
"gh_username": "linode"
}
}' \
https://api.linode.com/v4/linode/instances/123/disks
Response Samples
- 200
- default
{
"status": "ready",
"created": "2018-01-01T00:01:01",
"updated": "2018-01-01T00:01:01",
"id": 1234,
"label": "Debian 9 Disk",
"size": 48640,
"filesystem": "ext4"
}
Responses
200: Disk created.
A brief description of this Disk's current state. This field may change without direct action from you, as a result of operations performed to the Disk or the Linode containing the Disk.
When this Disk was created.
When this Disk was last updated.
This Disk's ID which must be provided for all operations impacting this Disk.
The Disk's label is for display purposes only.
The size of the Disk in MB.
The Disk filesystem can be one of:
- raw - No filesystem, just a raw binary stream.
- swap - Linux swap area.
- ext3 - The ext3 journaling filesystem for Linux.
- ext4 - The ext4 journaling filesystem for Linux.
- initrd - initrd (uncompressed initrd, ext2, max 32 MB).
default: Error
What happened to cause this error. In most cases, this can be fixed immediately by changing the data you sent in the request, but in some cases you will be instructed to open a Support Ticket or perform some other action before you can complete the request successfully.
The field in the request that caused this error. This may be a path, separated by periods in the case of nested fields. In some cases this may come back as "null" if the error is not specific to any single element of the request.