doc-exports/docs/dds/api-ref/dds_api_0084.html
Wang , Deng Ke 60010eb9d0 dds api 2.0.38sp24 version
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>
2023-01-13 08:55:41 +00:00

211 lines
15 KiB
HTML

<a name="dds_api_0084"></a><a name="dds_api_0084"></a>
<h1 class="topictitle1">Restoring Databases and Tables to a Point in Time</h1>
<div id="body0000001072509030"><div class="section" id="dds_api_0084__section117711820496"><h4 class="sectiontitle">Function</h4><p id="dds_api_0084__p1639433018917">This API is used to restore databases and tables at a point in time.</p>
</div>
<div class="section" id="dds_api_0084__section107191613546"><h4 class="sectiontitle">Constraints</h4><p id="dds_api_0084__p2089016402544">This API applies only to replica sets.</p>
</div>
<div class="section" id="dds_api_0084__section12081471012"><h4 class="sectiontitle">URI</h4><ul id="dds_api_0084__ul13194498"><li id="dds_api_0084__li51641620">URI format<p id="dds_api_0084__p62121397"><a name="dds_api_0084__li51641620"></a><a name="li51641620"></a>POST https://{Endpoint}/v3/{project_id}/instances/{instance_id}/restore/collections</p>
</li><li id="dds_api_0084__li22221662">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dds_api_0084__table65777232" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="dds_api_0084__row46529701"><th align="left" class="cellrowborder" valign="top" width="28.002800280028005%" id="mcps1.3.3.2.2.1.2.4.1.1"><p id="dds_api_0084__p10809459">Name</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="28.12281228122812%" id="mcps1.3.3.2.2.1.2.4.1.2"><p id="dds_api_0084__p3150961">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="43.874387438743874%" id="mcps1.3.3.2.2.1.2.4.1.3"><p id="dds_api_0084__p2775334615440">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="dds_api_0084__row3925534"><td class="cellrowborder" valign="top" width="28.002800280028005%" headers="mcps1.3.3.2.2.1.2.4.1.1 "><p id="dds_api_0084__p49532829">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="28.12281228122812%" headers="mcps1.3.3.2.2.1.2.4.1.2 "><p id="dds_api_0084__p52736237">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="43.874387438743874%" headers="mcps1.3.3.2.2.1.2.4.1.3 "><p id="dds_api_0084__p43776822">Specifies the project ID of a tenant in a region.</p>
</td>
</tr>
<tr id="dds_api_0084__row1772585924320"><td class="cellrowborder" valign="top" width="28.002800280028005%" headers="mcps1.3.3.2.2.1.2.4.1.1 "><p id="dds_api_0084__p19725959174313">instance_id</p>
</td>
<td class="cellrowborder" valign="top" width="28.12281228122812%" headers="mcps1.3.3.2.2.1.2.4.1.2 "><p id="dds_api_0084__p104810100444">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="43.874387438743874%" headers="mcps1.3.3.2.2.1.2.4.1.3 "><p id="dds_api_0084__p1472515974312">Specifies the instance ID, which can be obtained by calling the API for querying instances. If you do not have an instance, you can call the API used for creating an instance.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="dds_api_0084__section420839121019"><h4 class="sectiontitle">Requests</h4><ul id="dds_api_0084__ul83080566431"><li id="dds_api_0084__li1830813567439">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dds_api_0084__table6426756154514" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Parameter description</caption><thead align="left"><tr id="dds_api_0084__row142645664510"><th align="left" class="cellrowborder" valign="top" width="21.81%" id="mcps1.3.4.2.1.1.2.5.1.1"><p id="dds_api_0084__p17490046">Name</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="23.29%" id="mcps1.3.4.2.1.1.2.5.1.2"><p id="dds_api_0084__p7407659">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="22.78%" id="mcps1.3.4.2.1.1.2.5.1.3"><p id="dds_api_0084__p63149496">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="32.12%" id="mcps1.3.4.2.1.1.2.5.1.4"><p id="dds_api_0084__p3731431542">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="dds_api_0084__row9487111115810"><td class="cellrowborder" valign="top" width="21.81%" headers="mcps1.3.4.2.1.1.2.5.1.1 "><p id="dds_api_0084__p94881311135819">restore_collections</p>
</td>
<td class="cellrowborder" valign="top" width="23.29%" headers="mcps1.3.4.2.1.1.2.5.1.2 "><p id="dds_api_0084__p12488411135818">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="22.78%" headers="mcps1.3.4.2.1.1.2.5.1.3 "><p id="dds_api_0084__p18567123455819">Array of objects</p>
</td>
<td class="cellrowborder" valign="top" width="32.12%" headers="mcps1.3.4.2.1.1.2.5.1.4 "><p id="dds_api_0084__p11489174845818">Specifies the database information.</p>
<p id="dds_api_0084__p549155222519">For details, see <a href="#dds_api_0084__table163715367507">Table 3</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="dds_api_0084__table163715367507"></a><a name="table163715367507"></a><table cellpadding="4" cellspacing="0" summary="" id="dds_api_0084__table163715367507" frame="border" border="1" rules="all"><caption><b>Table 3 </b>restore_collections data structure description</caption><thead align="left"><tr id="dds_api_0084__row9637103616501"><th align="left" class="cellrowborder" valign="top" width="21.6%" id="mcps1.3.4.2.1.2.2.5.1.1"><p id="dds_api_0084__p6927161055116">Name</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="23.5%" id="mcps1.3.4.2.1.2.2.5.1.2"><p id="dds_api_0084__p139288103515">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="23.03%" id="mcps1.3.4.2.1.2.2.5.1.3"><p id="dds_api_0084__p1792911005118">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="31.869999999999997%" id="mcps1.3.4.2.1.2.2.5.1.4"><p id="dds_api_0084__p1027310471944">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="dds_api_0084__row1863793617509"><td class="cellrowborder" valign="top" width="21.6%" headers="mcps1.3.4.2.1.2.2.5.1.1 "><p id="dds_api_0084__p22303345174853">database</p>
</td>
<td class="cellrowborder" valign="top" width="23.5%" headers="mcps1.3.4.2.1.2.2.5.1.2 "><p id="dds_api_0084__p61740531174853">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="23.03%" headers="mcps1.3.4.2.1.2.2.5.1.3 "><p id="dds_api_0084__p34927138174853">String</p>
</td>
<td class="cellrowborder" valign="top" width="31.869999999999997%" headers="mcps1.3.4.2.1.2.2.5.1.4 "><p id="dds_api_0084__p1107105519450">Specifies the database name.</p>
</td>
</tr>
<tr id="dds_api_0084__row1637173618507"><td class="cellrowborder" valign="top" width="21.6%" headers="mcps1.3.4.2.1.2.2.5.1.1 "><p id="dds_api_0084__p8056259175641">collections</p>
</td>
<td class="cellrowborder" valign="top" width="23.5%" headers="mcps1.3.4.2.1.2.2.5.1.2 "><p id="dds_api_0084__p48577249175641">No</p>
</td>
<td class="cellrowborder" valign="top" width="23.03%" headers="mcps1.3.4.2.1.2.2.5.1.3 "><p id="dds_api_0084__p42443136175641">Array of objects</p>
</td>
<td class="cellrowborder" valign="top" width="31.869999999999997%" headers="mcps1.3.4.2.1.2.2.5.1.4 "><p id="dds_api_0084__p710720557459">Specifies the collection information.</p>
<p id="dds_api_0084__p9945173582612">For details, see <a href="#dds_api_0084__table168109911">Table 4</a>.</p>
</td>
</tr>
<tr id="dds_api_0084__row75098181583"><td class="cellrowborder" valign="top" width="21.6%" headers="mcps1.3.4.2.1.2.2.5.1.1 "><p id="dds_api_0084__p11404105625820">restore_database_time</p>
</td>
<td class="cellrowborder" valign="top" width="23.5%" headers="mcps1.3.4.2.1.2.2.5.1.2 "><p id="dds_api_0084__p658312255588">No</p>
</td>
<td class="cellrowborder" valign="top" width="23.03%" headers="mcps1.3.4.2.1.2.2.5.1.3 "><p id="dds_api_0084__p25831025185813">String</p>
</td>
<td class="cellrowborder" valign="top" width="31.869999999999997%" headers="mcps1.3.4.2.1.2.2.5.1.4 "><p id="dds_api_0084__p1358392514582">Specifies the database restoration time point.</p>
<p id="dds_api_0084__p9565037175916">This parameter is mandatory for database-level restoration,</p>
<p id="dds_api_0084__p18583152555810">The value is a UNIX timestamp, in milliseconds. The time zone is UTC.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="dds_api_0084__table168109911"></a><a name="table168109911"></a><table cellpadding="4" cellspacing="0" summary="" id="dds_api_0084__table168109911" frame="border" border="1" rules="all"><caption><b>Table 4 </b>collections data structure description</caption><thead align="left"><tr id="dds_api_0084__row13912919110"><th align="left" class="cellrowborder" valign="top" width="23.89%" id="mcps1.3.4.2.1.3.2.5.1.1"><p id="dds_api_0084__p1591191515">Name</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="21.21%" id="mcps1.3.4.2.1.3.2.5.1.2"><p id="dds_api_0084__p69791110">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="22.869999999999997%" id="mcps1.3.4.2.1.3.2.5.1.3"><p id="dds_api_0084__p1999913115">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="32.029999999999994%" id="mcps1.3.4.2.1.3.2.5.1.4"><p id="dds_api_0084__p99991616">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="dds_api_0084__row20917917113"><td class="cellrowborder" valign="top" width="23.89%" headers="mcps1.3.4.2.1.3.2.5.1.1 "><p id="dds_api_0084__p591391314">old_name</p>
</td>
<td class="cellrowborder" valign="top" width="21.21%" headers="mcps1.3.4.2.1.3.2.5.1.2 "><p id="dds_api_0084__p4915920114">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="22.869999999999997%" headers="mcps1.3.4.2.1.3.2.5.1.3 "><p id="dds_api_0084__p1391792112">String</p>
</td>
<td class="cellrowborder" valign="top" width="32.029999999999994%" headers="mcps1.3.4.2.1.3.2.5.1.4 "><p id="dds_api_0084__p1855714244112">Specifies the original table name before the restoration.</p>
</td>
</tr>
<tr id="dds_api_0084__row249919811463"><td class="cellrowborder" valign="top" width="23.89%" headers="mcps1.3.4.2.1.3.2.5.1.1 "><p id="dds_api_0084__p20500118164615">new_name</p>
</td>
<td class="cellrowborder" valign="top" width="21.21%" headers="mcps1.3.4.2.1.3.2.5.1.2 "><p id="dds_api_0084__p175001481468">No</p>
</td>
<td class="cellrowborder" valign="top" width="22.869999999999997%" headers="mcps1.3.4.2.1.3.2.5.1.3 "><p id="dds_api_0084__p105007819462">String</p>
</td>
<td class="cellrowborder" valign="top" width="32.029999999999994%" headers="mcps1.3.4.2.1.3.2.5.1.4 "><p id="dds_api_0084__p350048154612">Specifies the table name after the restoration.</p>
</td>
</tr>
<tr id="dds_api_0084__row185543431002"><td class="cellrowborder" valign="top" width="23.89%" headers="mcps1.3.4.2.1.3.2.5.1.1 "><p id="dds_api_0084__p10661550504">restore_collection_time</p>
</td>
<td class="cellrowborder" valign="top" width="21.21%" headers="mcps1.3.4.2.1.3.2.5.1.2 "><p id="dds_api_0084__p126611501104">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="22.869999999999997%" headers="mcps1.3.4.2.1.3.2.5.1.3 "><p id="dds_api_0084__p166125015016">String</p>
</td>
<td class="cellrowborder" valign="top" width="32.029999999999994%" headers="mcps1.3.4.2.1.3.2.5.1.4 "><p id="dds_api_0084__p1266145011018">Specifies the collection restoration time point.</p>
<p id="dds_api_0084__p17662500010">The value is a UNIX timestamp, in milliseconds. The time zone is UTC.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li><li id="dds_api_0084__li14637152124414">Request example<div class="p" id="dds_api_0084__p855019592398"><a name="dds_api_0084__li14637152124414"></a><a name="li14637152124414"></a>POST https://dds.eu-de.otc.t-systems.com/v3/056538411200d4cd2f79c003c7606412/instances/d5833c2854a4486cb7960f829269e211in02/restore/collections.<ul id="dds_api_0084__ul127922585399"><li id="dds_api_0084__li679211588390">Database-level restoration<pre class="codeblock" id="dds_api_0084__codeblock14792175820396">{
"restore_collections": [
{
"database": "test",
"restore_database_time": 1607762955000
}
]
}</pre>
</li><li id="dds_api_0084__li1379215581391">Collection-level restoration<pre class="codeblock" id="dds_api_0084__codeblock177920582399">{
"restore_collections": [
{
"database": "test",
"collections": [
{
"old_name": "test",
"restore_collection_time": 1607762955000
}
]
}
]
}</pre>
</li></ul>
</div>
</li></ul>
</div>
<div class="section" id="dds_api_0084__section2060402511312"><h4 class="sectiontitle">Responses</h4><ul id="dds_api_0084__ul56045256320"><li id="dds_api_0084__li14604142518313">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dds_api_0084__table760462513318" frame="border" border="1" rules="all"><caption><b>Table 5 </b>Parameter description</caption><thead align="left"><tr id="dds_api_0084__row106058254313"><th align="left" class="cellrowborder" valign="top" width="25.629999999999995%" id="mcps1.3.5.2.1.1.2.4.1.1"><p id="dds_api_0084__p5605725338">Name</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="30.270000000000003%" id="mcps1.3.5.2.1.1.2.4.1.2"><p id="dds_api_0084__p17605425135">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="44.1%" id="mcps1.3.5.2.1.1.2.4.1.3"><p id="dds_api_0084__p36061025737">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="dds_api_0084__row06068251739"><td class="cellrowborder" valign="top" width="25.629999999999995%" headers="mcps1.3.5.2.1.1.2.4.1.1 "><p id="dds_api_0084__p460617257315">job_id</p>
</td>
<td class="cellrowborder" valign="top" width="30.270000000000003%" headers="mcps1.3.5.2.1.1.2.4.1.2 "><p id="dds_api_0084__p166061251439">String</p>
</td>
<td class="cellrowborder" valign="top" width="44.1%" headers="mcps1.3.5.2.1.1.2.4.1.3 "><p id="dds_api_0084__p2060619251315">ID of the asynchronous task for the restore operation.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
<ul id="dds_api_0084__ul19606225836"><li id="dds_api_0084__li76076255313">Response example<pre class="codeblock" id="dds_api_0084__codeblock960712511314">{
"job_id": "a03b1b8a-b756-467c-8a49-38720c3d23ec"
}</pre>
</li></ul>
<ul id="dds_api_0084__ul86076256313"><li id="dds_api_0084__li160718257310">Abnormal Response<p id="dds_api_0084__p146072025839"><a name="dds_api_0084__li160718257310"></a><a name="li160718257310"></a>For details, see <a href="dds_api_0060.html">Abnormal Request Results</a>.</p>
</li></ul>
</div>
<div class="section" id="dds_api_0084__section5382712154838"><h4 class="sectiontitle">Status Code</h4><p id="dds_api_0084__dds_api_0018_p16131712193312">Status Code:200.</p>
<p id="dds_api_0084__dds_api_0018_p480617135329">For more information, see <a href="dds_status_code.html">Status Code</a>.</p>
</div>
<div class="section" id="dds_api_0084__section6522193710339"><h4 class="sectiontitle">Error Code</h4><p id="dds_api_0084__dds_api_0018_p20466124120334">For more information, see <a href="dds_error_code.html">Error Code</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dds_backup_restore.html">Backup and Restoration</a></div>
</div>
</div>