GetAccessPointPolicy

调用GetAccessPointPolicy接口获取接入点策略配置。

注意事项

阿里云账号默认拥有获取接入点策略配置的权限。如果您希望通过RAM用户或者STS的方式获取接入点策略配置,您必须拥有oss:GetAccessPointPolicy权限。

请求语法

GET /?accessPointPolicy HTTP/1.1
Date: GMT Date
Content-Length:ContentLength
Content-Type: application/xml
Host: BucketName.oss-cn-hangzhou.aliyuncs.com
x-oss-access-point-name: apname
Authorization: SignatureValue

请求头

名称

类型

是否必选

示例值

描述

x-oss-access-point-name

字符串

ap-01

接入点名称。

此接口涉及的其他公共请求头,例如Date,Authorization等。更多信息,请参见公共请求头(Common Request Headers)

响应头

此接口仅包含公共响应头。更多信息,请参见公共响应头(Common Response Headers)

示例

  • 请求示例

    GET /?accessPointPolicy HTTP/1.1
    Date: Mon, 19 Jun 2023 03:15:40 GMT
    Content-Length:230
    Content-Type: application/xml
    Host: oss-example.oss-cn-hangzhou.aliyuncs.com
    x-oss-access-point-name: ap-01
    Authorization: OSS qn6q**************:77Dv****************    
  • 返回示例

    HTTP/1.1 200
    x-oss-request-id: 5C1B138A109F4E405B2D****
    Date: Mon, 19 Jun 2023 03:15:40 GMT
    Content-Length: 0
    Connection: keep-alive
    Server: AliyunOSS
    content-type: application/json 
    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/*"
         ]
       }
      ]
     }