Created
May 6, 2011 09:43
-
-
Save novel/958696 to your computer and use it in GitHub Desktop.
Example of connecting to OpenStack's EC2-compatible API using libcloud
This file contains 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
#!/usr/bin/env python | |
from libcloud.compute.types import Provider | |
from libcloud.compute.providers import get_driver | |
EC2_ACCESS_KEY="" | |
EC2_SECRET_KEY="" | |
# EC2_URL="http://192.168.0.1:8773/services/Cloud" | |
if __name__ == "__main__": | |
Driver = get_driver(Provider.EUCALYPTUS) | |
conn = Driver(EC2_ACCESS_KEY, secret=EC2_SECRET_KEY, | |
host="192.168.0.1", secure=False, port=8773, | |
path="/services/Cloud") | |
print conn.list_nodes() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment