调用PutAccessPointPolicy接口配置接入点策略。
注意事项
阿里云账号默认拥有配置接入点策略的权限。如果您希望通过RAM用户或者STS的方式配置接入点策略,您必须拥有oss:PutAccessPointPolicy
权限。
请求语法
PUT /?accessPointPolicy HTTP/1.1
Date: GMT Date
Content-Length:ContentLength
Content-Type: application/json
Host: BucketName.oss-cn-hangzhou.aliyuncs.com
x-oss-access-point-name: apname
Authorization: SignatureValue
Policy written in JSON
请求头
名称 | 类型 | 是否必选 | 示例值 | 描述 |
x-oss-access-point-name | 字符串 | 是 | ap-01 | 接入点名称。 |
此接口涉及的其他公共请求头,例如Date,Authorization等。更多信息,请参见公共请求头(Common Request Headers)。
响应头
此接口仅包含公共响应头。更多信息,请参见公共响应头(Common Response Headers)。
示例
请求示例
PUT /?accessPointPolicy HTTP/1.1 Date: Mon, 19 Jun 2023 03:15:40 GMT Content-Length:230 Content-Type: application/json Host: oss-example.oss-cn-hangzhou.aliyuncs.com x-oss-access-point-name: ap-01 Authorization: OSS qn6q**************:77Dv**************** { "Version":"1", "Statement":[ { "Action":[ "oss:PutObject", "oss:GetObject" ], "Effect":"Deny", "Principal":["27737962156157xxxx"], "Resource":[ "acs:oss:cn-hangzhou:111933544165xxxx:accesspoint/ap-01", "acs:oss:cn-hangzhou:111933544165xxxx:accesspoint/ap-01/object/*" ] } ] }
返回示例
HTTP/1.1 200 OK x-oss-request-id: 5C1B138A109F4E405B2D**** Date: Mon, 19 Jun 2023 03:15:40 GMT Content-Length: 0 Connection: keep-alive Server: AliyunOSS
文档内容是否对您有帮助?