-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
s3-credentials list-bucket bucket-name
command
#28
Comments
Prototype: @cli.command()
@click.argument("bucket")
@common_boto3_options
def list_bucket(bucket, access_key, secret_key, session_token, endpoint_url):
"List content of bucket"
s3 = make_client("s3", access_key, secret_key, session_token, endpoint_url)
paginator = s3.get_paginator("list_objects_v2")
keys = []
for page in paginator.paginate(Bucket=bucket):
for row in page["Contents"]:
click.echo(json.dumps(row, indent=4, default=str)) |
Looks like I accidentally checked in the implementation of this in f6fd163 - but it still needs documentation and tests. s3-credentials/s3_credentials/cli.py Lines 668 to 677 in 75ce3b2
|
Spotted a bug - throws an error if run against a bucket that contains no keys:
|
Also it currently outlines not-quite-newline-delimited-JSON (it's newline delimited but also pretty printed, which I don't think will work) - need to design better default and output options for it.
|
I'm going to steal some of the output option ideas from
Then offer |
I just spotted |
Still needs documentation which I will add in #28
This is looking good, needs documentation. |
Mainly useful for ease of testing that the temporary credentials created in #27 actually work.
The text was updated successfully, but these errors were encountered: