Commit da660c9d authored by Christian Salzmann-Jaeckel's avatar Christian Salzmann-Jaeckel
Browse files

add s3-boto.py

parent a84ba914
#!/usr/bin/python3
import os
import boto
import boto.s3.connection
s3_access_key = os.environ['AWS_ACCESS_KEY_ID']
s3_secret_key = os.environ['AWS_SECRET_ACCESS_KEY']
s3_bucket_name = 'py3-boto-bucket'
s3_host = 'rise-s3.zib.de'
# connect to s3 storage
conn = boto.connect_s3(
aws_access_key_id = s3_access_key,
aws_secret_access_key = s3_secret_key,
host = s3_host,
is_secure=True,
calling_format = boto.s3.connection.OrdinaryCallingFormat(),
)
# list all buckets
for bucket in conn.get_all_buckets():
print("{name}\t{created}".format(
name = bucket.name,
created = bucket.creation_date)
)
# create bucket
# bucket = conn.create_bucket(s3_bucket_name)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment