Created
April 8, 2018 16:54
-
-
Save joenorton8014/c11569cdc352e8058eb0ac46cd3d46cf to your computer and use it in GitHub Desktop.
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 | |
# pip install -U python-digitalocean | |
# https://github.com/koalalorenzo/python-digitalocean | |
key = '' | |
manager = digitalocean.Manager(token=key) | |
my_droplets = manager.get_all_droplets() | |
print(my_droplets) | |
def List_All_VMs(manager): | |
my_droplets = manager.get_all_droplets() | |
for vm in my_droplets: | |
print '\n' | |
print 'Name: ' + vm.name | |
print 'IP Address: ' + str(vm.ip_address) | |
print 'OS: ' + str(vm.image['distribution']) + ' ' + str(vm.image['name']) | |
print 'Creation Time: ' + vm.created_at | |
print 'Disk Size: ' + str(vm.disk) | |
print 'Memory: ' + str(vm.memory) | |
print 'VCPUs: ' + str(vm.vcpus) | |
print 'Region: ' + vm.region['name'] | |
print 'SSH Keys: ' + str(vm.ssh_keys) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment