跳到主要内容

GetBucketLocation

GetBucketLocation用于查看Bucket所属的数据中心位置信息。

请求语法

GET /?location HTTP/1.1
Host: bucketname.cos.chinac.com
Date: GMT Date
Authorization: SignatureValue

响应元素

NameTypeDescription
LocationConstraintStringBucket所在的区域

细节分析

  1. 只有Bucket的拥有者才能查看Bucket的Location信息,否则返回403 Forbidden错误,错误码:AccessDenied

示例

请求示例

GET /?location HTTP/1.1
Host: test-bucket.cos.chinac.com
Date: Fri, 04 May 2013 05:31:04 GMT
Authorization: COS qn6qrrqxo2oawuk53otfjbyc:ceOEyZavKY4QcjoUWYSpYbJ3naA=

返回示例

HTTP/1.1 200
x-cos-request-id: 254B371674E88A4D8906008B
Date: Fri, 15 Mar 2015 05:31:04 GMT
Connection: keep-alive
Content-Length: 90
Server: COS

{
"LocationConstraint": "cos-cn-suzhou"
}