Frequently Asked Question

How to use the S3 Interface?
Last Updated 4 years ago

1. Download the EC2 credentials file from horizon. (or from the CLI run `openstack ec2 credentials list`).


image

2. Open the the credentials file, and get the EC2_ACCESS_KEY and EC2_SECRET_KEY.

3. The endpoint to connect to is kzn-swift.massopen.cloud

4. You can now connect to the S3 interface, here's an example using python boto library.

naved-home@~$cat sthree.py 
import boto
import boto.s3.connection
access_key = "myaccesskey"
secret_key = "mysecretkey"
endpoint = "kzn-swift.massopen.cloud"
conn = boto.connect_s3(
aws_access_key_id = access_key,
aws_secret_access_key = secret_key,
host = endpoint,
#is_secure=False, # uncomment if you are not using ssl
calling_format = boto.s3.connection.OrdinaryCallingFormat(),
)
for bucket in conn.get_all_buckets(): print(bucket.name)
naved-home@~$python sthree.py
naved-container somtest

5. To use the aws command line, install awscli and create a ~/.aws/credentials file with the following contents:
[default]
aws_access_key_id =
aws_secret_access_key =
and then you can use awscli as shown below.:
naved-home@~$/usr/local/bin/aws --endpoint-url='https://kzn-swift.massopen.cloud' s3 ls
2020-05-01 14:51:11 naved-container
2020-05-04 11:46:46 somtest

Please Wait!

Please wait... it will take a second!