Updated on 2023-04-14 GMT+08:00

Restoring a Snapshot

Function

This API is used to manually restore a snapshot.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.

URI

POST /v1.0/{project_id}/clusters/{cluster_id}/index_snapshot/{snapshot_id}/restore

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain the project ID and name, see Obtaining the Project ID and Name.

cluster_id

Yes

String

ID of the cluster whose snapshot you want to restore.

snapshot_id

Yes

String

Snapshot ID.

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

targetCluster

Yes

String

ID of the cluster that a snapshot is to be restored to.

indices

No

String

Name of an index to be restored. Multiple indexes are separated by commas (,). By default, all indexes are restored. You can use \ * to match multiple indexes. For example, if you specify 2018-06*, then the data of the indexes with the prefix 2018-06 will be restored.The value can contain 0 to 1,024 characters. Uppercase letters, spaces, and the following special characters are not allowed: "\<|>/?

renamePattern

No

String

Rule for defining the indexes to be restored. The value contains a maximum of 1,024 characters. Indexes that match this rule will be restored. The filtering condition must be a regular expression.

The value can contain 0 to 1,024 characters. Uppercase letters, spaces, and the following special characters are not allowed: "\<|>/?

This parameter takes effect only when both renameReplacement and renamePattern are set.

renameReplacement

No

String

Rule for renaming an index. The value can contain 0 to 1,024 characters. Uppercase letters, spaces, and the following special characters are not allowed: "\<|>/? For example, restored_index_$1 indicates adding the restored_ prefix to the names of all the restored indexes.This parameter takes effect only when both renameReplacement and renamePattern are set.

Response Parameters

None

Example Requests

{
  "targetCluster" : "ea244205-d641-45d9-9dcb-ab2236bcd07e",
  "indices" : "myindex1,myindex2",
  "renamePattern" : "index",
  "renameReplacement" : "restored_index_$1"
}

Example Responses

None

Status Codes

Status Code

Description

201

Resource created.

400

Invalid request.

Modify the request before retry.

403

Request rejected.The server has received the request and understood it, but the server refuses to respond to it. The client should not repeat the request without modifications.

Error Codes

See Error Codes.