Get Bucket Policy

描述

获取桶的策略

request

GET /?policy HTTP/1.1
HOST: ${BucketName}.${endpoint}
Date: ${date}
Authorization: ${signature}

response

HTTP/1.1 200 OK
x-nos-request-id: 17b21e42ac11000001390ab891440240
Date: Wed, 01 Mar 2012 21:34:55 GMT
Connection: close
Server: NOS
Content-length : ${length}

{
    "Version": "1",
    "Id": "Policy1528352061981",
    "Statement": {
        "Sid" : "test",
        "Effect" : "Allow",
        "Action" : ["nos:ListBucket"],
        "Principal" : {"nws":["nrn:nws:iam::productid:root"]},
        "Resource" : ["nrn:nws:nos:::example_bucket/object"],
        "Condition" : {
            "StringLike" : {
                "nos:preifx":"aa"
            }
        }
    }
}

细节描述

1.如果从来没有设置过或删除了Policy,返回为空 2.如果桶不存在,返回404,报NoSuchBucket 3.如果没有获取桶策略的权限,那么返回403 Forbidden 错误。错误码:AccessDenied。