如何从 Bucket - IBM Cloud Object Storage 中获取所有文件?

How to get all files from a Bucket - IBM Cloud Object Storage?

我想使用 python 获取存储桶中的所有文件。我这样尝试:

import ibm_boto3
from ibm_botocore.client import Config, ClientError

files = cos.Object(my_bucket_name).objects.all() # error here

但是它显示这个错误:

ValueError       (note: full exception trace is shown but execution is paused at: <module>)
Required parameter key not set

如何从存储桶中获取所有 objects/files?

对不起,我做错了,正确的做法是这样的:

files = cos.Bucket(bucket_name).objects.all()

问题已解决!