Skip to main content

images

Overview

Nameimages
TypeResource
Iddigitalocean.images.images

Fields

NameDatatypeDescription
idintegerA unique number that can be used to identify and reference a specific image.
namestringThe display name that has been given to an image. This is what is shown in the control panel and is generally a descriptive title for the image in question.
descriptionstringAn optional free-form text field to describe an image.
created_atstringA time value given in ISO8601 combined date and time format that represents when the image was created.
distributionstringThe name of a custom image's distribution. Currently, the valid values are Arch Linux, CentOS, CoreOS, Debian, Fedora, Fedora Atomic, FreeBSD, Gentoo, openSUSE, RancherOS, Rocky Linux, Ubuntu, and Unknown. Any other value will be accepted but ignored, and Unknown will be used in its place.
error_messagestringA string containing information about errors that may occur when importing
a custom image.
min_disk_sizeintegerThe minimum disk size in GB required for a Droplet to use this image.
publicbooleanThis is a boolean value that indicates whether the image in question is public or not. An image that is public is available to all accounts. A non-public image is only accessible from your account.
regionsarrayThis attribute is an array of the regions that the image is available in. The regions are represented by their identifying slug values.
size_gigabytesnumberThe size of the image in gigabytes.
slugstringA uniquely identifying string that is associated with each of the DigitalOcean-provided public images. These can be used to reference a public image as an alternative to the numeric id.
statusstringA status string indicating the state of a custom image. This may be NEW,
available, pending, deleted, or retired.
tagsarrayA flat array of tag names as strings to be applied to the resource. Tag names may be for either existing or new tags.
typestringDescribes the kind of image. It may be one of base, snapshot, backup, custom, or admin. Respectively, this specifies whether an image is a DigitalOcean base OS image, user-generated Droplet snapshot, automatically created Droplet backup, user-provided virtual machine image, or an image used for DigitalOcean managed resources (e.g. DOKS worker nodes).

Methods

NameAccessible byRequired ParamsDescription
getSELECTimage_idTo retrieve information about an image, send a GET request to
/v2/images/$IDENTIFIER.
listSELECTTo list all of the images available on your account, send a GET request to /v2/images.

## Filtering Results
-----

It's possible to request filtered results by including certain query parameters.

Image Type

Either 1-Click Application or OS Distribution images can be filtered by using the type query parameter.

> Important: The type query parameter does not directly relate to the type attribute.

To retrieve only distribution images, include the type query parameter set to distribution, /v2/images?type=distribution.

To retrieve only application images, include the type query parameter set to application, /v2/images?type=application.

User Images

To retrieve only the private images of a user, include the private query parameter set to true, /v2/images?private=true.

Tags

To list all images assigned to a specific tag, include the tag_name query parameter set to the name of the tag in your GET request. For example, /v2/images?tag_name=$TAG_NAME.
create_customINSERTdata__name, data__region, data__urlTo create a new custom image, send a POST request to /v2/images.
The body must contain a url attribute pointing to a Linux virtual machine
image to be imported into DigitalOcean.
The image must be in the raw, qcow2, vhdx, vdi, or vmdk format.
It may be compressed using gzip or bzip2 and must be smaller than 100 GB after
being decompressed.
deleteDELETEimage_idTo delete a snapshot or custom image, send a DELETE request to /v2/images/$IMAGE_ID.
_getEXECimage_idTo retrieve information about an image, send a GET request to
/v2/images/$IDENTIFIER.
_listEXECTo list all of the images available on your account, send a GET request to /v2/images.

## Filtering Results
-----

It's possible to request filtered results by including certain query parameters.

Image Type

Either 1-Click Application or OS Distribution images can be filtered by using the type query parameter.

> Important: The type query parameter does not directly relate to the type attribute.

To retrieve only distribution images, include the type query parameter set to distribution, /v2/images?type=distribution.

To retrieve only application images, include the type query parameter set to application, /v2/images?type=application.

User Images

To retrieve only the private images of a user, include the private query parameter set to true, /v2/images?private=true.

Tags

To list all images assigned to a specific tag, include the tag_name query parameter set to the name of the tag in your GET request. For example, /v2/images?tag_name=$TAG_NAME.
updateEXECimage_idTo update an image, send a PUT request to /v2/images/$IMAGE_ID.
Set the name attribute to the new value you would like to use.
For custom images, the description and distribution attributes may also be updated.