Restoring a Snapshot
Function
This API is used to manually restore a snapshot.
URI
POST /v1.0/{project_id}/clusters/{cluster_id}/index_snapshot/{snapshot_id}/restore
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
Parameter | Mandatory | Type | Description |
---|---|---|---|
targetCluster | Yes | String | Parameter description: ID of the cluster that a snapshot is to be restored to. |
indices | No | String | Parameter description: Enter the name of the index you want to restore. The default value is empty. If you do not specify any index name, all indexes in snapshots will be restored by default. 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. Options: The value is a string of 0 to 1024 characters that cannot contain uppercase letters, spaces, or the following special characters: "\<|>/? |
renamePattern | No | String | ** Parameter description**: Rule for defining the indices to be restored. The value contains a maximum of 1,024 characters. Restore the indexes that meet the filter criteria. Use regular expressions as the filter criteria. The renamePattern and renameReplacement parameters must be set at the same time to take effect. ** Value range**: The value contains 0 to 1024 characters and cannot contain spaces, uppercase letters, or the following special characters: "\<|>/?, |
renameReplacement | No | String | ** Parameter description**: NOTE: Rule for renaming an index. The value contains 0 to 1024 characters and cannot contain spaces, uppercase letters, or the following special characters: "\<|>/?, For example, restored_index_$1 indicates that restored_ is added before the names of all restored indexes. The renamePattern and renameReplacement parameters must be set at the same time to take effect. |
replace_exist_indices | No | Boolean | ** Parameter description**: Replace the existing index. |
Response Parameters
None
Example Requests
Restore a snapshot.
POST /v1.0/6204a5bd270343b5885144cf9c8c158d/clusters/4f3deec3-efa8-4598-bf91-560aad1377a3/index_snapshot/653c086f-ebe7-4383-b902-c031b354f1dd/restore{"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 refused to respond to it. The client should not repeat the request without modifications. |
Error Codes
See Error Codes.
- URI