• Object Storage Service

obs
  1. Help Center
  2. Object Storage Service
  3. API Reference (OBS)
  4. Operations on Objects
  5. PUT Object acl
  6. Examples

Examples

Sample Request

PUT /test?acl HTTP/1.1 
 User-Agent: Jakarta Commons-HttpClient/3.1 
 Host: bucketname.obs.example.com
 Accept: */* 
 Date: Mon, 27 Sep 2010 02:00:40 GMT 
 Authorization: AWS 04RZT432N80TGDF2Y2G2:vktmLfCDhy0XbJw2T2mhNM9PZ70=  
 Content-Length: 916 
 Expect: 100-continue

 <AccessControlPolicy> 
 <Owner> 
 <ID>bcaf1ffd86f41caff1a493dc2ad8c2c281e37522a640e161ca5fb16fd081034f</ID> 
 <DisplayName>user</DisplayName> 
 </Owner> 
 <AccessControlList> 
 <Grant> 
 <Grantee xsi:type="CanonicalUser" xmlns:xsi="http:// www.w3.org/2001/XMLSchema-instance">            <ID>bcaf1ffd86f41caff1a493dc2ad8c2c281e37522a640e161ca5fb16fd081034f</ID> 
 <DisplayName>user</DisplayName> 
 </Grantee> 
 <Permission>READ</Permission> 
 </Grant> 
 <Grant> 
 <Grantee xsi:type="CanonicalUser" xmlns:xsi="http:// www.w3.org/2001/XMLSchema-instance">            <ID>bcaf1ffd86f41caff1a493dc8c2c281e37522a640e161ca5fb16fd081034f</ID> 
 <DisplayName>user</DisplayName> 
 </Grantee> 
 <Permission>WRITE</Permission> 
 </Grant> 
 </AccessControlList> 
 </AccessControlPolicy>

Sample Response

HTTP/1.1 200 OK 
 Server: OBS 
 x-amz-request-id: 5FBCAEB7BB9A1AD0FF1285553243654 
 x-amz-id-2: NUZCQ0FFQjdCQjlBMUFEMEZGMTI4NTU1MzI0MzY1NEFBQUFBQUFBYmJiYmJiYmJD 
 x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc 
 Date: Mon, 27 Sep 2010 02:07:23 GMT 
 Content-Length: 0

Sample Request (Setting the ACL of an Object with Version ID Specified)

PUT /object?acl&versionId=AAABQ47OMnbc0vycq3gAAAANVURTRkha HTTP/1.1 
 User-Agent: Jakarta Commons-HttpClient/3.1 
 Host: bucketname.obs.example.com 
 Accept: */* 
 Date: Tue, 14 Jan 2014 05:39:29 +0000 
 Authorization: AWS C9590CEB8EC051BDEC9D:PrLaB1TR7ok53Oui4jImSpWbcik= 
 Content-Length: 504 
 Expect: 100-continue

 <AccessControlPolicy xmlns="http://obs.example.com/doc/2015-06-30/"> 
 <Owner> 
 <ID>DCD2FC9CAB78000001438EC051BD0002</ID> 
 <DisplayName>user</DisplayName> 
 </Owner> 
 <AccessControlList> 
 <Grant> 
 <Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser"> 
 <ID>DCD2FC9CAB78000001438EC051BD0002</ID> 
 <DisplayName>user</DisplayName> 
 </Grantee> 
 <Permission>READ</Permission> 
 </Grant> 
 </AccessControlList> 
 </AccessControlPolicy>

Sample Response (Setting the ACL of an Object with Version ID Specified)

HTTP/1.1 200 OK 
 Server: OBS 
 x-amz-request-id: 5FBCAEB7BB9A1AD0FF1285553243654 
 x-amz-id-2: NUZCQ0FFQjdCQjlBMUFEMEZGMTI4NTU1MzI0MzY1NEFBQUFBQUFBYmJiYmJiYmJD 
 x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc 
 x-amz-version-id: AAABQ47OMnbc0vycq3gAAAANVURTRkha
 Date: Mon, 27 Sep 2010 02:07:23 GMT 
 Content-Length: 0