我该如何翻译的AWS S3网址为博托桶的名字吗?我该、名字、网址、AWS

2023-09-11 10:02:09 作者:蛋酥软妹

我试图访​​问 http://s3.amazonaws.com/ commoncrawl /解析输出/段/ 桶博托。我无法弄清楚如何将此转化为一个名称boto.s3.bucket.Bucket()。

I'm trying to access the http://s3.amazonaws.com/commoncrawl/parse-output/segment/ bucket with boto. I can't figure out how to translate this into a name for boto.s3.bucket.Bucket().

这就是我要去的主旨:

s3 = boto.connect_s3()
cc = boto.s3.bucket.Bucket(connection=s3, name='commoncrawl/parse-output/segment')
requester = {'x-amz-request-payer':'requester'}
contents = cc.list(headers=requester)
for i,item in enumerate(contents):
    print item.__repr__()

我得到boto.exception.S3ResponseError:S3ResponseError:400错误的请求......指定的水桶是无效的。

I get "boto.exception.S3ResponseError: S3ResponseError: 400 Bad Request ... The specified bucket is not valid..."

推荐答案

桶名称将是commoncrawl。之后出现的一切都是真的出现在斗按键的名称的一部分。

The bucket name would be commoncrawl. Everything that appears after that is really just part of the name of the keys that appear in the bucket.