Skip to content
  • Auto
  • Light
  • Dark

Retrieve

Retrieve an Existing Image
client.gpuDroplets.images.retrieve(number | stringimageID, RequestOptionsoptions?): ImageRetrieveResponse { image }
get/v2/images/{image_id}

To retrieve information about an image, send a GET request to /v2/images/$IDENTIFIER.

ParametersExpand Collapse
imageID: number | string
Accepts one of the following:
number
string
ReturnsExpand Collapse
ImageRetrieveResponse { image }
image: Image { id, created_at, description, 11 more }
id?: number

A unique number that can be used to identify and reference a specific image.

created_at?: string

A time value given in ISO8601 combined date and time format that represents when the image was created.

formatdate-time
description?: string

An optional free-form text field to describe an image.

distribution?: "Arch Linux" | "CentOS" | "CoreOS" | 10 more

The 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.

Accepts one of the following:
"Arch Linux"
"CentOS"
"CoreOS"
"Debian"
"Fedora"
"Fedora Atomic"
"FreeBSD"
"Gentoo"
"openSUSE"
"RancherOS"
"Rocky Linux"
"Ubuntu"
"Unknown"
error_message?: string

A string containing information about errors that may occur when importing a custom image.

min_disk_size?: number | null

The minimum disk size in GB required for a Droplet to use this image.

minimum0
name?: string

The 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.

public?: boolean

This 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.

regions?: Array<"ams1" | "ams2" | "ams3" | 12 more>

This attribute is an array of the regions that the image is available in. The regions are represented by their identifying slug values.

Accepts one of the following:
"ams1"
"ams2"
"ams3"
"blr1"
"fra1"
"lon1"
"nyc1"
"nyc2"
"nyc3"
"sfo1"
"sfo2"
"sfo3"
"sgp1"
"tor1"
"syd1"
size_gigabytes?: number | null

The size of the image in gigabytes.

formatfloat
slug?: string | null

A 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.

status?: "NEW" | "available" | "pending" | 2 more

A status string indicating the state of a custom image. This may be NEW, available, pending, deleted, or retired.

Accepts one of the following:
"NEW"
"available"
"pending"
"deleted"
"retired"
tags?: Array<string> | null

A flat array of tag names as strings to be applied to the resource. Tag names may be for either existing or new tags.

Requires tag:create scope.

type?: "base" | "snapshot" | "backup" | 2 more

Describes 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).

Accepts one of the following:
"base"
"snapshot"
"backup"
"custom"
"admin"
Retrieve an Existing Image
import Gradient from '@digitalocean/gradient';

const client = new Gradient();

const image = await client.gpuDroplets.images.retrieve(0);

console.log(image.image);
{
  "image": {
    "created_at": "2020-05-04T22:23:02Z",
    "description": " ",
    "distribution": "Ubuntu",
    "error_message": " ",
    "min_disk_size": 20,
    "name": "Nifty New Snapshot",
    "public": true,
    "regions": [
      "nyc1",
      "nyc2"
    ],
    "size_gigabytes": 2.34,
    "slug": "nifty1",
    "status": "NEW",
    "tags": [
      "base-image",
      "prod"
    ],
    "type": "snapshot"
  }
}
Returns Examples
{
  "image": {
    "created_at": "2020-05-04T22:23:02Z",
    "description": " ",
    "distribution": "Ubuntu",
    "error_message": " ",
    "min_disk_size": 20,
    "name": "Nifty New Snapshot",
    "public": true,
    "regions": [
      "nyc1",
      "nyc2"
    ],
    "size_gigabytes": 2.34,
    "slug": "nifty1",
    "status": "NEW",
    "tags": [
      "base-image",
      "prod"
    ],
    "type": "snapshot"
  }
}