Created
April 6, 2013 21:22
-
-
Save rtomaszewski/5327673 to your computer and use it in GitHub Desktop.
list cloud servers using pyrax module
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 os | |
import pyrax | |
conf = os.path.expanduser("rackspace_cloud_credentials.txt") | |
#pyrax.set_credential_file(conf, "LON") | |
pyrax.set_credential_file(conf) | |
cs = pyrax.cloudservers | |
servers = cs.servers.list() | |
print ("cloud server under your account:") | |
for pos, srv in enumerate(servers): | |
print "%s: %s" % (pos, srv.name) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment