Created
September 18, 2019 15:18
-
-
Save cbodley/7ecbbaf4d220a120b2a893a4abf7ba0d to your computer and use it in GitHub Desktop.
List the contents of an s3 bucket with the AllowUnordered extension
This file contains hidden or 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
#!/usr/bin/python | |
import boto3 | |
import sys | |
# bucket name as first argument | |
bucketname = sys.argv[1] | |
# endpoint and keys from vstart | |
endpoint='http://127.0.0.1:8000' | |
access_key='0555b35654ad1656d804' | |
secret_key='h7GhxuBLTrlhVUyxSPUKUV8r/2EI4ngqJxD7iBdBYLhwluN30JaT3Q==' | |
client = boto3.client('s3', | |
endpoint_url=endpoint, | |
aws_access_key_id=access_key, | |
aws_secret_access_key=secret_key) | |
print client.list_objects(Bucket=bucketname, AllowUnordered=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment