History
Introduction
API Category
Making API Requests
Region APIs
Instance APIs
Cloud Hosting Cluster APIs
Image APIs
Instance Launch Template APIs
Placement Group APIs
Key APIs
Security Group APIs
Network APIs
Data Types
Error Codes
x-cos-acl和x-cos-grant-*传入 ACL 信息,或者通过请求体以 XML 格式传入 ACL 信息。PUT /<ObjectKey>?acl HTTP/1.1Host: <BucketName-APPID>.cos.<Region>.myqcloud.comDate: GMT Datex-cos-acl: xxxx-cos-grant-read-acp: id="xxx"Content-Length: 0Authorization: Auth String
PUT /<ObjectKey>?acl HTTP/1.1Host: <BucketName-APPID>.cos.<Region>.myqcloud.comDate: GMT DateContent-Type: application/xmlContent-Length: Content LengthContent-MD5: MD5Authorization: Auth String[Request Body]
名称 | 描述 | 类型 | 是否必选 |
x-cos-acl | 注意:如果您不需要进行对象 ACL 控制,请设置为 default 或者此项不进行设置,默认继承存储桶权限 | Enum | 否 |
x-cos-grant-read | 赋予被授权者读取对象的权限。若被授权者为主账号,格式为 id="[OwnerUin]",例如 id="100000000001",可使用半角逗号(,)分隔多组被授权者,例如 id="100000000001",id="100000000002" | string | 否 |
x-cos-grant-read-acp | 赋予被授权者读取对象的访问控制列表(ACL)的权限。若被授权者为主账号,格式为 id="[OwnerUin]",例如 id="100000000001";若被授权者为子账号,格式为 id="[OwnerUin/SubUin]",例如 id="100000000001/100000000011"。可使用半角逗号(,)分隔多组被授权者,例如 id="100000000001",id="100000000002" | string | 否 |
x-cos-grant-write-acp | 赋予被授权者写入对象的访问控制列表(ACL)的权限。若被授权者为主账号,格式为 id="[OwnerUin]",例如 id="100000000001";若被授权者为子账号,格式为 id="[OwnerUin/SubUin]",例如 id="100000000001/100000000011"。可使用半角逗号(,)分隔多组被授权者,例如 id="100000000001",id="100000000002" | string | 否 |
x-cos-grant-full-control | 赋予被授权者操作对象的所有权限。若被授权者为主账号,格式为 id="[OwnerUin]",例如 id="100000000001";若被授权者为子账号,格式为 id="[OwnerUin/SubUin]",例如 id="100000000001/100000000011"。可使用半角逗号(,)分隔多组被授权者,例如 id="100000000001",id="100000000002" | string | 否 |
<AccessControlPolicy><Owner><ID>string</ID></Owner><AccessControlList><Grant><Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Group"><URI>string</URI></Grantee><Permission>Enum</Permission></Grant><Grant><Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser"><ID>string</ID></Grantee><Permission>Enum</Permission></Grant></AccessControlList></AccessControlPolicy>
节点名称(关键字) | 父节点 | 描述 | 类型 | 是否必选 |
AccessControlPolicy | 无 | 包含 PUT Object acl 操作的所有请求信息 | Container | 是 |
节点名称(关键字) | 父节点 | 描述 | 类型 | 是否必选 |
Owner | AccessControlPolicy | 对象持有者信息 | Container | 是 |
AccessControlList | AccessControlPolicy | 被授权者信息与权限信息 | Container | 是 |
节点名称(关键字) | 父节点 | 描述 | 类型 | 是否必选 |
ID | AccessControlPolicy.Owner | 对象持有者的完整 ID,格式为 qcs::cam::uin/[OwnerUin]:uin/[OwnerUin]例如 qcs::cam::uin/100000000001:uin/100000000001 | string | 是 |
节点名称(关键字) | 父节点 | 描述 | 类型 | 是否必选 |
Grant | AccessControlPolicy.AccessControlList | 单个授权信息,一个 AccessControlList 最多只能拥有100条 Grant | Container | 是 |
节点名称(关键字) | 父节点 | 描述 | 类型 | 是否必选 |
Grantee | AccessControlPolicy.AccessControlList.Grant | 被授权者信息, xsi:type可指定为 Group 或 CanonicalUser,当指定为 Group 时子节点包括且仅允许包括 URI,当指定为 CanonicalUser 时子节点包括且仅允许包括 ID | Container | 是 |
Permission | AccessControlPolicy.AccessControlList.Grant | Enum | 是 |
节点名称(关键字) | 父节点 | 描述 | 类型 | 是否必选 |
URI | AccessControlPolicy.AccessControlList.Grant.Grantee | 预设用户组,请参见 ACL 概述 文档中预设用户组部分例如 http://cam.qcloud.com/groups/global/AllUsers或http://cam.qcloud.com/groups/global/AuthenticatedUsers | string | 当 Grantee 的 xsi:type指定为 Group 时,必选 |
ID | AccessControlPolicy.AccessControlList.Grant.Grantee | 被授权者的完整 ID,格式为 qcs::cam::uin/[OwnerUin]:uin/[OwnerUin]例如qcs::cam::uin/100000000001:uin/100000000001 | string | 当 Grantee 的 xsi:type指定为 CanonicalUser 时,必选 |
PUT /exampleobject?acl HTTP/1.1Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.comDate: Mon, 09 Sep 2019 13:11:09 GMTx-cos-acl: public-readx-cos-grant-read-acp: id="100000000002"Content-Length: 0Authorization: q-sign-algorithm=sha1&q-ak=************************************&q-sign-time=1568034669;1568041869&q-key-time=1568034669;1568041869&q-header-list=content-length;date;host;x-cos-acl;x-cos-grant-read-acp&q-url-param-list=acl&q-signature=****************************************Connection: close
HTTP/1.1 200 OKContent-Length: 0Connection: closeDate: Mon, 09 Sep 2019 13:11:10 GMTServer: tencent-cosx-cos-request-id: NWQ3NjRmNmRfZjZjMjBiMDlfMmE5MWJfMTI3OWZh****
PUT /exampleobject?acl HTTP/1.1Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.comDate: Tue, 10 Sep 2019 06:32:02 GMTContent-Type: application/xmlContent-Length: 594Content-MD5: zUPEBc1TeGrqTqEfPV7rxg==Authorization: q-sign-algorithm=sha1&q-ak=************************************&q-sign-time=1568097122;1568104322&q-key-time=1568097122;1568104322&q-header-list=content-length;content-md5;content-type;date;host&q-url-param-list=acl&q-signature=****************************************Connection: close<AccessControlPolicy><Owner><ID>qcs::cam::uin/100000000001:uin/100000000001</ID></Owner><AccessControlList><Grant><Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Group"><URI>http://cam.qcloud.com/groups/global/AllUsers</URI></Grantee><Permission>READ</Permission></Grant><Grant><Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser"><ID>qcs::cam::uin/100000000002:uin/100000000002</ID></Grantee><Permission>READ_ACP</Permission></Grant></AccessControlList></AccessControlPolicy>
HTTP/1.1 200 OKContent-Length: 0Connection: closeDate: Tue, 10 Sep 2019 06:32:02 GMTServer: tencent-cosx-cos-request-id: NWQ3NzQzNjJfZmVhODBiMDlfMjc5MGVfMTM4OTky****
文档反馈