doc-exports/docs/obs/api-ref/obs_04_0052.html
zhangyue d5b1108742 OBS API DOC
Reviewed-by: Sabelnikov, Dmitriy <dmitriy.sabelnikov@t-systems.com>
Co-authored-by: zhangyue <zhangyue164@huawei.com>
Co-committed-by: zhangyue <zhangyue164@huawei.com>
2023-10-16 12:27:49 +00:00

121 lines
9.9 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<a name="obs_04_0052"></a><a name="obs_04_0052"></a>
<h1 class="topictitle1">Configuring Bucket Storage Quota</h1>
<div id="body23313325"><div class="section" id="obs_04_0052__section5584184924715"><h4 class="sectiontitle">Functions</h4><p class="msonormal" id="obs_04_0052__p9425979">The bucket storage quota must be a positive integer in the unit of byte. The maximum storage quota is 2<sup id="obs_04_0052__sup9937516203">63</sup> 1 bytes. The default bucket storage quota is <strong id="obs_04_0052__b1044613415218">0</strong>, indicating that the bucket storage quota is not limited.</p>
<div class="note" id="obs_04_0052__note4648161119316"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ol id="obs_04_0052__ol1321716570337"><li id="obs_04_0052__li4981114348">For a bucket that has a specified storage quota, you can change the quota to <strong id="obs_04_0052__b1442801115154">0</strong> to cancel the quota limitation.</li><li id="obs_04_0052__li1721825710336">The bucket storage quota verification depends on how much space is used in the bucket. However, the used storage space is measured at the background. Therefore, bucket storage quotas may not take effect immediately, and delay is expected. The used storage space in a bucket may exceed the bucket storage quota, or the used storage space may remain unchanged after data is deleted from the bucket.</li><li id="obs_04_0052__li2645943203614">For details about the API for querying used storage space, see <a href="obs_04_0054.html">Obtaining Storage Information of a Bucket</a>.</li><li id="obs_04_0052__li2923356183715">If the used storage space in a bucket reaches the upper limit of the bucket storage quota, object upload will fail and the HTTP status code 403 Forbidden will be returned, indicating <strong id="obs_04_0052__b17583163752310">InsufficientStorageSpace</strong>. In this case, you can increase the quota, cancel the quota limitation (by changing the quota to <strong id="obs_04_0052__b15783254162411">0</strong>), or delete unwanted objects from the bucket.</li></ol>
</div></div>
</div>
<div class="section" id="obs_04_0052__section17724952"><h4 class="sectiontitle">Request Syntax</h4><div class="codecoloring" codetype="Xml" id="obs_04_0052__screen16871698"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
<span class="normal"> 2</span>
<span class="normal"> 3</span>
<span class="normal"> 4</span>
<span class="normal"> 5</span>
<span class="normal"> 6</span>
<span class="normal"> 7</span>
<span class="normal"> 8</span>
<span class="normal"> 9</span>
<span class="normal">10</span></pre></div></td><td class="code"><div><pre><span></span>PUT<span class="w"> </span>/?quota<span class="w"> </span>HTTP/1.1<span class="w"> </span>
Host:<span class="w"> </span>bucketname.obs.region.example.com
Date:<span class="w"> </span>date
Content-Length:<span class="w"> </span>length
Authorization:<span class="w"> </span>authorization
<span class="cp">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;</span><span class="w"> </span>
<span class="nt">&lt;Quota</span><span class="w"> </span><span class="na">xmlns=</span><span class="s">&quot;http://obs.region.example.com/doc/2015-06-30/&quot;</span><span class="nt">&gt;</span>
<span class="w"> </span><span class="nt">&lt;StorageQuota&gt;</span>value<span class="nt">&lt;/StorageQuota&gt;</span><span class="w"> </span>
<span class="nt">&lt;/Quota&gt;</span>
</pre></div></td></tr></table></div>
</div>
</div>
<div class="section" id="obs_04_0052__section25306841"><h4 class="sectiontitle">Request Parameters</h4><p class="msonormal" id="obs_04_0052__p60638928">This request contains no parameters.</p>
</div>
<div class="section" id="obs_04_0052__section26434985"><h4 class="sectiontitle">Request Headers</h4><p class="msonormal" id="obs_04_0052__p12806110">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_0052__section36588280"><h4 class="sectiontitle">Request Elements</h4><p class="msonormal" id="obs_04_0052__p7522152">This request uses an additional element to specify a bucket quota. <a href="#obs_04_0052__table32716508105325">Table 1</a> describes the element.</p>
<div class="tablenoborder"><a name="obs_04_0052__table32716508105325"></a><a name="table32716508105325"></a><table cellpadding="4" cellspacing="0" summary="" id="obs_04_0052__table32716508105325" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Additional request elements</caption><thead align="left"><tr id="obs_04_0052__row45688556"><th align="left" class="cellrowborder" valign="top" width="34.69%" id="mcps1.3.5.3.2.4.1.1"><p id="obs_04_0052__p9785517">Element</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="41.839999999999996%" id="mcps1.3.5.3.2.4.1.2"><p id="obs_04_0052__p20102617">Description</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="23.47%" id="mcps1.3.5.3.2.4.1.3"><p id="obs_04_0052__p25076148">Mandatory</p>
</th>
</tr>
</thead>
<tbody><tr id="obs_04_0052__row26901352"><td class="cellrowborder" valign="top" width="34.69%" headers="mcps1.3.5.3.2.4.1.1 "><p id="obs_04_0052__p31525899">StorageQuota</p>
</td>
<td class="cellrowborder" valign="top" width="41.839999999999996%" headers="mcps1.3.5.3.2.4.1.2 "><p id="obs_04_0052__p3461035">Specifies the bucket storage quota. The unit is byte.</p>
<p id="obs_04_0052__p31149317">Type: integer</p>
</td>
<td class="cellrowborder" valign="top" width="23.47%" headers="mcps1.3.5.3.2.4.1.3 "><p id="obs_04_0052__p40066730">Yes</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="obs_04_0052__section60859072"><h4 class="sectiontitle">Response Syntax</h4><div class="codecoloring" codetype="Xml" id="obs_04_0052__screen24179712"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span>HTTP/1.1<span class="w"> </span>status_code
Date:<span class="w"> </span>date
Content-Length:<span class="w"> </span>length
</pre></div></td></tr></table></div>
</div>
</div>
<div class="section" id="obs_04_0052__section10860736"><h4 class="sectiontitle">Response Headers</h4><p class="msonormal" id="obs_04_0052__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_0052__section30637762"><h4 class="sectiontitle">Response Elements</h4><p class="msonormal" id="obs_04_0052__p23768554">This response involves no elements.</p>
</div>
<div class="section" id="obs_04_0052__section7304408"><h4 class="sectiontitle">Error Responses</h4><p class="msonormal" id="obs_04_0052__p46204722">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_0052__section14482163815396"><h4 class="sectiontitle">Sample Request</h4><div class="codecoloring" codetype="Xml" id="obs_04_0052__screen8484163863919"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
<span class="normal"> 2</span>
<span class="normal"> 3</span>
<span class="normal"> 4</span>
<span class="normal"> 5</span>
<span class="normal"> 6</span>
<span class="normal"> 7</span>
<span class="normal"> 8</span>
<span class="normal"> 9</span>
<span class="normal">10</span>
<span class="normal">11</span></pre></div></td><td class="code"><div><pre><span></span>PUT<span class="w"> </span>/?quota<span class="w"> </span>HTTP/1.1
User-Agent:<span class="w"> </span>curl/7.29.0
Host:<span class="w"> </span>examplebucket.obs.region.example.com
Accept:<span class="w"> </span>*/*
Date:<span class="w"> </span>WED,<span class="w"> </span>01<span class="w"> </span>Jul<span class="w"> </span>2015<span class="w"> </span>03:24:37<span class="w"> </span>GMT
Authorization:<span class="w"> </span>OBS<span class="w"> </span>H4IPJX0TQTHTHEBQQCEC:k/rbwnYaqYf0Ae6F0M3OJQ0dmI8=
Content-Length:<span class="w"> </span>106
<span class="nt">&lt;Quota</span><span class="w"> </span><span class="na">xmlns=</span><span class="s">&quot;http://obs.region.example.com/doc/2015-06-30/&quot;</span><span class="nt">&gt;</span>
<span class="w"> </span><span class="nt">&lt;StorageQuota&gt;</span>10240000<span class="nt">&lt;/StorageQuota&gt;</span>
<span class="nt">&lt;/Quota&gt;</span>
</pre></div></td></tr></table></div>
</div>
</div>
<div class="section" id="obs_04_0052__section76081155815"><h4 class="sectiontitle">Sample Response</h4><div class="codecoloring" codetype="Xml" id="obs_04_0052__screen8485113814"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span>
<span class="normal">5</span>
<span class="normal">6</span>
<span class="normal">7</span></pre></div></td><td class="code"><div><pre><span></span>HTTP/1.1<span class="w"> </span>100<span class="w"> </span>Continue
HTTP/1.1<span class="w"> </span>200<span class="w"> </span>OK
Server:<span class="w"> </span>OBS
x-obs-request-id:<span class="w"> </span>BF260000016435E09A2BCA388688AA08
x-obs-id-2:<span class="w"> </span>32AAAQAAEAABSAAgAAEAABAAAQAAEAABCSHbmBecv7ohDSvqaRObpxzgzJ9+l8xT
Date:<span class="w"> </span>WED,<span class="w"> </span>01<span class="w"> </span>Jul<span class="w"> </span>2015<span class="w"> </span>03:24:37<span class="w"> </span>GMT
Content-Length:<span class="w"> </span>0
</pre></div></td></tr></table></div>
</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>