Skip to content

Instantly share code, notes, and snippets.

@ragingbal
Last active March 23, 2016 20:25
Show Gist options
  • Select an option

  • Save ragingbal/3957e32592e712e24c58 to your computer and use it in GitHub Desktop.

Select an option

Save ragingbal/3957e32592e712e24c58 to your computer and use it in GitHub Desktop.
List names and IPs of all nodes on an Exoscale account
import random
from pprint import pprint
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
API_KEY = 'putApiKeyHere'
API_SECRET_KEY = putSecretKeyHere'
cls = get_driver(Provider.EXOSCALE)
driver = cls(API_KEY, API_SECRET_KEY)
nodes = driver.list_nodes()
for node in nodes:
for ip in node.public_ips:
print('\t'.join([ip,node.name]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment