DigitalOcean CLI

 26 Sep 2021  Snippets

DigitalOcean CLI


# List Droplets
doctl compute droplet list --format "ID,Name,PublicIPv4,Status"

# Delete Droplet
doctl compute droplet delete DROPLET_ID


# List Snapshots
doctl compute snapshot list --format "ID,Name"

# Delete Snapshot
doctl compute snapshot delete SNAPSHOT_ID

# Create Snapshot from Droplet
doctl compute droplet-action snapshot DROPLET_ID --snapshot-name SNAPSHOT_NAME

Create Droplet from Snapshot:

doctl compute droplet create DROPLET_NAME --size s-2vcpu-2gb-amd --image SNAPSHOT_ID --region nyc3 --ssh-keys "SSH_KEY_ID1,SSH_KEY_ID2,SSH_KEY_ID3"

Shell aliases and functions:

alias do-droplets='doctl compute droplet list --format "ID,Name,PublicIPv4,Status"' 
alias do-snapshots='doctl compute snapshot list --format "ID,Name"'

do-droplet-delete() { doctl compute droplet delete "[email protected]" }
do-snapshot-delete() { doctl compute snapshot delete "[email protected]" }

Webmentions & Comments

Copyright © Paramdeo Singh. Built with Jekyll and ☕️ in Guyana. All Rights Reserved.

Last Site Build on Thu, 21 Oct 2021 17:49:44 -0400

1MB Club Badge

Paramdeo Singh Guyana

Riding the wave of consciousness in this treacherous mortal sea.

Technology Design Strategy Literature Personal Blogs