Last active
May 13, 2024 20:53
-
-
Save kincl/f8f027c103d0b68fd9b9ec8c38255761 to your computer and use it in GitHub Desktop.
Using boto3 with RGW
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3/client/list_objects.html | |
# https://boto3.amazonaws.com/v1/documentation/api/latest/guide/s3-uploading-files.html | |
import os | |
import boto3 | |
import botocore | |
s3 = boto3.client('s3', verify=False, region_name="default", endpoint_url=f"https://{os.environ['AWS_S3_ENDPOINT']}") | |
#s3.upload_file('test.txt', os.environ['AWS_S3_BUCKET'], 'test.txt') | |
# response = s3.list_buckets() | |
s3.list_objects(Bucket=os.environ['AWS_S3_BUCKET']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment