Package org.elasticsearch.client
Class SnapshotClient
java.lang.Object
org.elasticsearch.client.SnapshotClient
public final class SnapshotClient
extends java.lang.Object
A wrapper for the
RestHighLevelClient
that provides methods for accessing the Snapshot API.
-
Method Summary
-
Method Details
-
getRepository
public GetRepositoriesResponse getRepository(GetRepositoriesRequest getRepositoriesRequest, RequestOptions options) throws java.io.IOExceptionGets a list of snapshot repositories. If the list of repositories is empty or it contains a single element "_all", all registered repositories are returned. See Snapshot and Restore API on elastic.co- Parameters:
getRepositoriesRequest
- the requestoptions
- the request options (e.g. headers), useRequestOptions.DEFAULT
if nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException
- in case there is a problem sending the request or parsing back the response
-
getRepositoryAsync
public Cancellable getRepositoryAsync(GetRepositoriesRequest getRepositoriesRequest, RequestOptions options, ActionListener<GetRepositoriesResponse> listener)Asynchronously gets a list of snapshot repositories. If the list of repositories is empty or it contains a single element "_all", all registered repositories are returned. See Snapshot and Restore API on elastic.co- Parameters:
getRepositoriesRequest
- the requestoptions
- the request options (e.g. headers), useRequestOptions.DEFAULT
if nothing needs to be customizedlistener
- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
createRepository
public AcknowledgedResponse createRepository(PutRepositoryRequest putRepositoryRequest, RequestOptions options) throws java.io.IOExceptionCreates a snapshot repository. See Snapshot and Restore API on elastic.co- Parameters:
putRepositoryRequest
- the requestoptions
- the request options (e.g. headers), useRequestOptions.DEFAULT
if nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException
- in case there is a problem sending the request or parsing back the response
-
createRepositoryAsync
public Cancellable createRepositoryAsync(PutRepositoryRequest putRepositoryRequest, RequestOptions options, ActionListener<AcknowledgedResponse> listener)Asynchronously creates a snapshot repository. See Snapshot and Restore API on elastic.co- Parameters:
putRepositoryRequest
- the requestoptions
- the request options (e.g. headers), useRequestOptions.DEFAULT
if nothing needs to be customizedlistener
- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
deleteRepository
public AcknowledgedResponse deleteRepository(DeleteRepositoryRequest deleteRepositoryRequest, RequestOptions options) throws java.io.IOExceptionDeletes a snapshot repository. See Snapshot and Restore API on elastic.co- Parameters:
deleteRepositoryRequest
- the requestoptions
- the request options (e.g. headers), useRequestOptions.DEFAULT
if nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException
- in case there is a problem sending the request or parsing back the response
-
deleteRepositoryAsync
public Cancellable deleteRepositoryAsync(DeleteRepositoryRequest deleteRepositoryRequest, RequestOptions options, ActionListener<AcknowledgedResponse> listener)Asynchronously deletes a snapshot repository. See Snapshot and Restore API on elastic.co- Parameters:
deleteRepositoryRequest
- the requestoptions
- the request options (e.g. headers), useRequestOptions.DEFAULT
if nothing needs to be customizedlistener
- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
verifyRepository
public VerifyRepositoryResponse verifyRepository(VerifyRepositoryRequest verifyRepositoryRequest, RequestOptions options) throws java.io.IOExceptionVerifies a snapshot repository. See Snapshot and Restore API on elastic.co- Parameters:
verifyRepositoryRequest
- the requestoptions
- the request options (e.g. headers), useRequestOptions.DEFAULT
if nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException
- in case there is a problem sending the request or parsing back the response
-
verifyRepositoryAsync
public Cancellable verifyRepositoryAsync(VerifyRepositoryRequest verifyRepositoryRequest, RequestOptions options, ActionListener<VerifyRepositoryResponse> listener)Asynchronously verifies a snapshot repository. See Snapshot and Restore API on elastic.co- Parameters:
verifyRepositoryRequest
- the requestoptions
- the request options (e.g. headers), useRequestOptions.DEFAULT
if nothing needs to be customizedlistener
- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
cleanupRepository
public CleanupRepositoryResponse cleanupRepository(CleanupRepositoryRequest cleanupRepositoryRequest, RequestOptions options) throws java.io.IOExceptionCleans up a snapshot repository. See Snapshot and Restore API on elastic.co- Parameters:
cleanupRepositoryRequest
- the requestoptions
- the request options (e.g. headers), useRequestOptions.DEFAULT
if nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException
- in case there is a problem sending the request or parsing back the response
-
cleanupRepositoryAsync
public Cancellable cleanupRepositoryAsync(CleanupRepositoryRequest cleanupRepositoryRequest, RequestOptions options, ActionListener<CleanupRepositoryResponse> listener)Asynchronously cleans up a snapshot repository. See Snapshot and Restore API on elastic.co- Parameters:
cleanupRepositoryRequest
- the requestoptions
- the request options (e.g. headers), useRequestOptions.DEFAULT
if nothing needs to be customizedlistener
- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
create
public CreateSnapshotResponse create(CreateSnapshotRequest createSnapshotRequest, RequestOptions options) throws java.io.IOExceptionCreates a snapshot.- Throws:
java.io.IOException
-
createAsync
public Cancellable createAsync(CreateSnapshotRequest createSnapshotRequest, RequestOptions options, ActionListener<CreateSnapshotResponse> listener)Asynchronously creates a snapshot.- Returns:
- cancellable that may be used to cancel the request
-
get
public GetSnapshotsResponse get(GetSnapshotsRequest getSnapshotsRequest, RequestOptions options) throws java.io.IOExceptionGet snapshots. See Snapshot and Restore API on elastic.co- Parameters:
getSnapshotsRequest
- the requestoptions
- the request options (e.g. headers), useRequestOptions.DEFAULT
if nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException
- in case there is a problem sending the request or parsing back the response
-
getAsync
public Cancellable getAsync(GetSnapshotsRequest getSnapshotsRequest, RequestOptions options, ActionListener<GetSnapshotsResponse> listener)Asynchronously get snapshots. See Snapshot and Restore API on elastic.co- Parameters:
getSnapshotsRequest
- the requestoptions
- the request options (e.g. headers), useRequestOptions.DEFAULT
if nothing needs to be customizedlistener
- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
status
public SnapshotsStatusResponse status(SnapshotsStatusRequest snapshotsStatusRequest, RequestOptions options) throws java.io.IOExceptionGets the status of requested snapshots. See Snapshot and Restore API on elastic.co- Parameters:
snapshotsStatusRequest
- the requestoptions
- the request options (e.g. headers), useRequestOptions.DEFAULT
if nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException
- in case there is a problem sending the request or parsing back the response
-
statusAsync
public Cancellable statusAsync(SnapshotsStatusRequest snapshotsStatusRequest, RequestOptions options, ActionListener<SnapshotsStatusResponse> listener)Asynchronously gets the status of requested snapshots. See Snapshot and Restore API on elastic.co- Parameters:
snapshotsStatusRequest
- the requestoptions
- the request options (e.g. headers), useRequestOptions.DEFAULT
if nothing needs to be customizedlistener
- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
restore
public RestoreSnapshotResponse restore(RestoreSnapshotRequest restoreSnapshotRequest, RequestOptions options) throws java.io.IOExceptionRestores a snapshot. See Snapshot and Restore API on elastic.co- Parameters:
restoreSnapshotRequest
- the requestoptions
- the request options (e.g. headers), useRequestOptions.DEFAULT
if nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException
- in case there is a problem sending the request or parsing back the response
-
restoreAsync
public Cancellable restoreAsync(RestoreSnapshotRequest restoreSnapshotRequest, RequestOptions options, ActionListener<RestoreSnapshotResponse> listener)Asynchronously restores a snapshot. See Snapshot and Restore API on elastic.co- Parameters:
restoreSnapshotRequest
- the requestoptions
- the request options (e.g. headers), useRequestOptions.DEFAULT
if nothing needs to be customizedlistener
- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
delete
public AcknowledgedResponse delete(DeleteSnapshotRequest deleteSnapshotRequest, RequestOptions options) throws java.io.IOExceptionDeletes a snapshot. See Snapshot and Restore API on elastic.co- Parameters:
deleteSnapshotRequest
- the requestoptions
- the request options (e.g. headers), useRequestOptions.DEFAULT
if nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException
- in case there is a problem sending the request or parsing back the response
-
deleteAsync
public Cancellable deleteAsync(DeleteSnapshotRequest deleteSnapshotRequest, RequestOptions options, ActionListener<AcknowledgedResponse> listener)Asynchronously deletes a snapshot. See Snapshot and Restore API on elastic.co- Parameters:
deleteSnapshotRequest
- the requestoptions
- the request options (e.g. headers), useRequestOptions.DEFAULT
if nothing needs to be customizedlistener
- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-