PutBucketPolicy接口用于為指定的存儲空間(Bucket)設置授權策略(Policy)。
請求語法
PUT /?policy
Host: BucketName.oss-cn-hangzhou.aliyuncs.com
Date: GMT Date
Authorization: SignatureValue
Policy written in JSON
當您在OSS ON云盒中調用該接口時,您需要將Host替換為云盒Endpoint。更多信息,請參見云盒Endpoint。
請求頭
此接口僅涉及公共請求頭。更多信息,請參見公共請求頭(Common Request Headers)。
響應頭
此接口僅涉及公共響應頭。更多信息,請參見公共響應頭(Common Response Headers)。
示例
請求示例
PUT /?policy Content-Length: 230 Host: oss-example.oss-cn-hangzhou.aliyuncs.com Date: Thu, 21 Feb 2019 12:51:09 GMT Authorization: OSS qn6q**************:77Dv**************** { "Version":"1", "Statement":[ { "Action":[ "oss:PutObject", "oss:GetObject" ], "Effect":"Deny", "Principal":["1234567890"], "Resource":["acs:oss:*:1234567890:*/*"] } ] }
返回示例
HTTP/1.1 200 OK content-length: 0 server: AliyunOSS x-oss-server-time: 87 connection: keep-alive x-oss-request-id: 5C6E9EBD5CC26B28EE41**** date: Thu, 21 Feb 2019 12:51:09 GMT
文檔內容是否對您有幫助?