Skip to content

Instantly share code, notes, and snippets.

@novel
Created May 6, 2011 09:51
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 novel/958704 to your computer and use it in GitHub Desktop.
Save novel/958704 to your computer and use it in GitHub Desktop.
Example of connecting to OpenStack's Rackspace-compatible API using libcloud
#!/usr/bin/env python
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
NOVA_API_KEY=""
NOVA_USERNAME=""
# NOVA_URL="http://192.168.0.1:8774/v1.0/"
if __name__ == "__main__":
Driver = get_driver(Provider.OPENSTACK)
conn = Driver(NOVA_USERNAME, NOVA_API_KEY, False, host="192.168.0.1", port=8774)
print conn.list_nodes()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment