Created
March 18, 2015 09:34
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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