获取对象ACL
功能介绍
用户执行获取对象ACL的操作,返回信息包含指定对象的权限控制列表信息。用户必须拥有对指定对象读ACP(access control policy)的权限,才能执行获取对象ACL的操作。
多版本
默认情况下,获取最新版本的对象ACL。如果最新版本的对象是删除标记,则返回404。如果要获取指定版本的对象ACL,请求可携带versionId消息参数。
请求消息样式
1 2 3 4 |
GET /ObjectName?acl HTTP/1.1 Host: bucketname.obs.cn-north-4.myhuaweicloud.com Date: date Authorization: authorization |
请求消息头
该请求使用公共消息头,具体请参考表3。
请求消息元素
该请求消息中不使用消息元素。
响应消息样式
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
HTTP/1.1 status_code Date: date Content-Length: length Content-Type: application/xml <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <AccessControlPolicy xmlns="http://obs.cn-north-4.myhuaweicloud.com/doc/2015-06-30/"> <Owner> <ID>id</ID> </Owner> <Delivered>true</Delivered> <AccessControlList> <Grant> <Grantee> <ID>id</ID> </Grantee> <Permission>permission</Permission> </Grant> </AccessControlList> </AccessControlPolicy> |
响应消息元素
该请求的响应消息中通过消息元素返回对象的ACL信息,元素的具体意义如表3所示。
错误响应消息
无特殊错误,所有错误已经包含在表2中。
请求示例
1 2 3 4 5 6 |
GET /object011?acl HTTP/1.1 User-Agent: curl/7.29.0 Host: examplebucket.obs.cn-north-4.myhuaweicloud.com Accept: */* Date: WED, 01 Jul 2015 04:45:55 GMT Authorization: OBS H4IPJX0TQTHTHEBQQCEC:YcmvNQxItGjFeeC1K2HeUEp8MMM= |
响应示例
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
HTTP/1.1 200 OK Server: OBS x-obs-request-id: 8DF400000163D3E650F3065C2295674C x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCS+wsHqRuA2Tx+mXUpNtBbWLPMle9CIx Content-Type: application/xml Date: WED, 01 Jul 2015 04:45:55 GMT Content-Length: 769 <?xml version="1.0" encoding="utf-8"?> <AccessControlPolicy xmlns="http://obs.cn-north-4.myhuaweicloud.com/doc/2015-06-30/"> <Owner> <ID>b4bf1b36d9ca43d984fbcb9491b6fce9</ID> </Owner> <Delivered>false</Delivered> <AccessControlList> <Grant> <Grantee> <ID>b4bf1b36d9ca43d984fbcb9491b6fce9</ID> </Grantee> <Permission>FULL_CONTROL</Permission> </Grant> <Grant> <Grantee> <ID>783fc6652cf246c096ea836694f71855</ID> </Grantee> <Permission>READ</Permission> </Grant> <Grant> <Grantee> <Canned>Everyone</Canned> </Grantee> <Permission>READ_ACP</Permission> </Grant> </AccessControlList> </AccessControlPolicy> |
请求示例:已启用版本控制
GET /object01?acl&versionId=G001118A6803675AFFFFD3043F7F91D0 HTTP/1.1 Authorization: OBS H4IPJX0TQTHTHEBQQCEC:iqSPeUBl66PwXDApxjRKk6hlcN4= User-Agent: curl/7.29.0 Host: examplebucket.obs.region.myhuaweicloud.com Date: WED, 01 Jul 2015 02:37:22 GMT Content-Type: application/xml
响应示例:已启用版本控制
x-obs-id-2: 32AAAQAAEAABSAAgAAEAABAAAQAAEAABCSmpL2dv6zZLM2HmUrXKTAi258MPqmrp x-obs-request-id: 0000018A2A73AF59D3085C8F8ABF0C65 Server: OBS Content-Length: 0 Date: WED, 01 Jul 2015 02:37:22 GMT x-obs-version-id: G001118A6803675AFFFFD3043F7F91D0 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <AccessControlPolicy xmlns="http://obs.myhwclouds.com/doc/2015-06-30/"> <Owner> <ID>d6s58yhnm83f3081577800575ee4cf</ID> </Owner> <Delivered>false</Delivered> <AccessControlList> <Grant> <Grantee> <ID>f262a63g69422e8f330af1349c588f</ID> </Grantee> <Permission>READ</Permission> </Grant> <Grant> <Grantee> <ID>c965gfda2a849422e8f3985562432dsaa</ID> </Grantee> <Permission>FULL_CONTROL</Permission> </Grant> <Grant> <Grantee> <Canned>Everyone</Canned> </Grantee> <Permission>READ</Permission> </Grant> </AccessControlList> </AccessControlPolicy>