天翼云对象存储(经典版)I型API参考-HTTP REST接口PUT Bucket | |||||||||||||||||||||||||||||||
产品推荐: 1、安全稳定的云服务器租用,2核/2G/5M仅37元,点击抢购>>>; 2、高防物理服务器20核/16G/50M/500G防御仅350元,点击抢购>>> 3、百度智能建站(五合一网站)仅880元/年,点击抢购>>> 模板建站(PC+手机站)仅480元/年,点击抢购>>> 4、阿里云服务器2核2G3M仅99元/年、2核4G5M仅199元/年,新老同享,点击抢购>>> 5、腾讯云服务器2核2G4M仅99元/年、新老同享,点击抢购>>> 点击这里注册天翼云特邀VIP帐号,立即体验天翼云对象存储>>> 天翼云对象存储(经典版)I型API参考-HTTP REST接口PUT Bucket PUT Bucket操作可以用来:
只有根用户和具有PUT Bucket权限的子用户才能创建Bucket。 Bucket的命名规范如下:
注意:香港节点只有请求头,没有请求体。 请求语法
请求元素注意:香港节点不支持下列请求元素。
请求参数
请求示例1请求创建一个名叫picture的bucket,索引位置设置为LaSa,数据位置设置为优先本地,bucket权限设置为公有。 PUT / HTTP/1.1 Host: picture.oos-cn.ctyunapi.cn Content-Length:200 Content-Type: application/xml;charset=utf-8 Date: Mon, 03 Sep 2012 12:00:00 GMT Authorization: AWS 7799e793ce4624ee7e5a:9N/W/kmYwFhbqHYFTvQor317qVw= x-amz-acl: public <CreateBucketConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <MetadataLocationConstraint> <Location>LaSa</Location> </MetadataLocationConstraint> <DataLocationConstraint> <Type>Local</Type> </DataLocationConstraint> </CreateBucketConfiguration > 返回示例1HTTP/1.1 200 OK x-amz-request-id: 236A8905248E5A01 Date: Mon, 03Sep 2012 12:00:00 GMT Location: /picture Content-Length: 0 Server: CTYUN 请求示例2请求创建一个名叫picture1的bucket,索引位置设置为LaSa,数据位置设置为拉萨、成都,调度策略是允许OOS自动调度: PUT / HTTP/1.1 Host: picture1.oos-cn.ctyunapi.cn Content-Length:200 Content-Type: application/xml; charset=utf-8 Date: Mon, 03 Sep 2012 12:00:00 GMT Authorization: AWS 7799e793ce4624ee7e5a:9N/W/kmYwFhbqHYFTvQor317qVw= <CreateBucketConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <MetadataLocationConstraint> <Location>LaSa</Location> </MetadataLocationConstraint> <DataLocationConstraint> <Type>Specified</Type> <LocationList> <Location>LaSa</Location> <Location>ChengDu</Location> </LocationList> <ScheduleStrategy>Allowed</ScheduleStrategy> </DataLocationConstraint> </CreateBucketConfiguration> 返回示例2HTTP/1.1 200 OK x-amz-request-id: 236A8905248E5B01 Date: Mon, 03 Sep 2012 12:00:00 GMT Location: /picture1 Content-Length: 0 Server: CTYUN 请求示例3修改数据位置为就近。 PUT / HTTP/1.1 Host: ctyuntest0929.oos-cn.ctyunapi.cn Authorization: AWS 0c6c84764e3b8eddf928:oqF7NDGpgL33NRJJXFH60Kyjyhk= Date: Sun, 29 Sep 2019 07:16:11 GMT Content-Type: application/xml;charset=utf-8 Content-Length: 170 <CreateBucketConfiguration xmlns=" <DataLocationConstraint> <Type>Local</Type> </DataLocationConstraint> </CreateBucketConfiguration> 返回示例3HTTP/1.1 200 OK Location: /ctyuntest0929 Date: Sun, 29 Sep 2019 07:16:32 GMT x-amz-request-id: 7088d28e62cc4002 Content-Length: 0 Server: CTYUN |