Last active
March 23, 2016 20:25
-
-
Save ragingbal/3957e32592e712e24c58 to your computer and use it in GitHub Desktop.
List names and IPs of all nodes on an Exoscale account
This file contains hidden or 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 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