对象存储服务 OBS-设置桶策略:请求示例 1

时间:2024-10-21 15:06:41

请求示例 1

向OBS租户授予权限

给租户ID为783fc6652cf246c096ea836694f71855的租户授权。

如何获取租户ID请参考获取账号、 IAM 用户、项目、用户组、区域、委托的名称和ID。示例中桶策略字段的详细说明,具体请参考桶策略参数说明

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
PUT /?policy HTTP/1.1
Host: examplebucket.obs.cn-north-4.myhuaweicloud.com
Date: WED, 01 Jul 2015 02:32:25 GMT
Authorization: OBS H4IPJX0TQTHTHEBQQCEC:jZiAT8Vx4azWEvPRMWi0X5BpJMA=

{
    "Statement": [
        {
            "Sid": "Stmt1375240018061",
            "Action": [
                "GetBucketLogging"
            ],
            "Effect": "Allow",
            "Resource": "logging.bucket",
            "Principal": {
                "ID": [
                    "domain/783fc6652cf246c096ea836694f71855:user/*"
                ]
            }
        }
    ]
}
support.huaweicloud.com/api-obs/obs_04_0027.html