Establishing a resource:
The first task which must be completed is creating a connection to your RGW.
import boto3
access='<access>'
secret='<secret>'
endpoint = 'https://<RGW_FQDN>'
s3 = boto3.resource('s3', endpoint_url=endpoint, use_ssl=True,
aws_access_key_id=access, aws_secret_access_key=secret)
From here you can reference the 's3' resource to perform actions, such as listing all your buckets:
for bucket in s3.buckets.all():
print(bucket.name)
Additional s3 examples can be referenced at Boto 3 Docs .
Comments