-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Unable to get JSON output from aws s3 ls
command
#709
Comments
I can confirm that this does not work as expected. If you are looking for JSON output from a specific S3 command, you can however use the low level API: $ aws s3api list-buckets --output json
...
$ aws s3api list-buckets --output table
... |
The |
this is a mess. S3 is able to sync and to ls but not to output the result as JSON string. S3api is able to output in JSON strings but not able to use sync command or ls. Many different tools and non of them is able to provide this simple featureset. |
@bes1002t This works for me $ aws --output json s3api list-objects --bucket your-bucket --prefix 'some/path/' As an alternative to: $ aws --output json s3 ls s3://your-bucket/some/path/ However, I do not see a good reason why JSON output would not be supported by @jamesls Would a PR to add this be accepted? |
Perhaps if it's not supported, the command should output a message stating that the output format isn't supported, and at a stretch, suggest an alternative that is supported? Kind of in the way git has the "did you mean" suggestions. |
@dagwiers list-objects prefix could be a solution. When I posted my rant I did not know about that command. :P How about the performance of list-objects vs ls? I experienced some performance issues using list-objects because with large buckets it compares the prefix with EACH file in bucket, which needs a huge amount of time for many files. |
@bes1002t That is why I asked if a PR would be accepted. Now it looks like this was by design and will not be improved/fixed. |
Yes. On large buckets s3api takes forever. So what is solution really ? Besides using external DB to index s3 objects :) |
@nikolai-derzhak-distillery it seems there is no real solution so far. I tried several ways and none of them was a good solution for large buckets. I don't understand why nobody cares about such an performance issue. |
@jamesls Why was this closed as "Completed". The bug still exists and cost me a couple hours trying to figure out why |
It's still present: aws --version
aws-cli/2.9.7 There is not any other type can be picked, but it listed in
and
|
not working for me either |
if --output is not supported on aws s3 ls command, then why is it documented? |
There should be a warning printed when an ignored option is used. Also, it would be nice if this could be documented under
P.S. please also printout about using
I didn't realise that |
the issue is still there. No warnings, just a silent ignore of the option.
my aws cli version is: 2.12.6 |
13 years later and still not fixed. Unbelievable. |
Guys, can you recheck this, please? It's weird behavior. cc @kyleknap, @jamesls, @elysahall, @aws-sdk-python-automation, @kdaily |
I'm still seeing this on current It's ludicrous to me that the global option for choosing format exists, and yet fails silently. I'm stuck using AWS runs something like 1/4 of the content on the Internet. How is it that 13 years on this issue has never been sorted out? |
Same. |
Yes, its still there, |
Subtle warnings are not adequate IMO. |
I'd like to bring this conversation back. The fact that the documentation (aws s3 ls help) shows options that simply aren't implemented it serious. I'm surprised this wasn't properly addressed after 10 years. |
Output from
aws s3 ls
is always returned as text regardless of the value of the--output
parameter.The text was updated successfully, but these errors were encountered: