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>
127 lines
7.7 KiB
HTML
127 lines
7.7 KiB
HTML
<a name="obs_04_0054"></a><a name="obs_04_0054"></a>
|
|
|
|
<h1 class="topictitle1">Querying Information About Used Space in a Bucket</h1>
|
|
<div id="body39746667"><div class="section" id="obs_04_0054__section5584184924715"><h4 class="sectiontitle">Functions</h4><p class="msonormal" id="obs_04_0054__p62746235">This operation queries the number of bucket objects and the space occupied by the objects. The size of the object space is a positive integer, measured by bytes.</p>
|
|
<div class="note" id="obs_04_0054__note18662132495916"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="obs_04_0054__p86624244591">The OBS bucket storage statistics is measured in the background, and the storage data is not updated in real time. Therefore, you are not advised to perform real-time verification on the storage information.</p>
|
|
</div></div>
|
|
</div>
|
|
<div class="section" id="obs_04_0054__section27845207"><h4 class="sectiontitle">Request Syntax</h4><div class="codecoloring" codetype="Xml" id="obs_04_0054__screen65363495"><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 /?storageinfo 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_0054__section49280276"><h4 class="sectiontitle">Request Parameters</h4><p class="msonormal" id="obs_04_0054__p58623360">This request contains no parameters.</p>
|
|
</div>
|
|
<div class="section" id="obs_04_0054__section40869308"><h4 class="sectiontitle">Request Headers</h4><p class="msonormal" id="obs_04_0054__p50871738">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_0054__section32279454"><h4 class="sectiontitle">Request Elements</h4><p class="msonormal" id="obs_04_0054__p41404348">This request contains no elements.</p>
|
|
</div>
|
|
<div class="section" id="obs_04_0054__section22079637"><h4 class="sectiontitle">Response Syntax</h4><div class="codecoloring" codetype="Xml" id="obs_04_0054__screen65417916"><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>HTTP/1.1 status_code
|
|
Date: date
|
|
Content-Type: type
|
|
Content-Length: length
|
|
<span class="cp"><?xml version="1.0" encoding="UTF-8" standalone="yes"?></span>
|
|
<span class="nt"><GetBucketStorageInfoResult</span> <span class="na">xmlns=</span><span class="s">"http://obs.region.example.com/doc/2015-06-30/"</span><span class="nt">></span>
|
|
<span class="nt"><Size></span>size<span class="nt"></Size></span>
|
|
<span class="nt"><ObjectNumber></span>number<span class="nt"></ObjectNumber></span>
|
|
<span class="nt"></GetBucketStorageInfoResult></span>
|
|
</pre></div>
|
|
</td></tr></table></div>
|
|
</div>
|
|
<div class="section" id="obs_04_0054__section64499009"><h4 class="sectiontitle">Response Headers</h4><p class="msonormal" id="obs_04_0054__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_0054__section43620171"><h4 class="sectiontitle">Response Elements</h4><p class="msonormal" id="obs_04_0054__p10091901">This response contains elements of information about the used storage capacity of a bucket. <a href="#obs_04_0054__table4057783695910">Table 1</a> describes the elements.</p>
|
|
|
|
<div class="tablenoborder"><a name="obs_04_0054__table4057783695910"></a><a name="table4057783695910"></a><table cellpadding="4" cellspacing="0" summary="" id="obs_04_0054__table4057783695910" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Response elements</caption><thead align="left"><tr id="obs_04_0054__row66246136"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.8.3.2.3.1.1"><p id="obs_04_0054__p64336831">Element</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.8.3.2.3.1.2"><p id="obs_04_0054__p59562751">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="obs_04_0054__row1810620"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.8.3.2.3.1.1 "><p id="obs_04_0054__p12442532">GetBucketStorageInfoResult</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.8.3.2.3.1.2 "><p id="obs_04_0054__p1212185">Request result that saves bucket storage information, including the stored data size and the number of objects</p>
|
|
<p id="obs_04_0054__p10909667">Type: XML</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0054__row31078146"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.8.3.2.3.1.1 "><p id="obs_04_0054__p34301896">Size</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.8.3.2.3.1.2 "><p id="obs_04_0054__p26990162">Size of stored data</p>
|
|
<p id="obs_04_0054__p41584868">Type: integer</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0054__row38719496"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.8.3.2.3.1.1 "><p id="obs_04_0054__p49271508">ObjectNumber</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.8.3.2.3.1.2 "><p id="obs_04_0054__p31569179">Number of objects returned</p>
|
|
<p id="obs_04_0054__p15687161">Type: integer</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="obs_04_0054__section57037220"><h4 class="sectiontitle">Error Responses</h4><p class="msonormal" id="obs_04_0054__p62700551">No special error responses are returned. 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_0054__section14482163815396"><h4 class="sectiontitle">Sample Request</h4><div class="codecoloring" codetype="Xml" id="obs_04_0054__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 /?storageinfo HTTP/1.1
|
|
User-Agent: curl/7.29.0
|
|
Host: examplebucket.obs.region.example.com
|
|
Accept: */*
|
|
Date: WED, 01 Jul 2015 03:31:18 GMT
|
|
Authorization: OBS H4IPJX0TQTHTHEBQQCEC:bLcdeJGYWw/eEEjMhPZx2MK5R9U=
|
|
</pre></div>
|
|
</td></tr></table></div>
|
|
</div>
|
|
<div class="section" id="obs_04_0054__section76081155815"><h4 class="sectiontitle">Sample Response</h4><div class="codecoloring" codetype="Xml" id="obs_04_0054__screen8485113814"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
|
|
2
|
|
3
|
|
4
|
|
5
|
|
6
|
|
7
|
|
8
|
|
9
|
|
10
|
|
11
|
|
12
|
|
13</pre></div></td><td class="code"><div class="highlight"><pre><span></span>HTTP/1.1 200 OK
|
|
Server: OBS
|
|
x-obs-request-id: BF260000016435DD2958BFDCDB86B55E
|
|
x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSitZctaPYVnat49fVMd1O+OWIP1yrg3
|
|
Content-Type: application/xml
|
|
WED, 01 Jul 2015 03:31:18 GMT
|
|
Content-Length: 206
|
|
|
|
<span class="cp"><?xml version="1.0" encoding="UTF-8" standalone="yes"?></span>
|
|
<span class="nt"><GetBucketStorageInfoResult</span> <span class="na">xmlns=</span><span class="s">"http://obs.example.com/doc/2015-06-30/"</span><span class="nt">></span>
|
|
<span class="nt"><Size></span>25490<span class="nt"></Size></span>
|
|
<span class="nt"><ObjectNumber></span>24<span class="nt"></ObjectNumber></span>
|
|
<span class="nt"></GetBucketStorageInfoResult></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>
|
|
|