forked from docs/doc-exports
Reviewed-by: gtema <artem.goncharov@gmail.com> Co-authored-by: Jawei, Li <lijiawei5@huawei.com> Co-committed-by: Jawei, Li <lijiawei5@huawei.com>
110 lines
7.3 KiB
HTML
110 lines
7.3 KiB
HTML
<a name="obs_04_0044"></a><a name="obs_04_0044"></a>
|
|
|
|
<h1 class="topictitle1">Configuring Storage Class for a Bucket</h1>
|
|
<div id="body40250789"><div class="section" id="obs_04_0044__section5584184924715"><h4 class="sectiontitle">Functions</h4><p class="msonormal" id="obs_04_0044__p28207758">This operation sets or updates the default storage class of a bucket.</p>
|
|
<p class="msonormal" id="obs_04_0044__p52543238">To perform this operation, you must have the <strong id="obs_04_0044__b49121730191213">PutBucketStoragePolicy</strong> permission. By default, only the bucket owner can perform this operation. The bucket owner can grant the permission to other users by configuring the bucket policy or user policy.</p>
|
|
<p class="msonormal" id="obs_04_0044__p3127100">After the default storage class has been set for a bucket, if the storage class of an object is not specified during uploading, copying, or initialization of multi-part upload, the object storage class is the same as the default storage class of the bucket.</p>
|
|
<p class="msonormal" id="obs_04_0044__p28143905">The default storage class of a bucket is Standard.</p>
|
|
</div>
|
|
<div class="section" id="obs_04_0044__section51968558"><h4 class="sectiontitle">Request Syntax</h4><div class="codecoloring" codetype="Xml" id="obs_04_0044__screen39088442"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
|
|
2
|
|
3
|
|
4
|
|
5
|
|
6
|
|
7
|
|
8
|
|
9</pre></div></td><td class="code"><div class="highlight"><pre><span></span>PUT /?storageClass HTTP/1.1
|
|
Host: bucketname.obs.region.example.com
|
|
Date: date
|
|
Content-Type: type
|
|
Content-Length: length
|
|
Authorization: authorization
|
|
|
|
<span class="cp"><?xml version="1.0" encoding="UTF-8" standalone="yes"?></span>
|
|
<span class="nt"><StorageClass</span> <span class="na">xmlns=</span><span class="s">"http://obs.example.com/doc/2015-06-30/"</span><span class="nt">></span>STANDARD<span class="nt"></StorageClass></span>
|
|
</pre></div>
|
|
</td></tr></table></div>
|
|
</div>
|
|
<div class="section" id="obs_04_0044__section65063845"><h4 class="sectiontitle">Request Parameters</h4><p class="msonormal" id="obs_04_0044__p55085767">This request contains no parameter.</p>
|
|
</div>
|
|
<div class="section" id="obs_04_0044__section48703693"><h4 class="sectiontitle">Request Headers</h4><p class="msonormal" id="obs_04_0044__p32762156">This request uses common headers. For details, see <a href="obs_04_0007.html#obs_04_0007__table25197309">Table 3</a>.</p>
|
|
</div>
|
|
<div class="section" id="obs_04_0044__section35680056"><h4 class="sectiontitle">Request Elements</h4><p class="msonormal" id="obs_04_0044__p59965233">This request needs an additional element to specify the default bucket storage class. For details, see <a href="#obs_04_0044__table63485364">Table 1</a>.</p>
|
|
|
|
<div class="tablenoborder"><a name="obs_04_0044__table63485364"></a><a name="table63485364"></a><table cellpadding="4" cellspacing="0" summary="" id="obs_04_0044__table63485364" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Additional request elements</caption><thead align="left"><tr id="obs_04_0044__row22124494"><th align="left" class="cellrowborder" valign="top" width="26%" id="mcps1.3.5.3.2.4.1.1"><p id="obs_04_0044__p47253610">Element</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="51%" id="mcps1.3.5.3.2.4.1.2"><p id="obs_04_0044__p21035120">Description</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="23%" id="mcps1.3.5.3.2.4.1.3"><p id="obs_04_0044__p33781546">Mandatory</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="obs_04_0044__row64903084"><td class="cellrowborder" valign="top" width="26%" headers="mcps1.3.5.3.2.4.1.1 "><p id="obs_04_0044__p22658476">StorageClass</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="51%" headers="mcps1.3.5.3.2.4.1.2 "><p id="obs_04_0044__p23397285">Specifies the default storage class for a bucket.</p>
|
|
<p id="obs_04_0044__p4701910132510">Type: string</p>
|
|
<p id="obs_04_0044__p78072113256">Value options: STANDARD | WARM | COLD</p>
|
|
<p id="obs_04_0044__p15884183444011">There are three storage classes: STANDARD (Standard storage class), WARM (Warm storage class), and COLD (Cold storage class) Therefore, the following values can be configured: <strong id="obs_04_0044__b1849874575">STANDARD</strong>, <strong id="obs_04_0044__b1532141983">WARM</strong>, and <strong id="obs_04_0044__b15168843">COLD</strong>.</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.5.3.2.4.1.3 "><p id="obs_04_0044__p10969390">Yes</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="obs_04_0044__section52685056"><h4 class="sectiontitle">Response Syntax</h4><div class="codecoloring" codetype="Xml" id="obs_04_0044__screen16105370"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
|
|
2</pre></div></td><td class="code"><div class="highlight"><pre><span></span>HTTP/1.1 status_code
|
|
Date: date
|
|
</pre></div>
|
|
</td></tr></table></div>
|
|
</div>
|
|
<div class="section" id="obs_04_0044__section4403461"><h4 class="sectiontitle">Response Headers</h4><p class="msonormal" id="obs_04_0044__p1512332591013">The response to the request uses common headers. For details, see <a href="obs_04_0013.html#obs_04_0013__d0e686">Table 1</a>.</p>
|
|
</div>
|
|
<div class="section" id="obs_04_0044__section39631152"><h4 class="sectiontitle">Response Elements</h4><p class="msonormal" id="obs_04_0044__p56965307">This response involves no elements.</p>
|
|
</div>
|
|
<div class="section" id="obs_04_0044__section21136050"><h4 class="sectiontitle">Error Responses</h4><p class="msonormal" id="obs_04_0044__p50787178">No special error responses are involved. For details about error responses, see <a href="obs_04_0115.html#obs_04_0115__d0e843">Table 2</a>.</p>
|
|
</div>
|
|
<div class="section" id="obs_04_0044__section14482163815396"><h4 class="sectiontitle">Sample Request</h4><div class="codecoloring" codetype="Xml" id="obs_04_0044__screen8484163863919"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
|
|
2
|
|
3
|
|
4
|
|
5
|
|
6
|
|
7
|
|
8
|
|
9</pre></div></td><td class="code"><div class="highlight"><pre><span></span>PUT /?storageClass HTTP/1.1
|
|
User-Agent: curl/7.29.0
|
|
Host: examplebucket.obs.region.example.com
|
|
Accept: */*
|
|
Date: WED, 01 Jul 2015 03:18:19 GMT
|
|
Authorization: OBS H4IPJX0TQTHTHEBQQCEC:Tf6XbndPx/yNgfAVQ6KIXr7tMj4=
|
|
Content-Length: 87
|
|
|
|
<span class="nt"><StorageClass</span> <span class="na">xmlns=</span><span class="s">"http://obs.example.com/doc/2015-06-30/"</span><span class="nt">></span>STANDARD<span class="nt"></StorageClass></span>
|
|
</pre></div>
|
|
</td></tr></table></div>
|
|
</div>
|
|
<div class="section" id="obs_04_0044__section76081155815"><h4 class="sectiontitle">Sample Response</h4><div class="codecoloring" codetype="Xml" id="obs_04_0044__screen8485113814"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
|
|
2
|
|
3
|
|
4
|
|
5
|
|
6</pre></div></td><td class="code"><div class="highlight"><pre><span></span>HTTP/1.1 200 OK
|
|
Server: OBS
|
|
x-obs-request-id: BF2600000164368E704B571F328A8797
|
|
x-obs-id-2: 32AAAQAAEAABSAAgAAEAABAAAQAAEAABCSIsw3tPtUn6damTI5acQmQAcEfmTwl3
|
|
Date: WED, 01 Jul 2015 03:18:19 GMT
|
|
Content-Length: 0
|
|
</pre></div>
|
|
</td></tr></table></div>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="obs_04_0026.html">Advanced Bucket Settings</a></div>
|
|
</div>
|
|
</div>
|
|
|