· 7 years ago · Jul 23, 2018, 12:26 PM
1#!/usr/bin/python
2
3import boto.s3.connection
4
5access_key = 'xxxxxxxxxxxxx'
6secret_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
7conn = boto.connect_s3(
8 aws_access_key_id=access_key,
9 aws_secret_access_key=secret_key,
10 host='127.0.0.1', port=7480,
11 is_secure=False, calling_format=boto.s3.connection.OrdinaryCallingFormat(),
12 )
13
14bucket = conn.create_bucket('uat-data')
15for bucket in conn.get_all_buckets():
16 print "{name} {created}".format(
17 name=bucket.name,
18 created=bucket.creation_date,
19 )