Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Boto 3 is an Amazon Web Services SDK for Python, and provides an easy way to write code to interface with the USS S3 Gateway. The example below shows you can programmatically list all buckets within your USS S3 Gateway instance. While the SDK supports many AWS services, only the S3 calls are relevant to the USS S3 Gateway. More examples and documentation can be found here:


#!/usr/bin/env python 

import boto3

session = boto3.session.Session()

s3_client = session.client(
	service_name='s3',
	aws_access_key_id='<username>',
	aws_secret_access_key='<password>',
	endpoint_url='<endpoint-url>'
)

buckets = s3_client.list_buckets()

print('My Buckets:')
for bucket in buckets['Buckets']:
	print(bucket)
  • No labels