Skip to content

Instantly share code, notes, and snippets.

@makeittotop
Created March 18, 2015 09:34
Show Gist options
  • Save makeittotop/03e1f9528818ec551849 to your computer and use it in GitHub Desktop.
Save makeittotop/03e1f9528818ec551849 to your computer and use it in GitHub Desktop.
Get a health / status check on your digitalocean droplets. Put this in a tiny flask app for example, and you can check their status anytime on the go.
import digitalocean
manager = digitalocean.Manager(token="****")
my_droplets = manager.get_all_droplets()
'''
for d in my_droplets:
print("Droplet name: ", d.name)
my_droplets = manager.get_all_droplets()
for d in my_droplets:
actions = d.get_actions()
for action in actions:
print(action.status)
'''
my_droplets = manager.get_all_droplets()
my_droplets[0].status
for d in my_droplets:
print(d.name, ": ", d.status)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment