Custom Search

Sunday, September 1, 2013

How to use boto Python API with OpenStack

import boto
import boto.ec2

region = boto.ec2.regioninfo.RegionInfo(name="nova", endpoint="192.168.12.222")

conn = boto.connect_ec2(aws_access_key_id="xxxxxxxxxxxxxxx",
                                aws_secret_access_key="xxxxxxxxxxxxxxxx",
                                is_secure=False,
                                region=region,
                                port=8773,
                                path="/services/Cloud")


print "-----conn-------", conn

print "-----get_all_regions-------", conn.get_all_regions()

1 comment:

  1. import boto
    import boto.ec2

    EC2_ACCESS_KEY = "345f5b055e2b40df8e7b43ff3a98dbbf"
    EC2_SECRET_KEY = "1539bb0e600f45eeb53e36c3f0b6a50a"

    region = boto.ec2.regioninfo.RegionInfo(name="nova", endpoint="192.168.56.102")

    conn = boto.connect_ec2(debug=2, aws_access_key_id=EC2_ACCESS_KEY,
    aws_secret_access_key=EC2_SECRET_KEY,
    is_secure=False,
    region=region,
    port=8773,
    path="/services/Cloud")

    print "-----get_all_regions-------", conn.get_all_regions()


    ReplyDelete