Skip to content

Instantly share code, notes, and snippets.

@hatchetation
Created April 22, 2014 18:16
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 hatchetation/11189097 to your computer and use it in GitHub Desktop.
Save hatchetation/11189097 to your computer and use it in GitHub Desktop.
A minimal example of using pyrax to get an interactive shell for interacting with Rackspace openstack servers
#!/usr/bin/env python
from os import environ
from IPython import embed
import pyrax
if environ['OS_PASSWORD'] and environ['OS_USERNAME']:
pyrax.set_environment(environ['OS_USERNAME'])
pyrax.set_credentials(environ['OS_USERNAME'], environ['OS_PASSWORD'])
cs = pyrax.cloudservers
servers = cs.list()
if __name__ == '__main__':
print "Pyrax client is available in `cs`, servers in `servers`."
embed()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment