forked from docs/doc-exports
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-authored-by: Jawei, Li <lijiawei5@huawei.com> Co-committed-by: Jawei, Li <lijiawei5@huawei.com>
200 lines
15 KiB
HTML
200 lines
15 KiB
HTML
<a name="EN-US_TOPIC_0125560468"></a><a name="EN-US_TOPIC_0125560468"></a>
|
|
|
|
<h1 class="topictitle1">PUT Bucket acl</h1>
|
|
<div id="body37941365"><p class="msonormal" id="EN-US_TOPIC_0125560468__p28031737">OBS allows you to control access permission for buckets. By default, only the creator of a bucket has <strong id="EN-US_TOPIC_0125560468__b5927966">READ</strong> and <strong id="EN-US_TOPIC_0125560468__b53351697">WRITE</strong> permission for the bucket. The creator can also set other access permission. For example, the creator can set a public-read access policy to grant READ permission to other users.</p>
|
|
<p class="msonormal" id="EN-US_TOPIC_0125560468__p50959044">You can set an access control policy when creating a bucket, and modify or obtain the bucket access control list (ACL) using the <strong id="EN-US_TOPIC_0125560468__b10403232">PUT Bucket acl</strong> and <strong id="EN-US_TOPIC_0125560468__b26520226">GET Bucket acl</strong> operations.</p>
|
|
<div class="section" id="EN-US_TOPIC_0125560468__section30438641"><h4 class="sectiontitle">Request Syntax</h4><pre class="screen" id="EN-US_TOPIC_0125560468__screen1610202112923">PUT /?acl HTTP/1.1
|
|
User-Agent: agent
|
|
Host: bucketname.obs.example.com
|
|
Date: date
|
|
Authorization: authorization
|
|
Content-Length: length
|
|
|
|
<AccessControlPolicy>
|
|
<Owner>
|
|
<ID>ID</ID>
|
|
<DisplayName>displayname</DisplayName>
|
|
</Owner>
|
|
<AccessControlList>
|
|
<Grant>
|
|
<Grantee>grantee</Grantee>
|
|
<Permission>permission</Permission>
|
|
</Grant>
|
|
</AccessControlList>
|
|
</AccessControlPolicy> </pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560468__section5512319"><h4 class="sectiontitle">Request Parameters</h4><p id="EN-US_TOPIC_0125560468__p38053234">This request involves no parameters.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560468__section49610875"><h4 class="sectiontitle">Request Headers</h4><p id="EN-US_TOPIC_0125560468__p1179455233817">You can set the ACL of a bucket to a predefined ACL, also called a canned ACL. Each canned ACL has a predefined set of grantees and permission.</p>
|
|
<p id="EN-US_TOPIC_0125560468__p62413107">Optional header <strong id="EN-US_TOPIC_0125560468__b187731754185912">x-amz-acl</strong> is used in this request to specify canned ACLs. <a href="#EN-US_TOPIC_0125560468__table37355450">Table 1</a> describes the optional header.</p>
|
|
|
|
<div class="tablenoborder"><a name="EN-US_TOPIC_0125560468__table37355450"></a><a name="table37355450"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0125560468__table37355450" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Optional header for specifying canned ACLs</caption><thead align="left"><tr id="EN-US_TOPIC_0125560468__row24384169"><th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.5.4.2.4.1.1"><p id="EN-US_TOPIC_0125560468__p28960701">Header</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.5.4.2.4.1.2"><p id="EN-US_TOPIC_0125560468__p64115445">Description</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.5.4.2.4.1.3"><p id="EN-US_TOPIC_0125560468__p25968570">Remarks</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0125560468__row23079411"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.5.4.2.4.1.1 "><p id="EN-US_TOPIC_0125560468__p57493001">x-amz-acl</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.5.4.2.4.1.2 "><p id="EN-US_TOPIC_0125560468__p26421475">Indicates the canned ACL applied to a bucket.</p>
|
|
<p id="EN-US_TOPIC_0125560468__p36466685">Type: String</p>
|
|
<p id="EN-US_TOPIC_0125560468__p59764713">Valid values: <strong id="EN-US_TOPIC_0125560468__b14792139108">private| public-read| public-read-write|authenticated-read|bucket-owner-read|bucket-owner-full-control|log-delivery-write</strong></p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.5.4.2.4.1.3 "><p id="EN-US_TOPIC_0125560468__p14823725">Optional</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560468__row2241432115215"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.5.4.2.4.1.1 "><p id="EN-US_TOPIC_0125560468__p7527144324018">x-amz-security-token</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.5.4.2.4.1.2 "><p id="EN-US_TOPIC_0125560468__p19527124310403">Header field used to identify the request of a federated user. When the federal authentication function is enabled, users sending such requests are identified as federated users.</p>
|
|
<p id="EN-US_TOPIC_0125560468__p1852713433401">Type: string</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.5.4.2.4.1.3 "><p id="EN-US_TOPIC_0125560468__p18527843164011">Optional. This parameter must be carried in the request sent by federated users.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560468__section03197424278"><h4 class="sectiontitle">Request Elements</h4><p id="EN-US_TOPIC_0125560468__p1969048">This request uses elements to specify an ACL. <a href="#EN-US_TOPIC_0125560468__table41811761">Table 2</a> describes the elements.</p>
|
|
|
|
<div class="tablenoborder"><a name="EN-US_TOPIC_0125560468__table41811761"></a><a name="table41811761"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0125560468__table41811761" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request elements</caption><thead align="left"><tr id="EN-US_TOPIC_0125560468__row48086049"><th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.6.3.2.4.1.1"><p id="EN-US_TOPIC_0125560468__p2655872">Element</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.6.3.2.4.1.2"><p id="EN-US_TOPIC_0125560468__p13799068">Description</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.6.3.2.4.1.3"><p id="EN-US_TOPIC_0125560468__p43982684">Remarks</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0125560468__row5827624"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560468__p2275561">Owner</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560468__p50102791">Indicates the bucket owner. This element consists of <strong id="EN-US_TOPIC_0125560468__b48271940">ID</strong> and <strong id="EN-US_TOPIC_0125560468__b31794281">DisplayName</strong>.</p>
|
|
<p id="EN-US_TOPIC_0125560468__p17713080">Type: XML</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560468__p25473339">Optional</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560468__row27933467"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560468__p48018363">ID</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560468__p64282175">Indicates the DomainId of a grantee.</p>
|
|
<p id="EN-US_TOPIC_0125560468__p41668666">Type: String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560468__p19718800">Optional</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560468__row43251477"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560468__p13708726">DisplayName</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560468__p36665053">Indicates the name of the grantee.</p>
|
|
<p id="EN-US_TOPIC_0125560468__p61550021">Type: String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560468__p19495789">Optional</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560468__row41244374"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560468__ole_link23">Grant</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560468__p21403714">Container for the grantee and its permission.</p>
|
|
<p id="EN-US_TOPIC_0125560468__p58415703">Type: XML</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560468__p34051537">Optional</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560468__row38028384"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560468__ole_link22">Grantee</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560468__p60583024">Container for the details about the grantee. For details, see <a href="en-us_topic_0125560406.html#EN-US_TOPIC_0125560406__table49181932">Table 1</a>.</p>
|
|
<p id="EN-US_TOPIC_0125560468__p8277894">Type: XML</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560468__p66529714">Optional</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560468__row61896514"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560468__p47561767">Permission</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560468__p27297941">Indicates the permission to be granted. For details, see <a href="en-us_topic_0125560406.html#EN-US_TOPIC_0125560406__table39984204">Table 2</a>.</p>
|
|
<p id="EN-US_TOPIC_0125560468__p63649587">Type: Enumeration</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560468__p55342889">Optional</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560468__row28323957"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560468__p12539171">AccessControlList</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560468__p9039934">Indicates the ACL. This element consists of <strong id="EN-US_TOPIC_0125560468__b14250543">Grant</strong>, <strong id="EN-US_TOPIC_0125560468__b61146029">Grantee</strong>, and <strong id="EN-US_TOPIC_0125560468__b13443352">Permission</strong>.</p>
|
|
<p id="EN-US_TOPIC_0125560468__p53881305">Type: XML</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.6.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560468__p2309545">Optional</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560468__section58709759"><h4 class="sectiontitle">Response Syntax</h4><pre class="screen" id="EN-US_TOPIC_0125560468__screen27991093112950">HTTP/1.1 status_code
|
|
Server: Server Name
|
|
x-amz-request-id: request id
|
|
x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc
|
|
x-amz-id-2: id
|
|
Date: date
|
|
Content-Length: length </pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560468__section58625791"><h4 class="sectiontitle">Response Headers</h4><p id="EN-US_TOPIC_0125560468__p1577564">This response uses common headers. For details about common response headers, see section <a href="en-us_topic_0125560484.html">Common Response Headers</a>.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560468__section57870072"><h4 class="sectiontitle">Response Elements</h4><p id="EN-US_TOPIC_0125560468__p15635128">This response involves no elements.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560468__section51068605"><h4 class="sectiontitle">Error Responses</h4><p id="EN-US_TOPIC_0125560468__p58485875">No special error responses are returned. For details about error responses, see <a href="en-us_topic_0125560440.html#EN-US_TOPIC_0125560440__table30733758">Table 1</a>.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560468__section4238260"><h4 class="sectiontitle">Sample Request for Setting the Bucket ACL</h4><pre class="screen" id="EN-US_TOPIC_0125560468__screen35356303113018">PUT /?acl HTTP/1.1
|
|
User-Agent: Jakarta Commons-HttpClient/3.1
|
|
Host: bucketname.obs.example.com
|
|
Accept-Encoding: gzip,deflate
|
|
Date: Mon, 27 Sep 2010 01:37:17 GMT
|
|
Authorization: AWS 04RZT432N80TGDF2Y2G2:9uNLINAQ7IOIrD9OnCpDfY2R6nU=
|
|
Content-Length: 598
|
|
|
|
<AccessControlPolicy>
|
|
<Owner>
|
|
<ID>bcaf1ffd86f41caff1a493dc2ad8c2c2</ID>
|
|
<DisplayName>user</DisplayName>
|
|
</Owner>
|
|
<AccessControlList>
|
|
<Grant>
|
|
<Grantee xsi:type="CanonicalUser" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
|
<ID>bcaf1ffd86f41caff1a493dc2ad8c2c2</ID>
|
|
<DisplayName>user</DisplayName>
|
|
</Grantee>
|
|
<Permission>READ</Permission>
|
|
</Grant>
|
|
</AccessControlList>
|
|
</AccessControlPolicy> </pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560468__section38144343"><h4 class="sectiontitle">Sample Response for Setting the Bucket ACL</h4><pre class="screen" id="EN-US_TOPIC_0125560468__screen46453748113029">HTTP/1.1 200 OK
|
|
Server: OBS
|
|
x-amz-request-id: 7B6DFC9BC71DD58B061285551605709
|
|
x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc
|
|
x-amz-id-2: N0I2REZDOUJDNzFERDU4QjA2MTI4NTU1MTYwNTcwOUFBQUFBQUFBYmJiYmJiYmJD
|
|
Date: Mon, 27 Sep 2010 01:40:03 GMT
|
|
Content-Length: 0</pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560468__section7754771"><h4 class="sectiontitle">Sample Request for Setting the Bucket ACL Using Headers</h4><pre class="screen" id="EN-US_TOPIC_0125560468__screen23231630113039">PUT /?acl HTTP/1.1
|
|
User-Agent: curl/7.19.0
|
|
Host: bucketname.obs.example.com
|
|
Accept: */*
|
|
Date: Mon, 27 Sep 2010 01:37:17 GMT
|
|
Authorization: AWS 04RZT432N80TGDF2Y2G2:9uNLINAQ7IOIrD9OnCpDfY2R6nU=
|
|
x-amz-acl: private </pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560468__section2684082"><h4 class="sectiontitle">Sample Response for Setting the Bucket ACL Using Headers</h4><pre class="screen" id="EN-US_TOPIC_0125560468__screen19950202113050">HTTP/1.1 200 OK
|
|
Server: OBS
|
|
x-amz-request-id: 7B6DFC9BC71DD58B061285551605709
|
|
x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc
|
|
x-amz-id-2: N0I2REZDOUJDNzFERDU4QjA2MTI4NTU1MTYwNTcwOUFBQUFBQUFBYmJiYmJiYmJD
|
|
Content-Type: application/xml
|
|
Date: Mon, 27 Sep 2010 01:40:03 GMT
|
|
Content-Length: 526</pre>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0125560493.html">Operations on Buckets</a></div>
|
|
</div>
|
|
</div>
|
|
|