Skip to content

Instantly share code, notes, and snippets.

@nicholaskuechler
Created July 11, 2012 17:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nicholaskuechler/3091886 to your computer and use it in GitHub Desktop.
Save nicholaskuechler/3091886 to your computer and use it in GitHub Desktop.
rackspace cloudservers - list host machines a cloud server is running on
"""
list cloud servers and their physical host
"""
import cloudservers
USERNAME = "your_username_here"
API_KEY = "your_api_key_here"
cloudservers = cloudservers.CloudServers(USERNAME, API_KEY)
servers = cloudservers.servers.list()
for s in servers:
print "Server: %-30s ==> Host: %-40s" % (s.name, s.hostId)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment