Files
doc-exports/docs/obs/tool-obsutil/obs_11_0040.html
weihongmin1 a41a4e0331 OBS Util 0115 Version
Reviewed-by: Sabelnikov, Dmitriy <dmitriy.sabelnikov@t-systems.com>
Co-authored-by: weihongmin1 <weihongmin1@huawei.com>
Co-committed-by: weihongmin1 <weihongmin1@huawei.com>
2026-02-17 10:18:57 +00:00

117 lines
11 KiB
HTML

<a name="obs_11_0040"></a><a name="obs_11_0040"></a>
<h1 class="topictitle1">Setting Bucket Properties</h1>
<div id="body1547106819231"><div class="section" id="obs_11_0040__section1479112110815"><h4 class="sectiontitle">Function</h4><p id="obs_11_0040__p11772825481">You can use this command to set the properties of a bucket, such as storage classes and access policies.</p>
</div>
<div class="section" id="obs_11_0040__section1220752192216"><h4 class="sectiontitle">Command Line Structure</h4><ul id="obs_11_0040__ul832417119303"><li id="obs_11_0040__li19324181113010">In Windows<pre class="screen" id="obs_11_0040__screen69741218113010">obsutil chattri obs://bucket [-sc=xxx] [-acl=xxx] [-aclXml=xxx] [-config=xxx] </pre>
</li><li id="obs_11_0040__li1476086143015">In Linux or macOS<pre class="screen" id="obs_11_0040__screen82451326103012">./obsutil chattri obs://bucket [-sc=xxx] [-acl=xxx] [-aclXml=xxx] [-config=xxx] </pre>
</li></ul>
</div>
<div class="section" id="obs_11_0040__section1474510539439"><h4 class="sectiontitle">Examples</h4><ul id="obs_11_0040__ul18745155374311"><li id="obs_11_0040__li374555312435">Take the Windows OS as an example. Run the <strong id="obs_11_0040__b129741610194715">obsutil chattri obs://bucket-test -acl=private</strong> command to change the access control policy of the bucket to private read and write.<pre class="screen" id="obs_11_0040__screen15745953174312"><strong id="obs_11_0040__b117461553164317">obsutil chattri obs://bucket-test -acl=private</strong>
Start at 2024-09-29 07:58:46.0506904 +0000 UTC
Set the acl of bucket [bucket-test] to [private] successfully, request id [04050000016836C5DA6FB21F14A2A0C0]</pre>
</li></ul>
</div>
<div class="section" id="obs_11_0040__section6559191102418"><h4 class="sectiontitle">Parameter Description</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="obs_11_0040__table10831182114445" frame="border" border="1" rules="all"><thead align="left"><tr id="obs_11_0040__row683212154419"><th align="left" class="cellrowborder" valign="top" width="17.82178217821782%" id="mcps1.3.4.2.1.4.1.1"><p id="obs_11_0040__p118329219446">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25.742574257425744%" id="mcps1.3.4.2.1.4.1.2"><p id="obs_11_0040__p15137125919108">Optional or Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="56.43564356435643%" id="mcps1.3.4.2.1.4.1.3"><p id="obs_11_0040__p12832121184414">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="obs_11_0040__row108328217449"><td class="cellrowborder" valign="top" width="17.82178217821782%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0040__p64495172515">bucket</p>
</td>
<td class="cellrowborder" valign="top" width="25.742574257425744%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0040__p154316502519">Mandatory</p>
</td>
<td class="cellrowborder" valign="top" width="56.43564356435643%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0040__p17425512259">The bucket name</p>
</td>
</tr>
<tr id="obs_11_0040__row8533319194211"><td class="cellrowborder" valign="top" width="17.82178217821782%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0040__p19533119154211">sc</p>
</td>
<td class="cellrowborder" valign="top" width="25.742574257425744%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0040__p4533191944218">Optional (additional parameter)</p>
</td>
<td class="cellrowborder" valign="top" width="56.43564356435643%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0040__p86547153813">The default storage class of the bucket. Possible values are:</p>
<ul id="obs_11_0040__ul175651814214"><li id="obs_11_0040__li1256512172114"><strong id="obs_11_0040__b7961723191118">standard</strong>: Standard storage class. It features low access latency and high throughput, and is applicable to storing frequently accessed data (multiple accesses per month) or data that is smaller than 1 MB.</li><li id="obs_11_0040__li10565181142113"><strong id="obs_11_0040__b4475458112310">warm</strong>: Warm storage class. It is ideal for storing infrequently accessed (less than 12 times a year) data, but when needed, the access has to be fast.</li><li id="obs_11_0040__li756616110216"><strong id="obs_11_0040__b457212172410">cold</strong>: Cold storage class. It provides secure, durable, and inexpensive storage for rarely-accessed (once a year) data.</li></ul>
</td>
</tr>
<tr id="obs_11_0040__row184781221162513"><td class="cellrowborder" valign="top" width="17.82178217821782%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0040__p12478192122514">acl</p>
</td>
<td class="cellrowborder" valign="top" width="25.742574257425744%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0040__p82428286353">Optional (additional parameter)</p>
</td>
<td class="cellrowborder" valign="top" width="56.43564356435643%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0040__p16811512123619">The predefined access control policy of the bucket. Possible values are:</p>
<ul id="obs_11_0040__ul1273864144412"><li id="obs_11_0040__li17738649445">private</li><li id="obs_11_0040__li1551213137447">public-read</li><li id="obs_11_0040__li1287691813449">public-read-write</li></ul>
<div class="note" id="obs_11_0040__note1790113183525"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="obs_11_0040__p92982882916">The preceding three values indicate private read and write, public read, and public read and write.</p>
</div></div>
</td>
</tr>
<tr id="obs_11_0040__row25713416178"><td class="cellrowborder" valign="top" width="17.82178217821782%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0040__p1258123413176">aclXml</p>
</td>
<td class="cellrowborder" valign="top" width="25.742574257425744%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0040__p75818346179">Optional (additional parameter)</p>
</td>
<td class="cellrowborder" valign="top" width="56.43564356435643%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0040__p2058173418170">The bucket's access control policy, in XML format</p>
<pre class="screen" id="obs_11_0040__screen78378416219">&lt;AccessControlPolicy&gt;
&lt;Owner&gt;
&lt;ID&gt;<em id="obs_11_0040__i131811237783">ownerid</em>&lt;/ID&gt;
&lt;/Owner&gt;
&lt;AccessControlList&gt;
&lt;Grant&gt;
&lt;Grantee&gt;
&lt;ID&gt;<em id="obs_11_0040__i20604651896">userid</em>&lt;/ID&gt;
&lt;/Grantee&gt;
&lt;Permission&gt;<em id="obs_11_0040__i786413238102">[WRITE|WRITE_ACP|<em id="obs_11_0040__i198641723191017">READ</em>|READ_ACP|FULL_CONTROL]</em>&lt;/Permission&gt;
&lt;/Grant&gt;
&lt;Grant&gt;
&lt;Grantee&gt;
&lt;Canned&gt;Everyone&lt;/Canned&gt;
&lt;/Grantee&gt;
&lt;Permission&gt;<em id="obs_11_0040__i287517813170">[WRITE|WRITE_ACP|<em id="obs_11_0040__i18751384176">READ</em>|READ_ACP|FULL_CONTROL]</em>&lt;/Permission&gt;
&lt;/Grant&gt;
&lt;/AccessControlList&gt;
&lt;/AccessControlPolicy&gt;</pre>
<div class="note" id="obs_11_0040__note8740143916331"><span class="notetitle"> NOTE: </span><div class="notebody"><ul id="obs_11_0040__ul11591446103319"><li id="obs_11_0040__li478395773216"><strong id="obs_11_0040__b12293102015418">Owner</strong>: Optional. Specify the bucket owner's ID.</li><li id="obs_11_0040__li1867895491914">In <strong id="obs_11_0040__b139036161165">AccessControlList</strong>, the <strong id="obs_11_0040__b1856172415618">Grant</strong> field contains the authorized users. <strong id="obs_11_0040__b1515515681315">Grantee</strong> specifies the IDs of authorized users. <strong id="obs_11_0040__b129881752101320">Canned</strong> specifies the authorized user group (currently, only <strong id="obs_11_0040__b8965141115154">Everyone</strong> is supported).</li><li id="obs_11_0040__li1359646143317">The following permissions can be granted: WRITE (write), WRITE_ACP (write ACL), READ (read), READ_ACP (read ACL), and FULL_CONTROL (full control).</li></ul>
</div></div>
<div class="notice" id="obs_11_0040__note14101733103315"><span class="noticetitle"> NOTICE: </span><div class="noticebody"><p id="obs_11_0040__p11101733143314">Because angle brackets (&lt;) and (&gt;) are unavoidably included in the parameter value, you must use quotation marks to enclose them for escaping when running the command. Use single quotation marks for Linux or macOS and double quotation marks for Windows.</p>
</div></div>
</td>
</tr>
<tr id="obs_11_0040__row16869111501016"><td class="cellrowborder" valign="top" width="17.82178217821782%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0040__p114391014518">bucket-cname</p>
</td>
<td class="cellrowborder" valign="top" width="25.742574257425744%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0040__p4143210950">Optional (additional parameter)</p>
</td>
<td class="cellrowborder" valign="top" width="56.43564356435643%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0040__p16143610251">The user-defined domain name bound to the bucket</p>
<div class="note" id="obs_11_0040__note16256574591"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="obs_11_0040__p172595719595">This parameter is only supported by obsutil 5.7.9 and later.</p>
</div></div>
</td>
</tr>
<tr id="obs_11_0040__row10314444123413"><td class="cellrowborder" valign="top" width="17.82178217821782%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0040__p153951131317">config</p>
</td>
<td class="cellrowborder" valign="top" width="25.742574257425744%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0040__p12395135316">Optional (additional parameter)</p>
</td>
<td class="cellrowborder" valign="top" width="56.43564356435643%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0040__obs_11_0008_p1750111452317">The user-defined configuration file for executing the current command. For details about parameters that can be configured, see <a href="obs_11_0035.html">Configuration Parameters</a>.</p>
</td>
</tr>
<tr id="obs_11_0040__row1776913109551"><td class="cellrowborder" valign="top" width="17.82178217821782%" headers="mcps1.3.4.2.1.4.1.1 "><p id="obs_11_0040__p1966666191820">payer</p>
</td>
<td class="cellrowborder" valign="top" width="25.742574257425744%" headers="mcps1.3.4.2.1.4.1.2 "><p id="obs_11_0040__p1266611611820">Optional (additional parameter)</p>
</td>
<td class="cellrowborder" valign="top" width="56.43564356435643%" headers="mcps1.3.4.2.1.4.1.3 "><p id="obs_11_0040__p1166617619181">Specifies that requester pays is enabled.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="note" id="obs_11_0040__note9451165461719"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="obs_11_0040__p645225451720">Only one from <strong id="obs_11_0040__b11104031134216">sc</strong>, <strong id="obs_11_0040__b116261337164217">acl</strong>, or <strong id="obs_11_0040__b13502194254211">aclXml</strong> can be set for each command.</p>
</div></div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="obs_11_0007.html">Bucket Commands</a></div>
</div>
</div>