Found 0 result in total
Content is empty
If you don't find the content you expect, please try another search term
Last updated:2021-09-14 16:18:03
This GET interface can get the BucketPolicy configuration of a Bucket. If you want to use this interface, you need to be the owner of this Bucket. If the interface is called successfully, it will return 200 and the configuration information of BucketPolicy; if you do not have permission to obtain BucketPolicy, it will return 403 Access Denied; if there is no BucketPolicy configuration, it will return 404 Policy Not Found.
GET /?policy HTTP/1.1
Host: {BucketName}.{endpoint}
Date: {date}
Authorization: {SignatureValue}
Note:
The interface does not use request parameters.
This interface only uses common request headers. For more information, please click Public request headers
A JSON string describing the bucket policy.
This interface can use all common response headers. For more information, please click Public response headers.
Bucketpolicy configuration information, string in JSON format.
The interface does not return any special errors.
GET http://ks3-example.ks3-cn-beijing.ksyuncs.com/?policy HTTP/1.1
Host: ks3-cn-beijing.ksyun.com
Authorization: authorization string
Date: Tue, 19 Jul 2016 09:12:54 GMT
When a Bucket Policy exists:
HTTP/1.1 200 OK
Content-Length: 232
Content-Type: application/json; charset=UTF-8
Date: Tue, 19 Jul 2016 09:25:29 GMT
Server: Tengine
X-Kss-Request-Id: 708e01a0b42642cd94611f33a2a96874
{"Version":"2008-10-17","Statement":[{"Sid":"1","Effect":"Allow","Principal":{"KSC":["krn:ksc:iam::{userid}:root"
]},"Action":["ks3:PutObject"],"Resource":["krn:ksc:ks3:::ks3-example/*","krn:ksc:ks3:::ks3-example"]}]}
When Bucket Policy does not exist:
HTTP/1.1 404 Not Found
Content-Type: application/xml
Date: Tue, 19 Jul 2016 09:28:59 GMT
Server: Tengine
X-Kss-Request-Id: 1f807bb266854e4487ce27857001ba38
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Error><Code>NoSuchBucketPolicy</Code>
<Message>The bucket policy does not exist.</Message><Resource>/ks3-example/?policy</Resource>
<RequestId>1f807bb266854e4487ce27857001ba38</RequestId></Error>
Pure Mode