Get a specific existing snapshot by ID
import { DigitalOcean } from 'digitalocean-js';
const client = new DigitalOcean('your-api-key');
const snapshot = await client.snapshots.getSnapshotById('snapshot-id');
Get all snapshots on the account. Optionally provide a resource type to filter snapshots.
import { DigitalOcean } from 'digitalocean-js';
const client = new DigitalOcean('your-api-key');
// Get all snapshots
const snapshots = await client.snapshots.getSnapshots();
// Get all droplet snapshots
snapshots = await client.snapshots.getSnapshots('droplet');
// Get all volume snapshots
snapshots = await client.snapshots.getSnapshots('volume');
Optional
resourceType: SnapshotTypeGenerated using TypeDoc
Delete a specific snapshot by ID
Example