提取AWS S3存储桶中特定文件夹内的链接 [英] Extract Links Within Specific Folder in AWS S3 Buckets

查看:359
本文介绍了提取AWS S3存储桶中特定文件夹内的链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试获取我的AWS S3 API来列出存储在S3存储桶中的对象.我已成功使用以下代码从S3存储桶中提取了一些链接.

I am trying to get my AWS S3 API to list objects that I have stored in my S3 buckets. I have successfully used the code below to pull some of the links from my S3 buckets.

aws s3api list-objects --bucket my-bucket --query Contents[].[Key] --output text

问题是我的命令提示符中的输出未列出整个S3存储桶清单.是否可以更改此代码,以便CLI上的输出列出完整清单?如果不是,是否有办法将代码更改为以S3存储桶中的特定文件名为目标?例如,我的存储桶中的所有文件名都是日期,因此我将尝试从"my-bucket"存储桶中名为3_15_20视频的文件中拉出所有链接.提前致谢!

The problem is the output in my command prompt is not listing the entire S3 Bucket inventory list. Is it possible to alter this code so that the output on my CLI lists the full inventory? If not, is there a way to alter the code to target specific file names within the S3 Bucket? For example, all the file names in my bucket are dates, so I would try and pull all the links from the file titled 3_15_20 Videos within the "my-bucket" bucket. Thanks in advance!

推荐答案

来自列表对象-AWS CLI命令参考:

list-objects是分页操作.可以发出多个API调用,以检索结果的整个数据集.您可以通过提供--no-paginate参数来禁用分页.

list-objects is a paginated operation. Multiple API calls may be issued in order to retrieve the entire data set of results. You can disable pagination by providing the --no-paginate argument.

因此,请尝试使用--no-paginate并查看它是否返回所有对象.

Therefore, try using --no-paginate and see whether it returns all objects.

如果您定期列出包含大量对象的存储桶,则还可以考虑使用

If you are regularly listing a bucket that contains a huge number of objects, you could also consider using Amazon S3 Inventory, which can provide a daily CSV file listing the contents of a bucket.

这篇关于提取AWS S3存储桶中特定文件夹内的链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆