此操作用来返回指定Bucket的Policy。只有根用户和拥有GET Bucket Policy权限的子用户才能执行此操作,否则会返回403 AccessDenied错误。如果Bucket没有Policy,返回404,NoSuchPolicy错误。
请求语法
GET /?policy HTTP/1.1
Host: BucketName.oos-cn.ctyunapi.cn
Date: date
Authorization: SignatureValue
请求参数
名称 | 描述 | 是否必须 |
---|---|---|
BucketName | 存储桶名称 | 是 |
请求示例
GET /?policy HTTP/1.1
Host: example-bucket.oos-cn.ctyunapi.cn
Content-MD5: 1B2M2Y8AsgTpgAmY7PhCfg==
Content-Type: application/octet-stream
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
Date: Sun, 28 Apr 2024 06:13:38 GMT
Authorization: SignatureValue
响应示例
HTTP/1.1 200 OK
Content-Type: application/xml;charset=UTF-8
x-amz-request-id: 2d3abf4e95fa4a092b9e91a095a2a4aa696b725f6163656769
Date: Sun, 28 Apr 2024 06:13:38 GMT
Content-Length: 465
Server: CTYUN
{
"Version":"2012-10-17",
"Id":"*",
"Statement":[
{
"Sid":"*",
"Effect":"Allow",
"Principal":{ "CTYUN": "arn:ctyun:iam::32fefj64y54gc:user/test1" },
"Action":"oos:*",
"Resource":"arn:ctyun:oos:::example-bucket/*",
"Condition":{
"StringLike":{
"ctyun:Referer":[
"https://www.ctyun.cn/*",
"https://ctyun.cn/*"
]
}
}
}
]
}