Function
This API is used to manually restore a snapshot.
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 | Definition: Project ID. For details about how to obtain the project ID and name, see Obtaining the Project ID and Name. Constraints: N/A Value range: Project ID of the account. Default value: N/A |
cluster_id | Yes | String | Definition: ID of the cluster whose snapshot you want to restore. For details about how to obtain the cluster ID, see Obtaining the Cluster ID. Constraints: N/A Value range: Cluster ID. Default value: N/A |
snapshot_id | Yes | String | Definition: Snapshot ID. Constraints: N/A Value range: N/A Default value: N/A |
Request Parameters
Table 2 Request body parameters Parameter | Mandatory | Type | Description |
|---|
target_cluster | Yes | String | Definition: ID of the cluster that a snapshot is to be restored to. Constraints: 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. The destination cluster must be in the same region as the current cluster, and must have a later version than the current cluster.
Value range: N/A Default value: N/A |
indices | No | String | Definition: Specify the name of the index you want to restore. Constraints: You can use "*" to match multiple indexes. For example, index* indicates that all indexes with the prefix index will be restored. Or you can restore indexes by specifying their names, for example, index1,index2,index3. When "*" is used for index matching, the .opendistro_security index and any system indexes whose name is prefixed with .kibana are filtered out by default. The .opendistro_security index cannot be restored. To restore an index whose name is prefixed with .kibana, you need to specify the index name.
Value range: The value is a string of 0 to 1024 characters that cannot contain uppercase letters, spaces, or the following special characters: "\<|>/? Default value: By default, this parameter is left blank. If you do not specify any index name, all indexes in snapshots will be restored by default. |
rename_pattern | No | String | Definition: Rule for defining the indexes to be restored. Constraints: Indexes that match this rule will be restored. The filtering condition must be a regular expression. The renamePattern and renameReplacement parameters must be set at the same time in order for them to take effect.
Value range: The value can contain 0 to 1,024 characters. Uppercase letters, spaces, and the following special characters are not allowed: "\<|>/? Default value: N/A |
rename_replacement | No | String | Definition: Rule for renaming an index. Constraints: N/A Value range: 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. The renamePattern and renameReplacement parameters must be set at the same time in order for them to take effect.
Default value: N/A |
replace_exist_indices | No | Boolean | Definition: Whether to replace existing indexes. Constraints: N/A Value range: Default value: false |
Response Parameters
Status code: 201
Resource created.
None
Example Requests
Restore a snapshot.
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"
} 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 refused to respond to it. The client should not repeat the request without modifications. |