Clone Snapshot API
Introduced 1.0
Creates a clone of all or part of a snapshot in the same repository as the original.
Endpoints
PUT /_snapshot/{repository}/{snapshot}/_clone/{target_snapshot}
Path parameters
The following table lists the available path parameters.
| Parameter | Required | Data type | Description |
|---|---|---|---|
repository | Required | String | The name of repository which will contain the snapshots clone. |
snapshot | Required | String | The name of the original snapshot. |
target_snapshot | Required | String | The name of the cloned snapshot. |
Query parameters
The following table lists the available query parameters. All query parameters are optional.
| Parameter | Data type | Description |
|---|---|---|
cluster_manager_timeout | String | The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see Common parameters. |
Example request
The following request clones indexes index_a and index_b from my_snapshot, a snapshot located in the snapshot repository my-opensearch-repo, into a new snapshot in the same repository called my_new_snapshot:
PUT /_snapshot/my-opensearch-repo/my_snapshot/_clone/my_new_snapshot
{
“indices” : “index_a,index_b”
}response = client.snapshot.clone(
repository = "my-opensearch-repo",
snapshot = "my_snapshot",
target_snapshot = "my_new_snapshot",
body = '''
{
“indices” : “index_a,index_b”
}
'''
)Example response
The successful creation of a snapshot clone returns the following response:
{
"acknowledged" : true
}