doc-exports/docs/obs/api-ref/obs_04_0087.html
zhangyue 7d2a7ec198 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>
2024-11-05 16:37:11 +00:00

257 lines
20 KiB
HTML

<a name="obs_04_0087"></a><a name="obs_04_0087"></a>
<h1 class="topictitle1">Restoring Cold Objects</h1>
<div id="body58597509"><div class="section" id="obs_04_0087__section5584184924715"><h4 class="sectiontitle">Functions</h4><p class="msonormal" id="obs_04_0087__p13952829">To obtain the content of an object in the Cold storage class, you need to restore the object first and then you can download it. After an object is restored, a copy of the object is saved in the Standard storage class. By doing so, the object in the Cold storage class and its copy in the Standard storage class co-exist in the bucket. The copy will be automatically deleted once its retention period ends.</p>
</div>
<div class="section" id="obs_04_0087__section58466603"><h4 class="sectiontitle">Versioning</h4><p class="msonormal" id="obs_04_0087__p48777806">By default, this operation returns the latest version of an object. If the object has a delete marker, status code 404 is returned. To restore an object of a specified version, the <strong id="obs_04_0087__b1866401892947">versionId</strong> parameter can be used to specify the desired version.</p>
</div>
<div class="section" id="obs_04_0087__section56437387"><h4 class="sectiontitle">Request Syntax</h4><pre class="screen" id="obs_04_0087__screen41581266">POST /ObjectName?restore&amp;versionId=VersionID HTTP/1.1
Host: <em id="obs_04_0087__i123441746202313">bucketname</em>.obs.<em id="obs_04_0087__i034434682311">region</em>.example.com
Date: <em id="obs_04_0087__i49616010">date</em>
Authorization: <em id="obs_04_0087__i59473860">authorization string</em>
Content-MD5: <em id="obs_04_0087__i52653375">MD5</em>
&lt;RestoreRequest&gt;
&lt;Days&gt;<em id="obs_04_0087__i49474582">NumberOfDays</em>&lt;/Days&gt;
&lt;RestoreJob&gt;
&lt;Tier&gt;<em id="obs_04_0087__i29511006">RetrievalOption</em>&lt;/Tier&gt;
&lt;/RestoreJob&gt;
&lt;/RestoreRequest&gt;</pre>
</div>
<div class="section" id="obs_04_0087__section38174436"><h4 class="sectiontitle">Request Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="obs_04_0087__table79451315124010" frame="border" border="1" rules="all"><thead align="left"><tr id="obs_04_0087__row1994511512408"><th align="left" class="cellrowborder" valign="top" width="15.870000000000001%" id="mcps1.3.4.2.1.5.1.1"><p id="obs_04_0087__p169453157401">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="13.950000000000001%" id="mcps1.3.4.2.1.5.1.2"><p id="obs_04_0087__p16660132412402"><strong id="obs_04_0087__b10548194412321">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="8.64%" id="mcps1.3.4.2.1.5.1.3"><p id="obs_04_0087__p109454150400"><strong id="obs_04_0087__b1728625419321">Mandatory (Yes/No)</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="61.53999999999999%" id="mcps1.3.4.2.1.5.1.4"><p id="obs_04_0087__p169451115204018"><strong id="obs_04_0087__b1428220522532">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="obs_04_0087__row1994541554014"><td class="cellrowborder" valign="top" width="15.870000000000001%" headers="mcps1.3.4.2.1.5.1.1 "><p id="obs_04_0087__p11945191594014">versionId</p>
</td>
<td class="cellrowborder" valign="top" width="13.950000000000001%" headers="mcps1.3.4.2.1.5.1.2 "><p id="obs_04_0087__p9660024124011">String</p>
</td>
<td class="cellrowborder" valign="top" width="8.64%" headers="mcps1.3.4.2.1.5.1.3 "><p id="obs_04_0087__p29451615134012">No</p>
</td>
<td class="cellrowborder" valign="top" width="61.53999999999999%" headers="mcps1.3.4.2.1.5.1.4 "><p id="obs_04_0087__p7134184955020"><strong id="obs_04_0087__b17632520583829">Explanation</strong>:</p>
<p id="obs_04_0087__p6945201534013">Version ID of the Cold object to be restored</p>
<p id="obs_04_0087__p6244143815356"><strong id="obs_04_0087__b324433873516">Restrictions</strong>:</p>
<p id="obs_04_0087__p3244153833514">None</p>
<p id="obs_04_0087__p72444384359"><strong id="obs_04_0087__b17244173823512">Value range</strong>:</p>
<p id="obs_04_0087__p19244153815359">None</p>
<p id="obs_04_0087__p1824463853510"><strong id="obs_04_0087__b182441338143517">Default value</strong>:</p>
<p id="obs_04_0087__p0244138133512">None. If this parameter is not configured, the latest version of the object is specified.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="obs_04_0087__section8025609"><h4 class="sectiontitle">Request Headers</h4><p class="msonormal" id="obs_04_0087__p50487909">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_0087__section5121617"><h4 class="sectiontitle">Request Elements</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="obs_04_0087__table147671333415" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Request elements</caption><thead align="left"><tr id="obs_04_0087__row14767183319419"><th align="left" class="cellrowborder" valign="top" width="18.55%" id="mcps1.3.6.2.2.5.1.1"><p id="obs_04_0087__p12767183315412"><strong id="obs_04_0087__b838184915480">Element</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="18.509999999999998%" id="mcps1.3.6.2.2.5.1.2"><p id="obs_04_0087__p10630052154112"><strong id="obs_04_0087__b173954911483">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="13.450000000000001%" id="mcps1.3.6.2.2.5.1.3"><p id="obs_04_0087__p87671533124118"><strong id="obs_04_0087__b11509127331">Mandatory (Yes/No)</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="49.49%" id="mcps1.3.6.2.2.5.1.4"><p id="obs_04_0087__p15767233124119">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="obs_04_0087__row076773374110"><td class="cellrowborder" valign="top" width="18.55%" headers="mcps1.3.6.2.2.5.1.1 "><p id="obs_04_0087__p3767333104118">RestoreRequest</p>
</td>
<td class="cellrowborder" valign="top" width="18.509999999999998%" headers="mcps1.3.6.2.2.5.1.2 "><p id="obs_04_0087__p563095215414">Container</p>
</td>
<td class="cellrowborder" valign="top" width="13.450000000000001%" headers="mcps1.3.6.2.2.5.1.3 "><p id="obs_04_0087__p27673335415">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="49.49%" headers="mcps1.3.6.2.2.5.1.4 "><p id="obs_04_0087__p53881255195816"><strong id="obs_04_0087__b176640249283829">Explanation</strong>:</p>
<p id="obs_04_0087__p176711334418">Container for the restore information</p>
<p id="obs_04_0087__p194565683619"><strong id="obs_04_0087__b94567623619">Restrictions</strong>:</p>
<p id="obs_04_0087__p3456061365">None</p>
<p id="obs_04_0087__p204561467365"><strong id="obs_04_0087__b245656113620">Value range</strong>:</p>
<p id="obs_04_0087__p74568663612">None</p>
<p id="obs_04_0087__p1456106123617"><strong id="obs_04_0087__b134564693611">Default value</strong>:</p>
<p id="obs_04_0087__p1645610633616">None</p>
</td>
</tr>
<tr id="obs_04_0087__row1776713320412"><td class="cellrowborder" valign="top" width="18.55%" headers="mcps1.3.6.2.2.5.1.1 "><p id="obs_04_0087__p1976716338415">Days</p>
</td>
<td class="cellrowborder" valign="top" width="18.509999999999998%" headers="mcps1.3.6.2.2.5.1.2 "><p id="obs_04_0087__p14812205817297">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="13.450000000000001%" headers="mcps1.3.6.2.2.5.1.3 "><p id="obs_04_0087__p14767123314116">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="49.49%" headers="mcps1.3.6.2.2.5.1.4 "><p id="obs_04_0087__p52661949707"><strong id="obs_04_0087__b720861816">Explanation</strong>:</p>
<p id="obs_04_0087__p97431944655">After an object is restored, a Standard copy of it is generated. This parameter specifies how long the Standard copy can be retained, that is, the validity period of the restored object.</p>
<p id="obs_04_0087__p291315175519"><strong id="obs_04_0087__b29131817185116">Restrictions</strong>:</p>
<p id="obs_04_0087__p791319174514">None</p>
<p id="obs_04_0087__p3266184917016"><strong id="obs_04_0087__b22669495015">Value range</strong>:</p>
<p id="obs_04_0087__p194712509513">The value ranges from 1 to 30, in days.</p>
<p id="obs_04_0087__p102668491108"><strong id="obs_04_0087__b7266104914020">Default value</strong>:</p>
<p id="obs_04_0087__p9475612610">None</p>
</td>
</tr>
<tr id="obs_04_0087__row776723313412"><td class="cellrowborder" valign="top" width="18.55%" headers="mcps1.3.6.2.2.5.1.1 "><p id="obs_04_0087__p27670337419">RestoreJob</p>
</td>
<td class="cellrowborder" valign="top" width="18.509999999999998%" headers="mcps1.3.6.2.2.5.1.2 "><p id="obs_04_0087__p376763318417">Container</p>
</td>
<td class="cellrowborder" valign="top" width="13.450000000000001%" headers="mcps1.3.6.2.2.5.1.3 "><p id="obs_04_0087__p13767133304110">No</p>
</td>
<td class="cellrowborder" valign="top" width="49.49%" headers="mcps1.3.6.2.2.5.1.4 "><p id="obs_04_0087__p1014916045918"><strong id="obs_04_0087__b147706485283829">Explanation</strong>:</p>
<p id="obs_04_0087__p77671133164114">Container for the restore options</p>
<p id="obs_04_0087__p2080810303714"><strong id="obs_04_0087__b78082313376">Restrictions</strong>:</p>
<p id="obs_04_0087__p198083315376">None</p>
<p id="obs_04_0087__p1880820313718"><strong id="obs_04_0087__b680819353719">Value range</strong>:</p>
<p id="obs_04_0087__p78081438372">None</p>
<p id="obs_04_0087__p280811313711"><strong id="obs_04_0087__b1380810353713">Default value</strong>:</p>
<p id="obs_04_0087__p58085313714">None</p>
</td>
</tr>
<tr id="obs_04_0087__row976723319417"><td class="cellrowborder" valign="top" width="18.55%" headers="mcps1.3.6.2.2.5.1.1 "><p id="obs_04_0087__p17767133134113">Tier</p>
</td>
<td class="cellrowborder" valign="top" width="18.509999999999998%" headers="mcps1.3.6.2.2.5.1.2 "><p id="obs_04_0087__p1676713333419">String</p>
</td>
<td class="cellrowborder" valign="top" width="13.450000000000001%" headers="mcps1.3.6.2.2.5.1.3 "><p id="obs_04_0087__p1476717339418">No</p>
</td>
<td class="cellrowborder" valign="top" width="49.49%" headers="mcps1.3.6.2.2.5.1.4 "><p id="obs_04_0087__p1818216511507"><strong id="obs_04_0087__b1662598088">Explanation</strong>:</p>
<p id="obs_04_0087__p16721225165">Retrieval speed tier. You can select a tier that suits your retrieval needs.</p>
<p id="obs_04_0087__p21826514018"><strong id="obs_04_0087__b1118219518016">Value range</strong>:</p>
<ul id="obs_04_0087__ul173171648115317"><li id="obs_04_0087__li163171548115315"><strong id="obs_04_0087__b1019882112355">Expedited</strong> indicates that objects can be quickly restored from Archive storage within 1 to 5 minutes.</li><li id="obs_04_0087__li2317104818530"><strong id="obs_04_0087__b190433047843958">Standard</strong> indicates that objects can be restored from Archive storage within 3 to 5 hours.</li></ul>
<p id="obs_04_0087__p1718225112010"><strong id="obs_04_0087__b01824511609">Default value</strong>:</p>
<p id="obs_04_0087__p694131455414">Standard</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="obs_04_0087__section46094559"><h4 class="sectiontitle">Response Syntax</h4><div class="codecoloring" codetype="Xml" id="obs_04_0087__screen939498136"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</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
</pre></div></td></tr></table></div>
</div>
</div>
<div class="section" id="obs_04_0087__section12197851"><h4 class="sectiontitle">Response Headers</h4><p class="msonormal" id="obs_04_0087__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_0087__section42671798"><h4 class="sectiontitle">Response Elements</h4><p class="msonormal" id="obs_04_0087__p522982">This response contains no elements.</p>
</div>
<div class="section" id="obs_04_0087__section48501865"><h4 class="sectiontitle">Error Responses</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="obs_04_0087__table973091144311" frame="border" border="1" rules="all"><caption><b>Table 2 </b>List of OBS access error codes</caption><thead align="left"><tr id="obs_04_0087__row1473019194310"><th align="left" class="cellrowborder" valign="top" width="25.509999999999998%" id="mcps1.3.10.2.2.4.1.1"><p id="obs_04_0087__p2730111194313">Error Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="53.059999999999995%" id="mcps1.3.10.2.2.4.1.2"><p id="obs_04_0087__p1373015124313">Description</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="21.43%" id="mcps1.3.10.2.2.4.1.3"><p id="obs_04_0087__p157301312436">HTTP Status Code</p>
</th>
</tr>
</thead>
<tbody><tr id="obs_04_0087__row07301913435"><td class="cellrowborder" valign="top" width="25.509999999999998%" headers="mcps1.3.10.2.2.4.1.1 "><p id="obs_04_0087__p173013118434">RestoreAlreadyInProgress</p>
</td>
<td class="cellrowborder" valign="top" width="53.059999999999995%" headers="mcps1.3.10.2.2.4.1.2 "><p id="obs_04_0087__p9251144715614"><strong id="obs_04_0087__b1820941395">Explanation</strong>:</p>
<p id="obs_04_0087__p5730817439">The object is being restored. The request conflicts with another.</p>
<p id="obs_04_0087__p147304110439">ErrorMessage: Object restore is already in progress</p>
</td>
<td class="cellrowborder" valign="top" width="21.43%" headers="mcps1.3.10.2.2.4.1.3 "><p id="obs_04_0087__p11730141194319">409 Conflict</p>
</td>
</tr>
<tr id="obs_04_0087__row27301812437"><td class="cellrowborder" valign="top" width="25.509999999999998%" headers="mcps1.3.10.2.2.4.1.1 "><p id="obs_04_0087__p19730131184318">ObjectHasAlreadyRestored</p>
</td>
<td class="cellrowborder" valign="top" width="53.059999999999995%" headers="mcps1.3.10.2.2.4.1.2 "><p id="obs_04_0087__p540724115718"><strong id="obs_04_0087__b107388827">Explanation</strong>:</p>
<p id="obs_04_0087__p5730121174319">The objects have been restored and the retention period of the objects cannot be shortened.</p>
<p id="obs_04_0087__p2730121164317">ErrorMessage: After restoring an archived object, you cannot shorten the restoration period of the archived object</p>
</td>
<td class="cellrowborder" valign="top" width="21.43%" headers="mcps1.3.10.2.2.4.1.3 "><p id="obs_04_0087__p1673021164318">409 Conflict</p>
</td>
</tr>
<tr id="obs_04_0087__row273017110433"><td class="cellrowborder" valign="top" width="25.509999999999998%" headers="mcps1.3.10.2.2.4.1.1 "><p id="obs_04_0087__p3730151184317">MalformedXML</p>
</td>
<td class="cellrowborder" valign="top" width="53.059999999999995%" headers="mcps1.3.10.2.2.4.1.2 "><p id="obs_04_0087__p27777519573"><strong id="obs_04_0087__b1825021250">Explanation</strong>:</p>
<p id="obs_04_0087__p873016115431">Invalid value for the <strong id="obs_04_0087__b2119160332">Days</strong> field (supposed to be an integer)</p>
<p id="obs_04_0087__p1073011174317">ErrorMessage: The XML you provided was not well-formed or did not validate against our published schema</p>
</td>
<td class="cellrowborder" valign="top" width="21.43%" headers="mcps1.3.10.2.2.4.1.3 "><p id="obs_04_0087__p1273061134315">400 Bad Request</p>
</td>
</tr>
<tr id="obs_04_0087__row373018124313"><td class="cellrowborder" valign="top" width="25.509999999999998%" headers="mcps1.3.10.2.2.4.1.1 "><p id="obs_04_0087__p973013114433">InvalidArgument</p>
</td>
<td class="cellrowborder" valign="top" width="53.059999999999995%" headers="mcps1.3.10.2.2.4.1.2 "><p id="obs_04_0087__p5536107165711"><strong id="obs_04_0087__b2123084505">Explanation</strong>:</p>
<p id="obs_04_0087__p1973015164310">Invalid value for the <strong id="obs_04_0087__b465760451">Days</strong> field (valid range: 1 to 30).</p>
<p id="obs_04_0087__p473019124310">ErrorMessage: restoration days should be at least 1 and at most 30</p>
</td>
<td class="cellrowborder" valign="top" width="21.43%" headers="mcps1.3.10.2.2.4.1.3 "><p id="obs_04_0087__p07309110437">400 Bad Request</p>
</td>
</tr>
<tr id="obs_04_0087__row2730215430"><td class="cellrowborder" valign="top" width="25.509999999999998%" headers="mcps1.3.10.2.2.4.1.1 "><p id="obs_04_0087__p1730613437">MalformedXML</p>
</td>
<td class="cellrowborder" valign="top" width="53.059999999999995%" headers="mcps1.3.10.2.2.4.1.2 "><p id="obs_04_0087__p4192111010579"><strong id="obs_04_0087__b338912889">Explanation</strong>:</p>
<p id="obs_04_0087__p4730213436">Invalid value for the <strong id="obs_04_0087__b280544503">Tier</strong> field.</p>
<p id="obs_04_0087__p373011154313">ErrorMessage: The XML you provided was not well-formed or did not validate against our published schema</p>
</td>
<td class="cellrowborder" valign="top" width="21.43%" headers="mcps1.3.10.2.2.4.1.3 "><p id="obs_04_0087__p1573016154310">400 Bad Request</p>
</td>
</tr>
<tr id="obs_04_0087__row1773091114316"><td class="cellrowborder" valign="top" width="25.509999999999998%" headers="mcps1.3.10.2.2.4.1.1 "><p id="obs_04_0087__p16731101144317">InvalidObjectState</p>
</td>
<td class="cellrowborder" valign="top" width="53.059999999999995%" headers="mcps1.3.10.2.2.4.1.2 "><p id="obs_04_0087__p743371114578"><strong id="obs_04_0087__b401986853">Explanation</strong>:</p>
<p id="obs_04_0087__p873115114432">The restored object is not in the Cold storage.</p>
<p id="obs_04_0087__p67317118435">ErrorMessage: Restore is not allowed, as object's storage class is not COLD</p>
</td>
<td class="cellrowborder" valign="top" width="21.43%" headers="mcps1.3.10.2.2.4.1.3 "><p id="obs_04_0087__p127314118436">403 Forbidden</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="obs_04_0087__section22990347112"><h4 class="sectiontitle">Sample Request</h4><div class="codecoloring" codetype="Xml" id="obs_04_0087__screen1179230172715"><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>
<span class="normal">12</span>
<span class="normal">13</span></pre></div></td><td class="code"><div><pre><span></span>POST<span class="w"> </span>/object?restore<span class="w"> </span>HTTP/1.1
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>04:39:46<span class="w"> </span>GMT
Authorization:<span class="w"> </span>OBS<span class="w"> </span>H4IPJX0TQTHTHEBQQCEC:kaEwOixnSVuS6If3Q0Lnd6kxm5A=
Content-Length:<span class="w"> </span>183
<span class="nt">&lt;RestoreRequest&gt;</span>
<span class="w"> </span><span class="nt">&lt;Days&gt;</span>2<span class="nt">&lt;/Days&gt;</span><span class="w"> </span>
<span class="w"> </span><span class="nt">&lt;RestoreJob&gt;</span>
<span class="w"> </span><span class="nt">&lt;Tier&gt;</span>Expedited<span class="nt">&lt;/Tier&gt;</span>
<span class="w"> </span><span class="nt">&lt;/RestoreJob&gt;</span><span class="w"> </span>
<span class="nt">&lt;/RestoreRequest&gt;</span><span class="w"> </span>
</pre></div></td></tr></table></div>
</div>
</div>
<div class="section" id="obs_04_0087__section0244954115611"><h4 class="sectiontitle">Sample Response</h4><div class="codecoloring" codetype="Xml" id="obs_04_0087__screen14313135410562"><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></pre></div></td><td class="code"><div><pre><span></span>HTTP/1.1<span class="w"> </span>202<span class="w"> </span>Accepted
Server:<span class="w"> </span>OBS
x-obs-request-id:<span class="w"> </span>A2F500000163F374CCBB2063F834C6C4
x-obs-id-2:<span class="w"> </span>32AAAUgAIAABAAAQAAEAABAAAQAAEAABCSLbWIs23RR95NVpkbWlJdlm8Dq+wQBw
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>04:39:46<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_0079.html">Operations on Objects</a></div>
</div>
</div>