WARNING: Deprecated in 7.15.0.
The Java REST Client is deprecated in favor of the Java API Client.
Clone Snapshot API
editClone Snapshot API
editThe Clone Snapshot API clones part or all of a snapshot into a new snapshot.
Request
editA CloneSnapshotRequest
:
CloneSnapshotRequest request = new CloneSnapshotRequest(repositoryName, sourceSnapshotName, targetSnapshotName, indices);
Indices to Clone
editUse indices
to specify a list of indices from the source snapshot to include
in the snapshot clone:
Index Settings and Options
editYou can also customize index settings and options when cloning a snapshot:
Further Arguments
editYou can also provide the following optional arguments:
Synchronous Execution
editAcknowledgedResponse response = client.snapshot().clone(request, RequestOptions.DEFAULT);
Asynchronous Execution
editThe asynchronous execution of a clone snapshot request requires both the
CloneSnapshotRequest
instance and an ActionListener
instance to be
passed to the asynchronous method:
The asynchronous method does not block and returns immediately. Once it is
completed the ActionListener
is called back using the onResponse
method
if the execution successfully completed or using the onFailure
method if
it failed.
A typical listener for AcknowledgedResponse
looks like:
Response
editAcknowledgedResponse
indicates whether the request was received: