我该如何翻译的AWS S3网址为博托桶的名字吗? [英] How do I translate an AWS S3 url into a bucket name for boto?

查看:258
本文介绍了我该如何翻译的AWS S3网址为博托桶的名字吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图访​​问 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.

这篇关于我该如何翻译的AWS S3网址为博托桶的名字吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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