doc-exports/docs/obs/api-ref/obs_04_0045.html
Jawei, Li f1cb839979 OBS api-ref 2.0.38.SP5
Reviewed-by: gtema <artem.goncharov@gmail.com>
Co-authored-by: Jawei, Li <lijiawei5@huawei.com>
Co-committed-by: Jawei, Li <lijiawei5@huawei.com>
2022-11-03 11:54:51 +00:00

108 lines
6.4 KiB
HTML

<a name="obs_04_0045"></a><a name="obs_04_0045"></a>
<h1 class="topictitle1">Obtaining Bucket Storage Class Information</h1>
<div id="body43449146"><div class="section" id="obs_04_0045__section5584184924715"><h4 class="sectiontitle">Functions</h4><p class="msonormal" id="obs_04_0045__p37754258">This operation obtains the default storage class of a bucket.</p>
<p class="msonormal" id="obs_04_0045__p4244010">To perform this operation, you must have the <strong id="obs_04_0045__b20477163881416">GetBucketStoragePolicy</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>
</div>
<div class="section" id="obs_04_0045__section38196091"><h4 class="sectiontitle">Request Syntax</h4><div class="codecoloring" codetype="Xml" id="obs_04_0045__screen29719926"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
2
3
4</pre></div></td><td class="code"><div class="highlight"><pre><span></span>GET /?storageClass HTTP/1.1
Host: bucketname.obs.region.example.com
Date: date
Authorization: authorization
</pre></div>
</td></tr></table></div>
</div>
<div class="section" id="obs_04_0045__section8220504"><h4 class="sectiontitle">Request Parameters</h4><p class="msonormal" id="obs_04_0045__p35116889">This request contains no parameter.</p>
</div>
<div class="section" id="obs_04_0045__section6875672"><h4 class="sectiontitle">Request Headers</h4><p class="msonormal" id="obs_04_0045__p25895747">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_0045__section61881054"><h4 class="sectiontitle">Request Elements</h4><p class="msonormal" id="obs_04_0045__p20409315">This request contains no elements.</p>
</div>
<div class="section" id="obs_04_0045__section20058578"><h4 class="sectiontitle">Response Syntax</h4><div class="codecoloring" codetype="Xml" id="obs_04_0045__screen42541842"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
2
3
4
5
6
7
8</pre></div></td><td class="code"><div class="highlight"><pre><span></span>HTTP/1.1 status_code
Date: date
Content-Type: type
Content-Length: length
<span class="cp">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;</span>
<span class="nt">&lt;StorageClass</span> <span class="na">xmlns=</span><span class="s">&quot;http://obs.example.com/doc/2015-06-30/&quot;</span><span class="nt">&gt;</span>STANDARD<span class="nt">&lt;/StorageClass&gt;</span>
</pre></div>
</td></tr></table></div>
</div>
<div class="section" id="obs_04_0045__section46309477"><h4 class="sectiontitle">Response Headers</h4><p class="msonormal" id="obs_04_0045__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_0045__section14132112"><h4 class="sectiontitle">Response Elements</h4><p class="msonormal" id="obs_04_0045__p58876432">This response contains elements to provide details about the storage class information of a bucket. <a href="#obs_04_0045__d0e9764">Table 1</a> describes the elements.</p>
<div class="tablenoborder"><a name="obs_04_0045__d0e9764"></a><a name="d0e9764"></a><table cellpadding="4" cellspacing="0" summary="" id="obs_04_0045__d0e9764" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Response elements</caption><thead align="left"><tr id="obs_04_0045__row62282452"><th align="left" class="cellrowborder" valign="top" width="39.39%" id="mcps1.3.8.3.2.3.1.1"><p id="obs_04_0045__p11713852">Element</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="60.61%" id="mcps1.3.8.3.2.3.1.2"><p id="obs_04_0045__p16572859">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="obs_04_0045__row66017644"><td class="cellrowborder" valign="top" width="39.39%" headers="mcps1.3.8.3.2.3.1.1 "><p id="obs_04_0045__p45828915">StorageClass</p>
</td>
<td class="cellrowborder" valign="top" width="60.61%" headers="mcps1.3.8.3.2.3.1.2 "><p id="obs_04_0045__p21154655">Default storage class of the bucket.</p>
<p id="obs_04_0045__p56174175">Type: string. For details about the enumeration type, see <a href="obs_04_0044.html#obs_04_0044__table63485364">Table 1</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="obs_04_0045__section60080148"><h4 class="sectiontitle">Error Responses</h4><p class="msonormal" id="obs_04_0045__p14566661">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_0045__section14482163815396"><h4 class="sectiontitle">Sample Request</h4><div class="codecoloring" codetype="Xml" id="obs_04_0045__screen8484163863919"><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>GET /?storageClass HTTP/1.1
User-Agent: curl/7.29.0
Host: examplebucket.obs.region.example.com
Accept: */*
Date: WED, 01 Jul 2015 03:20:28 GMT
Authorization: OBS H4IPJX0TQTHTHEBQQCEC:0zVTSdKG6OFCIH2dKvmsVGYCQyw=
</pre></div>
</td></tr></table></div>
</div>
<div class="section" id="obs_04_0045__section76081155815"><h4 class="sectiontitle">Sample Response</h4><div class="codecoloring" codetype="Xml" id="obs_04_0045__screen8485113814"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
2
3
4
5
6
7
8
9
10
11</pre></div></td><td class="code"><div class="highlight"><pre><span></span>HTTP/1.1 200 OK
Server: OBS
x-obs-request-id: BF260000016436BE45820FDF3A65B42C
x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSCju1CZy3ZfRVW5hiNd024lRFdUoqWy
Content-Type: application/xml
Date: WED, 01 Jul 2015 03:20:28 GMT
Content-Length: 142
<span class="cp">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;</span>
<span class="nt">&lt;StorageClass</span> <span class="na">xmlns=</span><span class="s">&quot;http://obs.example.com/doc/2015-06-30/&quot;</span><span class="nt">&gt;</span>STANDARD<span class="nt">&lt;/StorageClass&gt;</span>
</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>