turbot/digitalocean
steampipe plugin install digitalocean

Table: digitalocean_image - Query DigitalOcean Images using SQL

DigitalOcean Images are pre-configured disk images that can be used to create Droplets or Kubernetes nodes. These images can be manually created by users, automatically generated from existing Droplets, or provided by DigitalOcean. They include base distribution images, one-click application images, snapshots, and backups.

Table Usage Guide

The digitalocean_image table provides insights into Images within DigitalOcean. As a DevOps engineer, explore image-specific details through this table, including type, distribution, slug, and status. Utilize it to uncover information about images, such as those with specific distributions, the details of snapshots and backups, and the verification of image statuses.

Examples

List all images

Explore all the available images in your DigitalOcean environment to understand what resources are currently in use. This helps in managing resources efficiently by identifying unused or redundant images.

select
*
from
digitalocean_image;
select
*
from
digitalocean_image;

List custom images

Explore which custom images in your DigitalOcean account are not public. This can help maintain privacy and security by ensuring your custom images are not accessible to the general public.

select
slug,
distribution,
error_message
from
digitalocean_image
where
not public;
select
slug,
distribution,
error_message
from
digitalocean_image
where
public = 0;

Get Image by ID

Explore which digital ocean image is associated with a specific ID to better manage and organize your resources. This is particularly useful in scenarios where you need to quickly identify and access specific images based on their unique identifiers.

select
id,
slug,
name,
distribution
from
digitalocean_image
where
id = 29280599;
select
id,
slug,
name,
distribution
from
digitalocean_image
where
id = 29280599;

Get Image by Slug

Discover the segments that use a specific image in your DigitalOcean environment. This is useful to understand where and how frequently certain images are being deployed, aiding in resource management and optimization.

select
id,
slug,
name,
distribution
from
digitalocean_image
where
id = 'freebsd-11-x64-zfs';
select
id,
slug,
name,
distribution
from
digitalocean_image
where
id = 'freebsd-11-x64-zfs';

Public images by distribution

Analyze the number of public images available for each distribution in DigitalOcean to understand their popularity and usage trends. This can be helpful in making informed decisions about which distributions to support or use based on their community adoption.

select
distribution,
count(id)
from
digitalocean_image
group by
distribution
order by
count desc;
select
distribution,
count(id)
from
digitalocean_image
group by
distribution
order by
count(id) desc;

List all backups

Explore which digital images have been backed up, understanding their size and type to manage storage and ensure data security effectively.

select
name,
size_gigabytes,
type
from
digitalocean_image
where
type = 'backup';
select
name,
size_gigabytes,
type
from
digitalocean_image
where
type = 'backup';

Schema for digitalocean_image

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
created_attimestamp with time zoneTime when the image was created.
descriptiontextAn optional free-form text field to describe an image.
distributiontextThis attribute describes the base distribution used for this image. For custom images, this is user defined.
error_messagetextA string containing information about errors that may occur when importing a custom image.
idbigint=A unique number that can be used to identify and reference a specific image.
min_disk_sizebigintThe minimum disk size in GB required for a Droplet to use this image.
nametextThe 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.
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.
regionsjsonbArray of region slugs where the image is available.
size_gigabytesbigintThe size of the image in gigabytes.
slugtext=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.
statustextA status string indicating the state of a custom image. This may be "NEW", "available", "pending", or "deleted".
tagsjsonbA map of tags for the resource.
tags_srcjsonbAn array containing the names of the tags the image has been tagged with.
titletextTitle of the resource.
typetextDescribes the kind of image. It may be one of "snapshot", "backup", or "custom".
urntextThe uniform resource name (URN) for the volume.