Class SnapshotClient


  • public final class SnapshotClient
    extends java.lang.Object
    A wrapper for the RestHighLevelClient that provides methods for accessing the Snapshot API.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.opensearch.action.admin.cluster.repositories.cleanup.CleanupRepositoryResponse cleanupRepository​(org.opensearch.action.admin.cluster.repositories.cleanup.CleanupRepositoryRequest cleanupRepositoryRequest, org.opensearch.client.RequestOptions options)
      Cleans up a snapshot repository.
      org.opensearch.client.Cancellable cleanupRepositoryAsync​(org.opensearch.action.admin.cluster.repositories.cleanup.CleanupRepositoryRequest cleanupRepositoryRequest, org.opensearch.client.RequestOptions options, org.opensearch.action.ActionListener<org.opensearch.action.admin.cluster.repositories.cleanup.CleanupRepositoryResponse> listener)
      Asynchronously cleans up a snapshot repository.
      org.opensearch.action.support.master.AcknowledgedResponse clone​(org.opensearch.action.admin.cluster.snapshots.clone.CloneSnapshotRequest cloneSnapshotRequest, org.opensearch.client.RequestOptions options)
      Clones a snapshot.
      org.opensearch.client.Cancellable cloneAsync​(org.opensearch.action.admin.cluster.snapshots.clone.CloneSnapshotRequest cloneSnapshotRequest, org.opensearch.client.RequestOptions options, org.opensearch.action.ActionListener<org.opensearch.action.support.master.AcknowledgedResponse> listener)
      Asynchronously clones a snapshot.
      org.opensearch.action.admin.cluster.snapshots.create.CreateSnapshotResponse create​(org.opensearch.action.admin.cluster.snapshots.create.CreateSnapshotRequest createSnapshotRequest, org.opensearch.client.RequestOptions options)
      Creates a snapshot.
      org.opensearch.client.Cancellable createAsync​(org.opensearch.action.admin.cluster.snapshots.create.CreateSnapshotRequest createSnapshotRequest, org.opensearch.client.RequestOptions options, org.opensearch.action.ActionListener<org.opensearch.action.admin.cluster.snapshots.create.CreateSnapshotResponse> listener)
      Asynchronously creates a snapshot.
      org.opensearch.action.support.master.AcknowledgedResponse createRepository​(org.opensearch.action.admin.cluster.repositories.put.PutRepositoryRequest putRepositoryRequest, org.opensearch.client.RequestOptions options)
      Creates a snapshot repository.
      org.opensearch.client.Cancellable createRepositoryAsync​(org.opensearch.action.admin.cluster.repositories.put.PutRepositoryRequest putRepositoryRequest, org.opensearch.client.RequestOptions options, org.opensearch.action.ActionListener<org.opensearch.action.support.master.AcknowledgedResponse> listener)
      Asynchronously creates a snapshot repository.
      org.opensearch.action.support.master.AcknowledgedResponse delete​(org.opensearch.action.admin.cluster.snapshots.delete.DeleteSnapshotRequest deleteSnapshotRequest, org.opensearch.client.RequestOptions options)
      Deletes a snapshot.
      org.opensearch.client.Cancellable deleteAsync​(org.opensearch.action.admin.cluster.snapshots.delete.DeleteSnapshotRequest deleteSnapshotRequest, org.opensearch.client.RequestOptions options, org.opensearch.action.ActionListener<org.opensearch.action.support.master.AcknowledgedResponse> listener)
      Asynchronously deletes a snapshot.
      org.opensearch.action.support.master.AcknowledgedResponse deleteRepository​(org.opensearch.action.admin.cluster.repositories.delete.DeleteRepositoryRequest deleteRepositoryRequest, org.opensearch.client.RequestOptions options)
      Deletes a snapshot repository.
      org.opensearch.client.Cancellable deleteRepositoryAsync​(org.opensearch.action.admin.cluster.repositories.delete.DeleteRepositoryRequest deleteRepositoryRequest, org.opensearch.client.RequestOptions options, org.opensearch.action.ActionListener<org.opensearch.action.support.master.AcknowledgedResponse> listener)
      Asynchronously deletes a snapshot repository.
      org.opensearch.action.admin.cluster.snapshots.get.GetSnapshotsResponse get​(org.opensearch.action.admin.cluster.snapshots.get.GetSnapshotsRequest getSnapshotsRequest, org.opensearch.client.RequestOptions options)
      Get snapshots.
      org.opensearch.client.Cancellable getAsync​(org.opensearch.action.admin.cluster.snapshots.get.GetSnapshotsRequest getSnapshotsRequest, org.opensearch.client.RequestOptions options, org.opensearch.action.ActionListener<org.opensearch.action.admin.cluster.snapshots.get.GetSnapshotsResponse> listener)
      Asynchronously get snapshots.
      org.opensearch.action.admin.cluster.repositories.get.GetRepositoriesResponse getRepository​(org.opensearch.action.admin.cluster.repositories.get.GetRepositoriesRequest getRepositoriesRequest, org.opensearch.client.RequestOptions options)
      Gets a list of snapshot repositories.
      org.opensearch.client.Cancellable getRepositoryAsync​(org.opensearch.action.admin.cluster.repositories.get.GetRepositoriesRequest getRepositoriesRequest, org.opensearch.client.RequestOptions options, org.opensearch.action.ActionListener<org.opensearch.action.admin.cluster.repositories.get.GetRepositoriesResponse> listener)
      Asynchronously gets a list of snapshot repositories.
      org.opensearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse restore​(org.opensearch.action.admin.cluster.snapshots.restore.RestoreSnapshotRequest restoreSnapshotRequest, org.opensearch.client.RequestOptions options)
      Restores a snapshot.
      org.opensearch.client.Cancellable restoreAsync​(org.opensearch.action.admin.cluster.snapshots.restore.RestoreSnapshotRequest restoreSnapshotRequest, org.opensearch.client.RequestOptions options, org.opensearch.action.ActionListener<org.opensearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse> listener)
      Asynchronously restores a snapshot.
      org.opensearch.action.admin.cluster.snapshots.status.SnapshotsStatusResponse status​(org.opensearch.action.admin.cluster.snapshots.status.SnapshotsStatusRequest snapshotsStatusRequest, org.opensearch.client.RequestOptions options)
      Gets the status of requested snapshots.
      org.opensearch.client.Cancellable statusAsync​(org.opensearch.action.admin.cluster.snapshots.status.SnapshotsStatusRequest snapshotsStatusRequest, org.opensearch.client.RequestOptions options, org.opensearch.action.ActionListener<org.opensearch.action.admin.cluster.snapshots.status.SnapshotsStatusResponse> listener)
      Asynchronously gets the status of requested snapshots.
      org.opensearch.action.admin.cluster.repositories.verify.VerifyRepositoryResponse verifyRepository​(org.opensearch.action.admin.cluster.repositories.verify.VerifyRepositoryRequest verifyRepositoryRequest, org.opensearch.client.RequestOptions options)
      Verifies a snapshot repository.
      org.opensearch.client.Cancellable verifyRepositoryAsync​(org.opensearch.action.admin.cluster.repositories.verify.VerifyRepositoryRequest verifyRepositoryRequest, org.opensearch.client.RequestOptions options, org.opensearch.action.ActionListener<org.opensearch.action.admin.cluster.repositories.verify.VerifyRepositoryResponse> listener)
      Asynchronously verifies a snapshot repository.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getRepository

        public org.opensearch.action.admin.cluster.repositories.get.GetRepositoriesResponse getRepository​(org.opensearch.action.admin.cluster.repositories.get.GetRepositoriesRequest getRepositoriesRequest,
                                                                                                          org.opensearch.client.RequestOptions options)
                                                                                                   throws java.io.IOException
        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.
        Parameters:
        getRepositoriesRequest - the request
        options - the request options (e.g. headers), use RequestOptions.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 org.opensearch.client.Cancellable getRepositoryAsync​(org.opensearch.action.admin.cluster.repositories.get.GetRepositoriesRequest getRepositoriesRequest,
                                                                    org.opensearch.client.RequestOptions options,
                                                                    org.opensearch.action.ActionListener<org.opensearch.action.admin.cluster.repositories.get.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.
        Parameters:
        getRepositoriesRequest - the request
        options - the request options (e.g. headers), use RequestOptions.DEFAULT if nothing needs to be customized
        listener - the listener to be notified upon request completion
        Returns:
        cancellable that may be used to cancel the request
      • createRepository

        public org.opensearch.action.support.master.AcknowledgedResponse createRepository​(org.opensearch.action.admin.cluster.repositories.put.PutRepositoryRequest putRepositoryRequest,
                                                                                          org.opensearch.client.RequestOptions options)
                                                                                   throws java.io.IOException
        Creates a snapshot repository.
        Parameters:
        putRepositoryRequest - the request
        options - the request options (e.g. headers), use RequestOptions.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 org.opensearch.client.Cancellable createRepositoryAsync​(org.opensearch.action.admin.cluster.repositories.put.PutRepositoryRequest putRepositoryRequest,
                                                                       org.opensearch.client.RequestOptions options,
                                                                       org.opensearch.action.ActionListener<org.opensearch.action.support.master.AcknowledgedResponse> listener)
        Asynchronously creates a snapshot repository.
        Parameters:
        putRepositoryRequest - the request
        options - the request options (e.g. headers), use RequestOptions.DEFAULT if nothing needs to be customized
        listener - the listener to be notified upon request completion
        Returns:
        cancellable that may be used to cancel the request
      • deleteRepository

        public org.opensearch.action.support.master.AcknowledgedResponse deleteRepository​(org.opensearch.action.admin.cluster.repositories.delete.DeleteRepositoryRequest deleteRepositoryRequest,
                                                                                          org.opensearch.client.RequestOptions options)
                                                                                   throws java.io.IOException
        Deletes a snapshot repository.
        Parameters:
        deleteRepositoryRequest - the request
        options - the request options (e.g. headers), use RequestOptions.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 org.opensearch.client.Cancellable deleteRepositoryAsync​(org.opensearch.action.admin.cluster.repositories.delete.DeleteRepositoryRequest deleteRepositoryRequest,
                                                                       org.opensearch.client.RequestOptions options,
                                                                       org.opensearch.action.ActionListener<org.opensearch.action.support.master.AcknowledgedResponse> listener)
        Asynchronously deletes a snapshot repository.
        Parameters:
        deleteRepositoryRequest - the request
        options - the request options (e.g. headers), use RequestOptions.DEFAULT if nothing needs to be customized
        listener - the listener to be notified upon request completion
        Returns:
        cancellable that may be used to cancel the request
      • verifyRepository

        public org.opensearch.action.admin.cluster.repositories.verify.VerifyRepositoryResponse verifyRepository​(org.opensearch.action.admin.cluster.repositories.verify.VerifyRepositoryRequest verifyRepositoryRequest,
                                                                                                                 org.opensearch.client.RequestOptions options)
                                                                                                          throws java.io.IOException
        Verifies a snapshot repository.
        Parameters:
        verifyRepositoryRequest - the request
        options - the request options (e.g. headers), use RequestOptions.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 org.opensearch.client.Cancellable verifyRepositoryAsync​(org.opensearch.action.admin.cluster.repositories.verify.VerifyRepositoryRequest verifyRepositoryRequest,
                                                                       org.opensearch.client.RequestOptions options,
                                                                       org.opensearch.action.ActionListener<org.opensearch.action.admin.cluster.repositories.verify.VerifyRepositoryResponse> listener)
        Asynchronously verifies a snapshot repository.
        Parameters:
        verifyRepositoryRequest - the request
        options - the request options (e.g. headers), use RequestOptions.DEFAULT if nothing needs to be customized
        listener - the listener to be notified upon request completion
        Returns:
        cancellable that may be used to cancel the request
      • cleanupRepository

        public org.opensearch.action.admin.cluster.repositories.cleanup.CleanupRepositoryResponse cleanupRepository​(org.opensearch.action.admin.cluster.repositories.cleanup.CleanupRepositoryRequest cleanupRepositoryRequest,
                                                                                                                    org.opensearch.client.RequestOptions options)
                                                                                                             throws java.io.IOException
        Cleans up a snapshot repository.
        Parameters:
        cleanupRepositoryRequest - the request
        options - the request options (e.g. headers), use RequestOptions.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 org.opensearch.client.Cancellable cleanupRepositoryAsync​(org.opensearch.action.admin.cluster.repositories.cleanup.CleanupRepositoryRequest cleanupRepositoryRequest,
                                                                        org.opensearch.client.RequestOptions options,
                                                                        org.opensearch.action.ActionListener<org.opensearch.action.admin.cluster.repositories.cleanup.CleanupRepositoryResponse> listener)
        Asynchronously cleans up a snapshot repository.
        Parameters:
        cleanupRepositoryRequest - the request
        options - the request options (e.g. headers), use RequestOptions.DEFAULT if nothing needs to be customized
        listener - the listener to be notified upon request completion
        Returns:
        cancellable that may be used to cancel the request
      • create

        public org.opensearch.action.admin.cluster.snapshots.create.CreateSnapshotResponse create​(org.opensearch.action.admin.cluster.snapshots.create.CreateSnapshotRequest createSnapshotRequest,
                                                                                                  org.opensearch.client.RequestOptions options)
                                                                                           throws java.io.IOException
        Creates a snapshot.
        Throws:
        java.io.IOException
      • createAsync

        public org.opensearch.client.Cancellable createAsync​(org.opensearch.action.admin.cluster.snapshots.create.CreateSnapshotRequest createSnapshotRequest,
                                                             org.opensearch.client.RequestOptions options,
                                                             org.opensearch.action.ActionListener<org.opensearch.action.admin.cluster.snapshots.create.CreateSnapshotResponse> listener)
        Asynchronously creates a snapshot.

        Returns:
        cancellable that may be used to cancel the request
      • clone

        public org.opensearch.action.support.master.AcknowledgedResponse clone​(org.opensearch.action.admin.cluster.snapshots.clone.CloneSnapshotRequest cloneSnapshotRequest,
                                                                               org.opensearch.client.RequestOptions options)
                                                                        throws java.io.IOException
        Clones a snapshot.
        Throws:
        java.io.IOException
      • cloneAsync

        public org.opensearch.client.Cancellable cloneAsync​(org.opensearch.action.admin.cluster.snapshots.clone.CloneSnapshotRequest cloneSnapshotRequest,
                                                            org.opensearch.client.RequestOptions options,
                                                            org.opensearch.action.ActionListener<org.opensearch.action.support.master.AcknowledgedResponse> listener)
        Asynchronously clones a snapshot.

        Returns:
        cancellable that may be used to cancel the request
      • get

        public org.opensearch.action.admin.cluster.snapshots.get.GetSnapshotsResponse get​(org.opensearch.action.admin.cluster.snapshots.get.GetSnapshotsRequest getSnapshotsRequest,
                                                                                          org.opensearch.client.RequestOptions options)
                                                                                   throws java.io.IOException
        Get snapshots.
        Parameters:
        getSnapshotsRequest - the request
        options - the request options (e.g. headers), use RequestOptions.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 org.opensearch.client.Cancellable getAsync​(org.opensearch.action.admin.cluster.snapshots.get.GetSnapshotsRequest getSnapshotsRequest,
                                                          org.opensearch.client.RequestOptions options,
                                                          org.opensearch.action.ActionListener<org.opensearch.action.admin.cluster.snapshots.get.GetSnapshotsResponse> listener)
        Asynchronously get snapshots.
        Parameters:
        getSnapshotsRequest - the request
        options - the request options (e.g. headers), use RequestOptions.DEFAULT if nothing needs to be customized
        listener - the listener to be notified upon request completion
        Returns:
        cancellable that may be used to cancel the request
      • status

        public org.opensearch.action.admin.cluster.snapshots.status.SnapshotsStatusResponse status​(org.opensearch.action.admin.cluster.snapshots.status.SnapshotsStatusRequest snapshotsStatusRequest,
                                                                                                   org.opensearch.client.RequestOptions options)
                                                                                            throws java.io.IOException
        Gets the status of requested snapshots.
        Parameters:
        snapshotsStatusRequest - the request
        options - the request options (e.g. headers), use RequestOptions.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 org.opensearch.client.Cancellable statusAsync​(org.opensearch.action.admin.cluster.snapshots.status.SnapshotsStatusRequest snapshotsStatusRequest,
                                                             org.opensearch.client.RequestOptions options,
                                                             org.opensearch.action.ActionListener<org.opensearch.action.admin.cluster.snapshots.status.SnapshotsStatusResponse> listener)
        Asynchronously gets the status of requested snapshots.
        Parameters:
        snapshotsStatusRequest - the request
        options - the request options (e.g. headers), use RequestOptions.DEFAULT if nothing needs to be customized
        listener - the listener to be notified upon request completion
        Returns:
        cancellable that may be used to cancel the request
      • restore

        public org.opensearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse restore​(org.opensearch.action.admin.cluster.snapshots.restore.RestoreSnapshotRequest restoreSnapshotRequest,
                                                                                                     org.opensearch.client.RequestOptions options)
                                                                                              throws java.io.IOException
        Restores a snapshot.
        Parameters:
        restoreSnapshotRequest - the request
        options - the request options (e.g. headers), use RequestOptions.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 org.opensearch.client.Cancellable restoreAsync​(org.opensearch.action.admin.cluster.snapshots.restore.RestoreSnapshotRequest restoreSnapshotRequest,
                                                              org.opensearch.client.RequestOptions options,
                                                              org.opensearch.action.ActionListener<org.opensearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse> listener)
        Asynchronously restores a snapshot.
        Parameters:
        restoreSnapshotRequest - the request
        options - the request options (e.g. headers), use RequestOptions.DEFAULT if nothing needs to be customized
        listener - the listener to be notified upon request completion
        Returns:
        cancellable that may be used to cancel the request
      • delete

        public org.opensearch.action.support.master.AcknowledgedResponse delete​(org.opensearch.action.admin.cluster.snapshots.delete.DeleteSnapshotRequest deleteSnapshotRequest,
                                                                                org.opensearch.client.RequestOptions options)
                                                                         throws java.io.IOException
        Deletes a snapshot.
        Parameters:
        deleteSnapshotRequest - the request
        options - the request options (e.g. headers), use RequestOptions.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 org.opensearch.client.Cancellable deleteAsync​(org.opensearch.action.admin.cluster.snapshots.delete.DeleteSnapshotRequest deleteSnapshotRequest,
                                                             org.opensearch.client.RequestOptions options,
                                                             org.opensearch.action.ActionListener<org.opensearch.action.support.master.AcknowledgedResponse> listener)
        Asynchronously deletes a snapshot.
        Parameters:
        deleteSnapshotRequest - the request
        options - the request options (e.g. headers), use RequestOptions.DEFAULT if nothing needs to be customized
        listener - the listener to be notified upon request completion
        Returns:
        cancellable that may be used to cancel the request