1. Create a bucket
- In the console, open Object Storage and select Buckets.
- Select Create bucket and enter a name. Names are unique across all customers.
Or with the CLI:
ezgh objects buckets create my-bucket2. Create an access key
- Select Access keys, then Create access key.
- Copy the access key ID and the secret. The secret is shown once.
Or with the CLI, which prints the secret once:
ezgh objects keys create --description quickstartPut them in your environment:
export AWS_ACCESS_KEY_ID="oak_…"
export AWS_SECRET_ACCESS_KEY="…"3. Upload, list and download
pip install boto3import boto3
from botocore.config import Config
s3 = boto3.client(
"s3",
endpoint_url="https://s3.us-west-1.ezghapps.com",
region_name="us-west-1",
config=Config(signature_version="s3v4"),
)
s3.put_object(Bucket="my-bucket", Key="hello.txt", Body=b"Hello")
for item in s3.list_objects_v2(Bucket="my-bucket").get("Contents", []):
print(item["Key"], item["Size"])
print(s3.get_object(Bucket="my-bucket", Key="hello.txt")["Body"].read())Replace my-bucket with your bucket’s name. To download, the key’s owner needs
objects.objects.download.
Next steps
- Share objects with public read or presigned URLs.
- Use the AWS CLI, boto3 or rclone.