Table: digitalocean_snapshot - Query DigitalOcean Snapshots using SQL
DigitalOcean Snapshots are point-in-time backups of a DigitalOcean Droplet or Volume. They contain all the data and settings from the Droplet or Volume at the moment the Snapshot was taken. Snapshots can be used to restore a Droplet or Volume to the state it was in when the Snapshot was taken, or to create new Droplets or Volumes.
Table Usage Guide
The digitalocean_snapshot
table provides insights into the snapshots within DigitalOcean. As a DevOps engineer, explore snapshot-specific details through this table, including the snapshot's ID, name, regions, resource ID, and resource type. Utilize it to uncover information about snapshots, such as the regions they are available in, the resources they are associated with, and the state of those resources at the time the snapshot was taken.
Examples
List all snapshots
Explore all snapshots within your DigitalOcean environment to better manage your resources and understand your current usage. This helps in efficient resource allocation and aids in decision-making for future resource planning.
select *from digitalocean_snapshot;
select *from digitalocean_snapshot;
Get a snapshot by ID
Analyze the settings of a specific DigitalOcean snapshot to understand its configuration and details. This can be useful in scenarios where you need to assess the elements within a particular snapshot for troubleshooting or optimization purposes.
select *from digitalocean_snapshotwhere id = '12005676-5a92-11eb-a53a-0a58ac14663a';
select *from digitalocean_snapshotwhere id = '12005676-5a92-11eb-a53a-0a58ac14663a';
Droplet snapshots
Assess the elements within your DigitalOcean environment to understand the size and type of your droplet-based snapshots. This allows for better resource management and planning for storage requirements.
select name, resource_type, size_gigabytesfrom digitalocean_snapshotwhere resource_type = 'droplet';
select name, resource_type, size_gigabytesfrom digitalocean_snapshotwhere resource_type = 'droplet';
Largest snapshots
Discover the top ten largest snapshots on DigitalOcean, allowing you to identify potential areas for data management and storage optimization. This can be useful in managing your resources more efficiently and reducing costs.
select name, resource_type, size_gigabytesfrom digitalocean_snapshotorder by size_gigabytes desclimit 10;
select name, resource_type, size_gigabytesfrom digitalocean_snapshotorder by size_gigabytes desclimit 10;
Oldest snapshots
Explore which snapshots were created first on your DigitalOcean account to help manage or clean up old resources. This can be especially useful in maintaining storage efficiency and organization.
select name, resource_type, created_atfrom digitalocean_snapshotorder by created_atlimit 10;
select name, resource_type, created_atfrom digitalocean_snapshotorder by created_atlimit 10;
Snapshot with Droplet details
Discover the segments that link snapshots to specific droplets in DigitalOcean to better understand your resource allocation and usage.
select d.id as droplet_id, d.name as droplet_name, s.id as snapshot_id, s.name as snapshot_namefrom digitalocean_snapshot as s, digitalocean_droplet as dwhere s.resource_id :: bigint = d.id and s.resource_type = 'droplet';
select d.id as droplet_id, d.name as droplet_name, s.id as snapshot_id, s.name as snapshot_namefrom digitalocean_snapshot as s, digitalocean_droplet as dwhere s.resource_id = d.id and s.resource_type = 'droplet';
Query examples
- network_floating_ips_for_snapshot
- snapshot_1_year_count
- snapshot_24_hours_count
- snapshot_30_90_days_count
- snapshot_30_days_count
- snapshot_90_365_days_count
- snapshot_age_table
- snapshot_by_region
- snapshot_count
- snapshot_creation_month
- snapshot_input
- snapshot_minimum_disk_size
- snapshot_overview
- snapshot_size
- snapshot_snapshots_for_droplet
- snapshot_tags
- snapshot_total_storage
- source_droplet_droplets_for_snapshot
- storage_snapshot_by_region
- storage_snapshot_creation_month
- target_droplet_droplets_for_snapshot
Schema for digitalocean_snapshot
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form, e.g. connection_name. | |
akas | jsonb | Array of globally unique identifier strings (also known as) for the resource. | |
created_at | timestamp with time zone | Time when the block storage volume was created. | |
id | text | = | The unique identifier for the snapshot. |
min_disk_size | bigint | The minimum size in GB required for a volume or Droplet to use this snapshot. | |
name | text | A human-readable name for the snapshot. | |
regions | jsonb | An array of regions the snapshot is available in. The region slug is used. | |
resource_id | text | A unique identifier for the resource that the action is associated with. | |
resource_type | text | The type of resource that the action is associated with. | |
size_gigabytes | bigint | The billable size of the snapshot in gigabytes. | |
tags | jsonb | A map of tags for the resource. | |
tags_src | jsonb | An array of Tags the snapshot has been tagged with. | |
title | text | Title of the resource. |