forked from docs/doc-exports
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-authored-by: Wang , Deng Ke <wangdengke2@huawei.com> Co-committed-by: Wang , Deng Ke <wangdengke2@huawei.com>
203 lines
16 KiB
HTML
203 lines
16 KiB
HTML
<a name="rds_09_0009"></a><a name="rds_09_0009"></a>
|
|
|
|
<h1 class="topictitle1">Restoring Data to an Existing or Original DB Instance</h1>
|
|
<div id="body1537345764988"><div class="section" id="rds_09_0009__section117711820496"><h4 class="sectiontitle">Function</h4><p id="rds_09_0009__p1639433018917">This API is used to restore a database to an existing or the original DB instance.</p>
|
|
<ul id="rds_09_0009__ul12259155218373"><li id="rds_09_0009__en-us_topic_0240111818_li836513175363">Before calling an API, you need to understand the API in <a href="rds_03_0001.html">Authentication</a>.</li><li id="rds_09_0009__en-us_topic_0240111818_li1991981933613">Before calling this API, obtain the required <a href="https://docs.otc.t-systems.com/en-us/endpoint/index.html" target="_blank" rel="noopener noreferrer">region and endpoint</a>.</li></ul>
|
|
</div>
|
|
<div class="section" id="rds_09_0009__section12081471012"><h4 class="sectiontitle">URI</h4><ul id="rds_09_0009__ul13194498"><li id="rds_09_0009__li41603465301">URI format<p id="rds_09_0009__p11160246123012"><a name="rds_09_0009__li41603465301"></a><a name="li41603465301"></a>POST https://{<em id="rds_09_0009__i1540784518162">Endpoint</em>}/v3/{project_id}/instances/recovery</p>
|
|
</li><li id="rds_09_0009__li22221662">Parameter description
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="rds_09_0009__table65777232" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="rds_09_0009__row46529701"><th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.2.2.2.1.2.4.1.1"><p id="rds_09_0009__p10809459"><strong id="rds_09_0009__b213814211354">Name</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.2.2.2.1.2.4.1.2"><p id="rds_09_0009__p3150961"><strong id="rds_09_0009__b1814114213356">Mandatory</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.2.2.2.1.2.4.1.3"><p id="rds_09_0009__p53901255"><strong id="rds_09_0009__b1314342123518">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="rds_09_0009__row3925534"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.2.2.2.1.2.4.1.1 "><p id="rds_09_0009__p49532829">project_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.2.2.2.1.2.4.1.2 "><p id="rds_09_0009__p52736237">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.2.2.2.1.2.4.1.3 "><p id="rds_09_0009__p43776822">Specifies the project ID of a tenant in a region.</p>
|
|
<p id="rds_09_0009__p1574719483818">For details about how to obtain the project ID, see <a href="rds_03_0002.html">Obtaining a Project ID</a>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="rds_09_0009__section420839121019"><h4 class="sectiontitle">Request</h4><ul id="rds_09_0009__ul83080566431"><li id="rds_09_0009__li1830813567439">Parameter description
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="rds_09_0009__table202301459171110" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Parameter description</caption><thead align="left"><tr id="rds_09_0009__row823025911111"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.3.2.1.1.2.5.1.1"><p id="rds_09_0009__p17490046"><strong id="rds_09_0009__b11712026354">Name</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.3.2.1.1.2.5.1.2"><p id="rds_09_0009__p7407659"><strong id="rds_09_0009__b41749210353">Mandatory</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.3.2.1.1.2.5.1.3"><p id="rds_09_0009__p63149496"><strong id="rds_09_0009__b2017617213356">Type</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.3.2.1.1.2.5.1.4"><p id="rds_09_0009__p14835533"><strong id="rds_09_0009__b1178722354">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="rds_09_0009__row2230759191118"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.1.2.5.1.1 "><p id="rds_09_0009__p4230195918114">source</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.1.2.5.1.2 "><p id="rds_09_0009__p6230185941112">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.1.2.5.1.3 "><p id="rds_09_0009__p10230155931112">Object</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.1.2.5.1.4 "><p id="rds_09_0009__p02307591119">Specifies the restoration information.</p>
|
|
<p id="rds_09_0009__p17312173532">For details, see <a href="#rds_09_0009__table15343138128">Table 3</a>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="rds_09_0009__row112306593118"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.1.2.5.1.1 "><p id="rds_09_0009__p8230105941111">target</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.1.2.5.1.2 "><p id="rds_09_0009__p92301659121111">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.1.2.5.1.3 "><p id="rds_09_0009__p14598434729">Object</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.1.2.5.1.4 "><p id="rds_09_0009__p123113599116">Specifies the restoration target.</p>
|
|
<p id="rds_09_0009__p17705736165313">For details, see <a href="#rds_09_0009__table13185192412159">Table 4</a>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><a name="rds_09_0009__table15343138128"></a><a name="table15343138128"></a><table cellpadding="4" cellspacing="0" summary="" id="rds_09_0009__table15343138128" frame="border" border="1" rules="all"><caption><b>Table 3 </b>source field data structure description</caption><thead align="left"><tr id="rds_09_0009__row53891320125"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.3.2.1.2.2.5.1.1"><p id="rds_09_0009__p103841361219"><strong id="rds_09_0009__b182108215355">Name</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.3.2.1.2.2.5.1.2"><p id="rds_09_0009__p14391313121214"><strong id="rds_09_0009__b2212182193520">Mandatory</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.3.2.1.2.2.5.1.3"><p id="rds_09_0009__p44051314123"><strong id="rds_09_0009__b121516213516">Type</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.3.2.1.2.2.5.1.4"><p id="rds_09_0009__p2414137127"><strong id="rds_09_0009__b32181212351">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="rds_09_0009__row2421813191218"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.2.2.5.1.1 "><p id="rds_09_0009__p13264155191218">instance_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.2.2.5.1.2 "><p id="rds_09_0009__p2265855161214">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.2.2.5.1.3 "><p id="rds_09_0009__p1626555516125">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.2.2.5.1.4 "><p id="rds_09_0009__p02661255101216">Specifies the DB instance ID.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="rds_09_0009__row85749514384"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.2.2.5.1.1 "><p id="rds_09_0009__p1953065318318">type</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.2.2.5.1.2 "><p id="rds_09_0009__p65301153103119">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.2.2.5.1.3 "><p id="rds_09_0009__p753012532312">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.2.2.5.1.4 "><p id="rds_09_0009__p338385533211">Specifies the restoration mode. Enumerated values include:</p>
|
|
<ul id="rds_09_0009__ul1286842916197"><li id="rds_09_0009__li16868102981910"><span class="parmvalue" id="rds_09_0009__parmvalue14106203115377"><b>backup</b></span>: indicates using backup files for restoration. In this mode, <span class="parmname" id="rds_09_0009__parmname151076313376"><b>type</b></span> is not mandatory and <span class="parmname" id="rds_09_0009__parmname410715311373"><b>backup_id</b></span> is mandatory.</li><li id="rds_09_0009__li43144323192"><span class="parmvalue" id="rds_09_0009__parmvalue18771173218374"><b>timestamp</b></span>: indicates the point-in-time restoration mode. In this mode, <span class="parmname" id="rds_09_0009__parmname37721032123717"><b>type</b></span> is mandatory and <span class="parmname" id="rds_09_0009__parmname107730322372"><b>restore_time</b></span> is no mandatory.</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="rds_09_0009__row1246181331215"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.2.2.5.1.1 "><p id="rds_09_0009__p5479131120">backup_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.2.2.5.1.2 "><p id="rds_09_0009__p164741341214">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.2.2.5.1.3 "><p id="rds_09_0009__p148131319124">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.2.2.5.1.4 "><p id="rds_09_0009__p104915134120">Specifies the ID of the backup used to restore data. This parameter must be specified when the backup file is used for restoration.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="rds_09_0009__row149971720381"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.2.2.5.1.1 "><p id="rds_09_0009__p1876020715326">restore_time</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.2.2.5.1.2 "><p id="rds_09_0009__p167604743213">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.2.2.5.1.3 "><p id="rds_09_0009__p1976018715320">Integer</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.2.2.5.1.4 "><p id="rds_09_0009__p147606715321">Specifies the time point of data restoration in the UNIX timestamp. The unit is millisecond and the time zone is UTC.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><a name="rds_09_0009__table13185192412159"></a><a name="table13185192412159"></a><table cellpadding="4" cellspacing="0" summary="" id="rds_09_0009__table13185192412159" frame="border" border="1" rules="all"><caption><b>Table 4 </b>target field data structure description</caption><thead align="left"><tr id="rds_09_0009__row13189624131514"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.3.2.1.3.2.5.1.1"><p id="rds_09_0009__p1191122441517"><strong id="rds_09_0009__b3292142113512">Name</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.3.2.1.3.2.5.1.2"><p id="rds_09_0009__p1192132416156"><strong id="rds_09_0009__b17294182153511">Mandatory</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.3.2.1.3.2.5.1.3"><p id="rds_09_0009__p8193152420154"><strong id="rds_09_0009__b142964210351">Type</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.3.2.1.3.2.5.1.4"><p id="rds_09_0009__p16195112415153"><strong id="rds_09_0009__b72985273518">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="rds_09_0009__row17195102481518"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.3.2.5.1.1 "><p id="rds_09_0009__p4195224181513">instance_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.3.2.5.1.2 "><p id="rds_09_0009__p5196162491515">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.3.2.5.1.3 "><p id="rds_09_0009__p719812247154">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.3.2.5.1.4 "><p id="rds_09_0009__p71982245158">Specifies the ID of the DB instance to be restored to.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li></ul>
|
|
<ul id="rds_09_0009__ul17857134025414"><li id="rds_09_0009__li4411135064210">Example<p id="rds_09_0009__p1454414211213"><a name="rds_09_0009__li4411135064210"></a><a name="li4411135064210"></a>POST https://rds.eu-de.otc.t-systems.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/recovery</p>
|
|
</li></ul>
|
|
<ul id="rds_09_0009__ul1921105915413"><li id="rds_09_0009__li18211159165410">Request example<p id="rds_09_0009__p419205955411"><a name="rds_09_0009__li18211159165410"></a><a name="li18211159165410"></a>Use backup files for restoration:</p>
|
|
<pre class="codeblock" id="rds_09_0009__codeblock52017590543">{
|
|
"source": {
|
|
"instance_id": "d8e6ca5a624745bcb546a227aa3ae1cfin01",
|
|
"type": "backup",
|
|
"backup_id": "2f4ddb93-b901-4b08-93d8-1d2e472f30fe"
|
|
},
|
|
"target": {
|
|
"instance_id": "d8e6ca5a624745bcb546a227aa3ae1cfin01"
|
|
}
|
|
}</pre>
|
|
<p id="rds_09_0009__p1420135911540">Use PITR for restoration:</p>
|
|
<pre class="codeblock" id="rds_09_0009__codeblock12213598541">{
|
|
"source": {
|
|
"instance_id": "d8e6ca5a624745bcb546a227aa3ae1cfin01",
|
|
"type": "timestamp",
|
|
"restore_time": 1532001446987
|
|
},
|
|
"target": {
|
|
"instance_id": "d8e6ca5a624745bcb546a227aa3ae1cfin01"
|
|
}
|
|
}</pre>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="rds_09_0009__section1229512143106"><h4 class="sectiontitle">Response</h4><ul id="rds_09_0009__ul1727710432014"><li id="rds_09_0009__li227714320010">Normal response
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="rds_09_0009__table68261136172016" frame="border" border="1" rules="all"><caption><b>Table 5 </b>Parameter description</caption><thead align="left"><tr id="rds_09_0009__row17826143612201"><th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.4.2.1.1.2.4.1.1"><p id="rds_09_0009__p163303524208"><strong id="rds_09_0009__b2067682193517">Name</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.4.2.1.1.2.4.1.2"><p id="rds_09_0009__p1133119521209"><strong id="rds_09_0009__b36778216359">Type</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.4.2.1.1.2.4.1.3"><p id="rds_09_0009__p23321252122014"><strong id="rds_09_0009__b1767718283515">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="rds_09_0009__row17826183612020"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.2.1.1.2.4.1.1 "><p id="rds_09_0009__p5826143617203">job_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.2.1.1.2.4.1.2 "><p id="rds_09_0009__p3826236182018">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.2.1.1.2.4.1.3 "><p id="rds_09_0009__p48266368201">Indicates the task ID.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li><li id="rds_09_0009__li158029471019">Example normal response<pre class="codeblock" id="rds_09_0009__codeblock1662775932513">{
|
|
"job_id": "ff80808157127d9301571bf8160c001d"
|
|
}</pre>
|
|
</li><li id="rds_09_0009__li65567438611">Abnormal Response<p id="rds_09_0009__p29415884"><a name="rds_09_0009__li65567438611"></a><a name="li65567438611"></a>For details, see <a href="en-us_topic_0032488197.html">Abnormal Request Results</a>.</p>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="rds_09_0009__section4778540915440"><h4 class="sectiontitle">Status Code</h4><ul id="rds_09_0009__en-us_topic_0032347778_ul7858132212142"><li id="rds_09_0009__en-us_topic_0032347778_li58581622171411">Normal<p id="rds_09_0009__en-us_topic_0032347778_p1040982941020"><a name="rds_09_0009__en-us_topic_0032347778_li58581622171411"></a><a name="en-us_topic_0032347778_li58581622171411"></a>200</p>
|
|
</li><li id="rds_09_0009__en-us_topic_0032347778_li11583183218149">Abnormal<p id="rds_09_0009__en-us_topic_0032347778_p0723374409"><a name="rds_09_0009__en-us_topic_0032347778_li11583183218149"></a><a name="en-us_topic_0032347778_li11583183218149"></a>For details, see <a href="en-us_topic_0032488240.html">Status Codes</a>.</p>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="rds_09_0009__section1183074220016"><h4 class="sectiontitle">Error Code</h4><p id="rds_09_0009__en-us_topic_0032347778_p19357163913406">For details, see <a href="en-us_topic_0032488241.html">Error Codes</a>.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0032347777.html">Backup and Restoration</a></div>
|
|
</div>
|
|
</div>
|
|
|