获得参数的错误无效类型,值:['db/',' db1/'],类型:< class' list'> ,,类型:< class' str'>在S3存储桶中读取文件夹时
我需要在我的S3桶('db','db1','db2')中列出某些特定文件夹的子文件夹。 我正在设置一个带有感兴趣的文件夹的数组,而不是全部在存储桶中。 我正在使用此“过滤器前缀”方法,但不接受数组。
import boto
s3 = boto3.resource('s3')
my_bucket = s3.Bucket('database_buckets')
for object_summary in my_bucket.objects.filter(Prefix=["db/", "db1/", "db2/"]):
print(object_summary.key)
错误:botocore.exceptions.paramvalidationerror:参数验证失败: 参数前缀的无效类型,值:['db/','db1/','db2/'],类型:< class'list'>,有效的类型:< class'str'str'str'>
我有什么想法在这些特定文件夹中列出这些文件? 由于有许多文件夹(超过30个文件夹),因此与数组进行操作是理想的选择。
I need to list subfolders of some specific folders in my S3 Bucket ('db', 'db1', 'db2')
I'm setting an array with the folders of interest, and not all of them inside the bucket.
I'm using this 'filter Prefix' method, but it doesn't accept array.
import boto
s3 = boto3.resource('s3')
my_bucket = s3.Bucket('database_buckets')
for object_summary in my_bucket.objects.filter(Prefix=["db/", "db1/", "db2/"]):
print(object_summary.key)
Error: botocore.exceptions.ParamValidationError: Parameter validation failed:
Invalid type for parameter Prefix, value: ['db/', 'db1/', 'db2/'], type: <class 'list'>, valid types: <class 'str'>
Any ideas for me to list these files inside these specific folders?
As there are many folders (more than 30), it would be ideal to do with array.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论