This document is a recipe showing how to use S3 interface for first-time user. Before you start, see cli for setup. Ensure that you can authenticate and use the openstack client before proceeding.
Obtain application credentials
openstack ec2 credentials create
Install the s3cmd utility
python3 -m pip install --user s3cmd
Edit ~/.s3cfg
to include the credentials
[default] access_key = <ACCESS KEY> secret_key = <SECRET KEY> host_base = https://overcloud.cs.uchicago.edu:8000 host_bucket = https://overcloud.cs.uchicago.edu:8000
s3cmd mb S3://chudler-bucket1 s3cmd ls S3://chudler-bucket1
Install boto library
python3 -m pip install --user boto
import boto access_key = '<ACCESS_KEY>' secret_key = '<SECRET_KEY>' conn = boto.connect_s3( aws_access_key_id = access_key, aws_secret_access_key = secret_key, host = 'overcloud.cs.uchicago.edu', port = 8000, is_secure=True ) for bucket in conn.get_all_buckets(): print("{name}\t{created}".format( name = bucket.name, created = bucket.creation_date, )) bucket = conn.get_bucket('chudler-bucket') # key = bucket.new_key('hello.txt') # key.set_contents_from_string('Hello World!') # hello_key = bucket.get_key('hello.txt') # hello_key.set_canned_acl('public-read') # UNSAFE! WATCH OUT! # hello_key.set_canned_acl('private')