pydo.images.get()

Description

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

Parameters

Name Type Required Description Default Value
image_id JSON True A unique number (id) or string (slug) used to identify and reference a
specific image.

Public images can be identified by image id or slug.

Private images must be identified by image id.

Request Sample

import os
from pydo import Client

client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))

resp = client.images.get(image_id=134215)

Responses

See the API spec for this endpoint to view additional detail on responses, headers, parameters, and more.

The response will be a JSON object with a key called image. The value of this will be an image object containing the standard image attributes.

Click to expand an example response.
{
  "image": {
    "id": 6918990,
    "name": "14.04 x64",
    "distribution": "Ubuntu",
    "slug": "ubuntu-16-04-x64",
    "public": true,
    "regions": [
      "nyc1",
      "ams1",
      "sfo1",
      "nyc2",
      "ams2",
      "sgp1",
      "lon1",
      "nyc3",
      "ams3",
      "nyc3"
    ],
    "created_at": "2014-10-17T20:24:33Z",
    "min_disk_size": 20,
    "size_gigabytes": 2.34,
    "description": "",
    "tags": [],
    "status": "available",
    "error_message": ""
  }
}

Unauthorized

Click to expand an example response.
{
  "id": "unauthorized",
  "message": "Unable to authenticate you."
}

The resource was not found.

Click to expand an example response.
{
  "id": "not_found",
  "message": "The resource you requested could not be found."
}

API Rate limit exceeded

Click to expand an example response.
{
  "id": "too_many_requests",
  "message": "API Rate limit exceeded."
}

Server error.

Click to expand an example response.
{
  "id": "server_error",
  "message": "Unexpected server-side error"
}

Unexpected error

Click to expand an example response.
{
  "id": "example_error",
  "message": "some error message"
}