Custom Search
Showing posts with label Boto. Show all posts
Showing posts with label Boto. Show all posts

Tuesday, January 13, 2015

OpenStack boto VPC example





import boto
import boto, boto.ec2
region = boto.ec2.regioninfo.RegionInfo(name="nova",endpoint="192.168.56.101")
print region
conn = boto.connect_vpc(aws_access_key_id="b56adadedd394b5f8093d4bdfe858bf8",
                        aws_secret_access_key="bf541989b3f845e88ff5e66b3e98dcbe",
                        is_secure=False,
                        region=region,
                        port=8773,
                        path="/services/Cloud")

#print dir(conn)
print conn.get_all_vpcs()



Tuesday, July 23, 2013

Howto boto vm-import-export@amazon.com WRITE READ_ACL permission S3 bucket

Error
=====
Client.AuthFailure: vm-import-export@amazon.com must have WRITE and READ_ACL permission on the S3 bucket

Solution
=======
import boto
from pprint import pprint

conn = boto.connect_s3(aws_access_key_id="xxxxxxxx", aws_secret_access_key="xxxxxxxxx")

b = conn.get_bucket("my-bucket")

b.add_email_grant("READ_ACP", "vm-import-export@amazon.com")
b.add_email_grant("WRITE", "vm-import-export@amazon.com")

grants = b.list_grants()

for gr in grants:
    print "=====gr======", pprint(vars(gr))