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_messagefrom digitalocean_imagewhere not public;
select slug, distribution, error_messagefrom digitalocean_imagewhere 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, distributionfrom digitalocean_imagewhere id = 29280599;
select id, slug, name, distributionfrom digitalocean_imagewhere 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, distributionfrom digitalocean_imagewhere id = 'freebsd-11-x64-zfs';
select id, slug, name, distributionfrom digitalocean_imagewhere 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_imagegroup by distributionorder by count desc;
select distribution, count(id)from digitalocean_imagegroup by distributionorder 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, typefrom digitalocean_imagewhere type = 'backup';
select name, size_gigabytes, typefrom digitalocean_imagewhere type = 'backup';
Schema for digitalocean_image
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
akas | jsonb | Array of globally unique identifier strings (also known as) for the resource. | |
created_at | timestamp with time zone | Time when the image was created. | |
description | text | An optional free-form text field to describe an image. | |
distribution | text | This attribute describes the base distribution used for this image. For custom images, this is user defined. | |
error_message | text | A string containing information about errors that may occur when importing a custom image. | |
id | bigint | = | A unique number that can be used to identify and reference a specific image. |
min_disk_size | bigint | The minimum disk size in GB required for a Droplet to use this image. | |
name | text | 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 | jsonb | Array of region slugs where the image is available. | |
size_gigabytes | bigint | The size of the image in gigabytes. | |
slug | text | = | 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. |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
status | text | A status string indicating the state of a custom image. This may be "NEW", "available", "pending", or "deleted". | |
tags | jsonb | A map of tags for the resource. | |
tags_src | jsonb | An array containing the names of the tags the image has been tagged with. | |
title | text | Title of the resource. | |
type | text | Describes the kind of image. It may be one of "snapshot", "backup", or "custom". | |
urn | text | The uniform resource name (URN) for the volume. |