Created
August 15, 2012 12:30
-
-
Save tomellis/3359717 to your computer and use it in GitHub Desktop.
Eucalyptus Boto Example
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/python | |
# Simple example to list all images in Eucalyptus via ec2-api | |
# Author: tom.ellis@eucalyptus.com | |
import boto | |
from boto.ec2.regioninfo import RegionInfo | |
# Credentials | |
access_key="" | |
secret_key="" | |
ec2_host="" | |
# Setup connection to Eucalyptus | |
conn = boto.connect_ec2(aws_access_key_id=access_key, | |
aws_secret_access_key=secret_key, | |
is_secure=False, | |
region=RegionInfo(name="eucalyptus", endpoint=ec2_host), | |
port=8773, | |
path="/services/Eucalyptus") | |
# Run commands | |
images = conn.get_all_images() | |
for i in images: | |
print i.name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment