Files
doc-exports/docs/css/api-ref/RestoreSnapshot.html
zhengxiu 8f6b8d3664 css api 25.6.0 version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: zhengxiu <zhengxiu@huawei.com>
Co-committed-by: zhengxiu <zhengxiu@huawei.com>
2025-11-25 11:21:12 +00:00

232 lines
20 KiB
HTML

<a name="RestoreSnapshot"></a><a name="RestoreSnapshot"></a>
<h1 class="topictitle1">Restoring a Snapshot</h1>
<div id="body1708331107508"><div class="section" id="RestoreSnapshot__section21281044201118"><h4 class="sectiontitle">Function</h4><p id="RestoreSnapshot__p912944418112">This API is used to manually restore a snapshot.</p>
</div>
<div class="section" id="RestoreSnapshot__section112920446112"><h4 class="sectiontitle">Calling Method</h4><p id="RestoreSnapshot__p1812984410114">For details, see <a href="css_03_0077.html">Calling APIs</a>.</p>
</div>
<div class="section" id="RestoreSnapshot__section201291144161114"><h4 class="sectiontitle">URI</h4><p id="RestoreSnapshot__p6129154481113">POST /v1.0/{project_id}/clusters/{cluster_id}/index_snapshot/{snapshot_id}/restore</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="RestoreSnapshot__table10130844181118" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Path Parameters</caption><thead align="left"><tr id="RestoreSnapshot__row113015441111"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.1"><p id="RestoreSnapshot__p113084411114">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.2"><p id="RestoreSnapshot__p15130174410117">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.3"><p id="RestoreSnapshot__p9130744191118">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.3.2.5.1.4"><p id="RestoreSnapshot__p121307448113">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="RestoreSnapshot__row213014401113"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="RestoreSnapshot__p11130244131117">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="RestoreSnapshot__p113044418117">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="RestoreSnapshot__p1313184413115">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="RestoreSnapshot__p313184441115"><strong id="RestoreSnapshot__b613112447112">Definition</strong>:</p>
<p id="RestoreSnapshot__p171311544191113">Project ID. For details about how to obtain the project ID and name, see <a href="css_03_0071.html">Obtaining the Project ID and Name</a>.</p>
<p id="RestoreSnapshot__p15131644121115"><strong id="RestoreSnapshot__b1513144418117">Constraints</strong>:</p>
<p id="RestoreSnapshot__p111318446112">N/A</p>
<p id="RestoreSnapshot__p31311444171118"><strong id="RestoreSnapshot__b7131194421117">Value range</strong>:</p>
<p id="RestoreSnapshot__p213114461116">Project ID of the account.</p>
<p id="RestoreSnapshot__p131310448117"><strong id="RestoreSnapshot__b111311844191110">Default value</strong>:</p>
<p id="RestoreSnapshot__p81311944121116">N/A</p>
</td>
</tr>
<tr id="RestoreSnapshot__row713014471111"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="RestoreSnapshot__p16131164412112">cluster_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="RestoreSnapshot__p613115445118">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="RestoreSnapshot__p17131244101118">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="RestoreSnapshot__p1113244410115"><strong id="RestoreSnapshot__b16132174401113">Definition</strong>:</p>
<p id="RestoreSnapshot__p1613264420116">ID of the cluster whose snapshot you want to restore. For details about how to obtain the cluster ID, see <a href="css_03_0101.html">Obtaining the Cluster ID</a>.</p>
<p id="RestoreSnapshot__p113264413117"><strong id="RestoreSnapshot__b013224417112">Constraints</strong>:</p>
<p id="RestoreSnapshot__p11132944191117">N/A</p>
<p id="RestoreSnapshot__p91321144161118"><strong id="RestoreSnapshot__b4132124441120">Value range</strong>:</p>
<p id="RestoreSnapshot__p1113224416115">Cluster ID.</p>
<p id="RestoreSnapshot__p101328443118"><strong id="RestoreSnapshot__b81321844141116">Default value</strong>:</p>
<p id="RestoreSnapshot__p2132844151112">N/A</p>
</td>
</tr>
<tr id="RestoreSnapshot__row81300442117"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="RestoreSnapshot__p1313234461119">snapshot_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="RestoreSnapshot__p91320445113">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="RestoreSnapshot__p13132124451116">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="RestoreSnapshot__p2132114415112"><strong id="RestoreSnapshot__b151321944121111">Definition</strong>:</p>
<p id="RestoreSnapshot__p51325448118">Snapshot ID.</p>
<p id="RestoreSnapshot__p01321744131120"><strong id="RestoreSnapshot__b313210446110">Constraints</strong>:</p>
<p id="RestoreSnapshot__p12133134471118">N/A</p>
<p id="RestoreSnapshot__p9133144191110"><strong id="RestoreSnapshot__b10133144414113">Value range</strong>:</p>
<p id="RestoreSnapshot__p51337445116">N/A</p>
<p id="RestoreSnapshot__p9133154415116"><strong id="RestoreSnapshot__b16133144421116">Default value</strong>:</p>
<p id="RestoreSnapshot__p131331544151117">N/A</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="RestoreSnapshot__section10133544151117"><h4 class="sectiontitle">Request Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="RestoreSnapshot__request_RestoreSnapshotReq" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request body parameters</caption><thead align="left"><tr id="RestoreSnapshot__row2134544151112"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.2.2.5.1.1"><p id="RestoreSnapshot__p0143134419115">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.2.2.5.1.2"><p id="RestoreSnapshot__p14143124461110">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.2.2.5.1.3"><p id="RestoreSnapshot__p11431644171117">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.4.2.2.5.1.4"><p id="RestoreSnapshot__p6146124417114">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="RestoreSnapshot__row1613404414118"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.1 "><p id="RestoreSnapshot__p131461944101117">target_cluster</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.2 "><p id="RestoreSnapshot__p11146174415114">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.3 "><p id="RestoreSnapshot__p1114615440116">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.4.2.2.5.1.4 "><p id="RestoreSnapshot__p81461044191115"><strong id="RestoreSnapshot__b91473442116">Definition</strong>:</p>
<p id="RestoreSnapshot__p21471144131110">ID of the cluster that a snapshot is to be restored to.</p>
<p id="RestoreSnapshot__p151471344131116"><strong id="RestoreSnapshot__b141471044181116">Constraints</strong>:</p>
<ul id="RestoreSnapshot__ul9147244181117"><li id="RestoreSnapshot__li41479445118"><p id="RestoreSnapshot__p8147164417117"><a name="RestoreSnapshot__li41479445118"></a><a name="li41479445118"></a>If the current cluster is available, snapshots are restored to the current cluster by default. Alternatively, you can choose to restore them to another specified cluster.</p>
</li><li id="RestoreSnapshot__li3147744141112"><p id="RestoreSnapshot__p1314714451113"><a name="RestoreSnapshot__li3147744141112"></a><a name="li3147744141112"></a>The destination cluster must be in the same region as the current cluster, and must have a later version than the current cluster.</p>
</li></ul>
<p id="RestoreSnapshot__p81479440118"><strong id="RestoreSnapshot__b121472443117">Value range</strong>:</p>
<p id="RestoreSnapshot__p141471446119">N/A</p>
<p id="RestoreSnapshot__p1514714448116"><strong id="RestoreSnapshot__b8147844171114">Default value</strong>:</p>
<p id="RestoreSnapshot__p614718441117">N/A</p>
</td>
</tr>
<tr id="RestoreSnapshot__row91341644191110"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.1 "><p id="RestoreSnapshot__p114714419116">indices</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.2 "><p id="RestoreSnapshot__p114711440110">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.3 "><p id="RestoreSnapshot__p13147194419116">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.4.2.2.5.1.4 "><p id="RestoreSnapshot__p111488441111"><strong id="RestoreSnapshot__b1514884461114">Definition</strong>:</p>
<p id="RestoreSnapshot__p161486445113">Specify the name of the index you want to restore.</p>
<p id="RestoreSnapshot__p181480448111"><strong id="RestoreSnapshot__b6148114441113">Constraints</strong>:</p>
<p id="RestoreSnapshot__p31481344141115">You can use "*" to match multiple indexes. For example, index* indicates that all indexes with the prefix <strong id="RestoreSnapshot__b41483442118">index</strong> will be restored.</p>
<ul id="RestoreSnapshot__ul12148114411114"><li id="RestoreSnapshot__li15148184416115"><p id="RestoreSnapshot__p1114816448112"><a name="RestoreSnapshot__li15148184416115"></a><a name="li15148184416115"></a>Or you can restore indexes by specifying their names, for example, index1,index2,index3.</p>
</li><li id="RestoreSnapshot__li21489445118"><p id="RestoreSnapshot__p814814413114"><a name="RestoreSnapshot__li21489445118"></a><a name="li21489445118"></a>When "*" is used for index matching, the <strong id="RestoreSnapshot__b14148184419115">.opendistro_security</strong> index and any system indexes whose name is prefixed with <strong id="RestoreSnapshot__b12148744101111">.kibana</strong> are filtered out by default. The <strong id="RestoreSnapshot__b10148204410111">.opendistro_security</strong> index cannot be restored. To restore an index whose name is prefixed with <strong id="RestoreSnapshot__b1614824461113">.kibana</strong>, you need to specify the index name.</p>
</li></ul>
<p id="RestoreSnapshot__p2014810442111"><strong id="RestoreSnapshot__b1114844471112">Value range</strong>:</p>
<p id="RestoreSnapshot__p17148184461116">The value is a string of 0 to 1024 characters that cannot contain uppercase letters, spaces, or the following special characters: "\&lt;|&gt;/?</p>
<p id="RestoreSnapshot__p71481344131111"><strong id="RestoreSnapshot__b12148744111114">Default value</strong>:</p>
<p id="RestoreSnapshot__p121481444161119">By default, this parameter is left blank.</p>
<p id="RestoreSnapshot__p131491244141120">If you do not specify any index name, all indexes in snapshots will be restored by default.</p>
</td>
</tr>
<tr id="RestoreSnapshot__row1013464491117"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.1 "><p id="RestoreSnapshot__p1014944418118">rename_pattern</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.2 "><p id="RestoreSnapshot__p1214934491111">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.3 "><p id="RestoreSnapshot__p2149124419112">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.4.2.2.5.1.4 "><p id="RestoreSnapshot__p13149744101119"><strong id="RestoreSnapshot__b5149144161112">Definition</strong>:</p>
<p id="RestoreSnapshot__p81498448113">Rule for defining the indexes to be restored.</p>
<p id="RestoreSnapshot__p11149104451119"><strong id="RestoreSnapshot__b1814994401114">Constraints</strong>:</p>
<ul id="RestoreSnapshot__ul014954471115"><li id="RestoreSnapshot__li1149134421115"><p id="RestoreSnapshot__p171491844191116"><a name="RestoreSnapshot__li1149134421115"></a><a name="li1149134421115"></a>Indexes that match this rule will be restored. The filtering condition must be a regular expression.</p>
</li><li id="RestoreSnapshot__li0149544131113"><p id="RestoreSnapshot__p314924491118"><a name="RestoreSnapshot__li0149544131113"></a><a name="li0149544131113"></a>The renamePattern and renameReplacement parameters must be set at the same time in order for them to take effect.</p>
</li></ul>
<p id="RestoreSnapshot__p1814944413118"><strong id="RestoreSnapshot__b2149174441112">Value range</strong>:</p>
<p id="RestoreSnapshot__p5149444191114">The value can contain 0 to 1,024 characters. Uppercase letters, spaces, and the following special characters are not allowed: "\&lt;|&gt;/?</p>
<p id="RestoreSnapshot__p19149184414110"><strong id="RestoreSnapshot__b17149114414115">Default value</strong>:</p>
<p id="RestoreSnapshot__p1149744111115">N/A</p>
</td>
</tr>
<tr id="RestoreSnapshot__row19134194461115"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.1 "><p id="RestoreSnapshot__p9150104414116">rename_replacement</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.2 "><p id="RestoreSnapshot__p1615014401116">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.3 "><p id="RestoreSnapshot__p181501144191117">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.4.2.2.5.1.4 "><p id="RestoreSnapshot__p11150644131111"><strong id="RestoreSnapshot__b1415004414118">Definition</strong>:</p>
<p id="RestoreSnapshot__p121503445112">Rule for renaming an index.</p>
<p id="RestoreSnapshot__p115064441116"><strong id="RestoreSnapshot__b16150134461114">Constraints</strong>:</p>
<p id="RestoreSnapshot__p2150104421118">N/A</p>
<p id="RestoreSnapshot__p2150124431116"><strong id="RestoreSnapshot__b315054421120">Value range</strong>:</p>
<ul id="RestoreSnapshot__ul21505445113"><li id="RestoreSnapshot__li1915014412116"><p id="RestoreSnapshot__p9150104417118"><a name="RestoreSnapshot__li1915014412116"></a><a name="li1915014412116"></a>The value can contain 0 to 1,024 characters. Uppercase letters, spaces, and the following special characters are not allowed: "\&lt;|&gt;/? For example, <strong id="RestoreSnapshot__b12150114413111">restored_index_$1</strong> indicates adding the <strong id="RestoreSnapshot__b201501244111118">restored_</strong> prefix to the names of all the restored indexes.</p>
</li><li id="RestoreSnapshot__li71501344171110"><p id="RestoreSnapshot__p1015017443119"><a name="RestoreSnapshot__li71501344171110"></a><a name="li71501344171110"></a>The renamePattern and renameReplacement parameters must be set at the same time in order for them to take effect.</p>
</li></ul>
<p id="RestoreSnapshot__p16150344191110"><strong id="RestoreSnapshot__b915064441120">Default value</strong>:</p>
<p id="RestoreSnapshot__p19150244191118">N/A</p>
</td>
</tr>
<tr id="RestoreSnapshot__row141345441116"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.1 "><p id="RestoreSnapshot__p121501444181114">replace_exist_indices</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.2 "><p id="RestoreSnapshot__p81511944131119">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.3 "><p id="RestoreSnapshot__p615144441120">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.4.2.2.5.1.4 "><p id="RestoreSnapshot__p61511044141119"><strong id="RestoreSnapshot__b17151144141118">Definition</strong>:</p>
<p id="RestoreSnapshot__p1215124491110">Whether to replace existing indexes.</p>
<p id="RestoreSnapshot__p18151184491118"><strong id="RestoreSnapshot__b4151124417117">Constraints</strong>:</p>
<p id="RestoreSnapshot__p13151164491118">N/A</p>
<p id="RestoreSnapshot__p19151044141118"><strong id="RestoreSnapshot__b14151244171117">Value range</strong>:</p>
<ul id="RestoreSnapshot__ul10151644131112"><li id="RestoreSnapshot__li41518447119"><p id="RestoreSnapshot__p1815174431113"><a name="RestoreSnapshot__li41518447119"></a><a name="li41518447119"></a>false: Do not replace existing indexes.</p>
</li><li id="RestoreSnapshot__li91511044101111"><p id="RestoreSnapshot__p1151154418112"><a name="RestoreSnapshot__li91511044101111"></a><a name="li91511044101111"></a>true: Replace existing indexes.</p>
</li></ul>
<p id="RestoreSnapshot__p14151144121118"><strong id="RestoreSnapshot__b8151194419112">Default value</strong>:</p>
<p id="RestoreSnapshot__p1415110442115">false</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="RestoreSnapshot__section15151164415116"><h4 class="sectiontitle">Response Parameters</h4><p id="RestoreSnapshot__p13152244131120"><strong id="RestoreSnapshot__b715218443110">Status code: 201</strong></p>
<p id="RestoreSnapshot__p19152104451118">Resource created.</p>
<p id="RestoreSnapshot__p1015244411111">None</p>
</div>
<div class="section" id="RestoreSnapshot__section19152644111117"><h4 class="sectiontitle">Example Requests</h4><p id="RestoreSnapshot__p1515214441116">Restore a snapshot.</p>
<pre class="screen" id="RestoreSnapshot__screen15152744141110">POST https://{Endpoint}/v1.0/{project_id}/clusters/4f3deec3-efa8-4598-bf91-560aad1377a3/index_snapshot/653c086f-ebe7-4383-b902-c031b354f1dd/restore
{
"target_cluster" : "ea244205-d641-45d9-9dcb-ab2236bcd07e",
"indices" : "myindex1,myindex2",
"rename_pattern" : "index",
"rename_replacement" : "restored_index_$1"
}</pre>
</div>
<div class="section" id="RestoreSnapshot__section12152144181115"><h4 class="sectiontitle">Example Responses</h4><p id="RestoreSnapshot__p181521444181115">None</p>
</div>
<div class="section" id="RestoreSnapshot__section132871944101115"><h4 class="sectiontitle">Status Codes</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="RestoreSnapshot__status_code" frame="border" border="1" rules="all"><thead align="left"><tr id="RestoreSnapshot__row13160144471112"><th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.8.2.1.3.1.1"><p id="RestoreSnapshot__p42879444113">Status Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="85%" id="mcps1.3.8.2.1.3.1.2"><p id="RestoreSnapshot__p162877446115">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="RestoreSnapshot__row18160164419114"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.8.2.1.3.1.1 "><p id="RestoreSnapshot__p112872443114">201</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.8.2.1.3.1.2 "><p id="RestoreSnapshot__p1828784451110">Resource created.</p>
</td>
</tr>
<tr id="RestoreSnapshot__row15161244111115"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.8.2.1.3.1.1 "><p id="RestoreSnapshot__p82875447119">400</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.8.2.1.3.1.2 "><p id="RestoreSnapshot__p14287164411110">Invalid request.</p>
<p id="RestoreSnapshot__p1328784441113">Modify the request before retry.</p>
</td>
</tr>
<tr id="RestoreSnapshot__row12161134431112"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.8.2.1.3.1.1 "><p id="RestoreSnapshot__p1728794418116">403</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.8.2.1.3.1.2 "><p id="RestoreSnapshot__p14287344161114">Request rejected.</p>
<p id="RestoreSnapshot__p11287194471110">The server has received the request and understood it, but refused to respond to it. The client should not repeat the request without modifications.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="RestoreSnapshot__section1528716440110"><h4 class="sectiontitle">Error Codes</h4><p id="RestoreSnapshot__p1228744414115">See <a href="css_03_0076.html">Error Codes</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="snapshot_management.html">Snapshot Management</a></div>
</div>
</div>