Class ClusterClient


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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.opensearch.action.support.master.AcknowledgedResponse deleteComponentTemplate​(DeleteComponentTemplateRequest req, org.opensearch.client.RequestOptions options)
      Delete a component template using the Component Templates API
      org.opensearch.client.Cancellable deleteComponentTemplateAsync​(DeleteComponentTemplateRequest request, org.opensearch.client.RequestOptions options, org.opensearch.action.ActionListener<org.opensearch.action.support.master.AcknowledgedResponse> listener)
      Asynchronously delete a component template using the Component Templates API
      boolean existsComponentTemplate​(ComponentTemplatesExistRequest componentTemplatesRequest, org.opensearch.client.RequestOptions options)
      Uses the Component Templates API to determine if component templates exist
      org.opensearch.client.Cancellable existsComponentTemplateAsync​(ComponentTemplatesExistRequest componentTemplatesRequest, org.opensearch.client.RequestOptions options, org.opensearch.action.ActionListener<java.lang.Boolean> listener)
      Uses the Index Templates API to determine if index templates exist
      GetComponentTemplatesResponse getComponentTemplate​(GetComponentTemplatesRequest getComponentTemplatesRequest, org.opensearch.client.RequestOptions options)
      Gets component templates using the Components Templates API
      org.opensearch.client.Cancellable getComponentTemplateAsync​(GetComponentTemplatesRequest getComponentTemplatesRequest, org.opensearch.client.RequestOptions options, org.opensearch.action.ActionListener<GetComponentTemplatesResponse> listener)
      Asynchronously gets component templates using the Components Templates API
      org.opensearch.action.admin.cluster.settings.ClusterGetSettingsResponse getSettings​(org.opensearch.action.admin.cluster.settings.ClusterGetSettingsRequest clusterGetSettingsRequest, org.opensearch.client.RequestOptions options)
      Get the cluster wide settings using the Cluster Get Settings API.
      org.opensearch.client.Cancellable getSettingsAsync​(org.opensearch.action.admin.cluster.settings.ClusterGetSettingsRequest clusterGetSettingsRequest, org.opensearch.client.RequestOptions options, org.opensearch.action.ActionListener<org.opensearch.action.admin.cluster.settings.ClusterGetSettingsResponse> listener)
      Asynchronously get the cluster wide settings using the Cluster Get Settings API.
      org.opensearch.action.admin.cluster.health.ClusterHealthResponse health​(org.opensearch.action.admin.cluster.health.ClusterHealthRequest healthRequest, org.opensearch.client.RequestOptions options)
      Get cluster health using the Cluster Health API.
      org.opensearch.client.Cancellable healthAsync​(org.opensearch.action.admin.cluster.health.ClusterHealthRequest healthRequest, org.opensearch.client.RequestOptions options, org.opensearch.action.ActionListener<org.opensearch.action.admin.cluster.health.ClusterHealthResponse> listener)
      Asynchronously get cluster health using the Cluster Health API.
      org.opensearch.action.support.master.AcknowledgedResponse putComponentTemplate​(PutComponentTemplateRequest putComponentTemplateRequest, org.opensearch.client.RequestOptions options)
      Puts a component template using the Component Templates API.
      org.opensearch.client.Cancellable putComponentTemplateAsync​(PutComponentTemplateRequest putComponentTemplateRequest, org.opensearch.client.RequestOptions options, org.opensearch.action.ActionListener<org.opensearch.action.support.master.AcknowledgedResponse> listener)
      Asynchronously puts a component template using the Component Templates API.
      org.opensearch.action.admin.cluster.settings.ClusterUpdateSettingsResponse putSettings​(org.opensearch.action.admin.cluster.settings.ClusterUpdateSettingsRequest clusterUpdateSettingsRequest, org.opensearch.client.RequestOptions options)
      Updates cluster wide specific settings using the Cluster Update Settings API.
      org.opensearch.client.Cancellable putSettingsAsync​(org.opensearch.action.admin.cluster.settings.ClusterUpdateSettingsRequest clusterUpdateSettingsRequest, org.opensearch.client.RequestOptions options, org.opensearch.action.ActionListener<org.opensearch.action.admin.cluster.settings.ClusterUpdateSettingsResponse> listener)
      Asynchronously updates cluster wide specific settings using the Cluster Update Settings API.
      RemoteInfoResponse remoteInfo​(RemoteInfoRequest request, org.opensearch.client.RequestOptions options)
      Get the remote cluster information using the Remote cluster info API.
      org.opensearch.client.Cancellable remoteInfoAsync​(RemoteInfoRequest request, org.opensearch.client.RequestOptions options, org.opensearch.action.ActionListener<RemoteInfoResponse> listener)
      Asynchronously get remote cluster information using the Remote cluster info API.
      • Methods inherited from class java.lang.Object

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

      • putSettings

        public org.opensearch.action.admin.cluster.settings.ClusterUpdateSettingsResponse putSettings​(org.opensearch.action.admin.cluster.settings.ClusterUpdateSettingsRequest clusterUpdateSettingsRequest,
                                                                                                      org.opensearch.client.RequestOptions options)
                                                                                               throws java.io.IOException
        Updates cluster wide specific settings using the Cluster Update Settings API.
        Parameters:
        clusterUpdateSettingsRequest - 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
      • putSettingsAsync

        public org.opensearch.client.Cancellable putSettingsAsync​(org.opensearch.action.admin.cluster.settings.ClusterUpdateSettingsRequest clusterUpdateSettingsRequest,
                                                                  org.opensearch.client.RequestOptions options,
                                                                  org.opensearch.action.ActionListener<org.opensearch.action.admin.cluster.settings.ClusterUpdateSettingsResponse> listener)
        Asynchronously updates cluster wide specific settings using the Cluster Update Settings API.
        Parameters:
        clusterUpdateSettingsRequest - 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
      • getSettings

        public org.opensearch.action.admin.cluster.settings.ClusterGetSettingsResponse getSettings​(org.opensearch.action.admin.cluster.settings.ClusterGetSettingsRequest clusterGetSettingsRequest,
                                                                                                   org.opensearch.client.RequestOptions options)
                                                                                            throws java.io.IOException
        Get the cluster wide settings using the Cluster Get Settings API.
        Parameters:
        clusterGetSettingsRequest - 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
      • getSettingsAsync

        public org.opensearch.client.Cancellable getSettingsAsync​(org.opensearch.action.admin.cluster.settings.ClusterGetSettingsRequest clusterGetSettingsRequest,
                                                                  org.opensearch.client.RequestOptions options,
                                                                  org.opensearch.action.ActionListener<org.opensearch.action.admin.cluster.settings.ClusterGetSettingsResponse> listener)
        Asynchronously get the cluster wide settings using the Cluster Get Settings API.
        Parameters:
        clusterGetSettingsRequest - 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
      • health

        public org.opensearch.action.admin.cluster.health.ClusterHealthResponse health​(org.opensearch.action.admin.cluster.health.ClusterHealthRequest healthRequest,
                                                                                       org.opensearch.client.RequestOptions options)
                                                                                throws java.io.IOException
        Get cluster health using the Cluster Health API.

        If timeout occurred, ClusterHealthResponse will have isTimedOut() == true and status() == RestStatus.REQUEST_TIMEOUT

        Parameters:
        healthRequest - 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
      • healthAsync

        public org.opensearch.client.Cancellable healthAsync​(org.opensearch.action.admin.cluster.health.ClusterHealthRequest healthRequest,
                                                             org.opensearch.client.RequestOptions options,
                                                             org.opensearch.action.ActionListener<org.opensearch.action.admin.cluster.health.ClusterHealthResponse> listener)
        Asynchronously get cluster health using the Cluster Health API. If timeout occurred, ClusterHealthResponse will have isTimedOut() == true and status() == RestStatus.REQUEST_TIMEOUT
        Parameters:
        healthRequest - 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
      • remoteInfo

        public RemoteInfoResponse remoteInfo​(RemoteInfoRequest request,
                                             org.opensearch.client.RequestOptions options)
                                      throws java.io.IOException
        Get the remote cluster information using the Remote cluster info API.
        Parameters:
        request - 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
      • remoteInfoAsync

        public org.opensearch.client.Cancellable remoteInfoAsync​(RemoteInfoRequest request,
                                                                 org.opensearch.client.RequestOptions options,
                                                                 org.opensearch.action.ActionListener<RemoteInfoResponse> listener)
        Asynchronously get remote cluster information using the Remote cluster info API.
        Parameters:
        request - 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
      • deleteComponentTemplate

        public org.opensearch.action.support.master.AcknowledgedResponse deleteComponentTemplate​(DeleteComponentTemplateRequest req,
                                                                                                 org.opensearch.client.RequestOptions options)
                                                                                          throws java.io.IOException
        Delete a component template using the Component Templates API
        Parameters:
        req - the request
        options - the request options (e.g. headers), use RequestOptions.DEFAULT if nothing needs to be customized
        Throws:
        java.io.IOException - in case there is a problem sending the request or parsing back the response
      • deleteComponentTemplateAsync

        public org.opensearch.client.Cancellable deleteComponentTemplateAsync​(DeleteComponentTemplateRequest request,
                                                                              org.opensearch.client.RequestOptions options,
                                                                              org.opensearch.action.ActionListener<org.opensearch.action.support.master.AcknowledgedResponse> listener)
        Asynchronously delete a component template using the Component Templates API
        Parameters:
        request - 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
      • putComponentTemplate

        public org.opensearch.action.support.master.AcknowledgedResponse putComponentTemplate​(PutComponentTemplateRequest putComponentTemplateRequest,
                                                                                              org.opensearch.client.RequestOptions options)
                                                                                       throws java.io.IOException
        Puts a component template using the Component Templates API.
        Parameters:
        putComponentTemplateRequest - 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
      • putComponentTemplateAsync

        public org.opensearch.client.Cancellable putComponentTemplateAsync​(PutComponentTemplateRequest putComponentTemplateRequest,
                                                                           org.opensearch.client.RequestOptions options,
                                                                           org.opensearch.action.ActionListener<org.opensearch.action.support.master.AcknowledgedResponse> listener)
        Asynchronously puts a component template using the Component Templates API.
        Parameters:
        putComponentTemplateRequest - 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
      • getComponentTemplate

        public GetComponentTemplatesResponse getComponentTemplate​(GetComponentTemplatesRequest getComponentTemplatesRequest,
                                                                  org.opensearch.client.RequestOptions options)
                                                           throws java.io.IOException
        Gets component templates using the Components Templates API
        Parameters:
        options - the request options (e.g. headers), use RequestOptions.DEFAULT if nothing needs to be customized
        getComponentTemplatesRequest - the request
        Returns:
        the response
        Throws:
        java.io.IOException - in case there is a problem sending the request or parsing back the response
      • getComponentTemplateAsync

        public org.opensearch.client.Cancellable getComponentTemplateAsync​(GetComponentTemplatesRequest getComponentTemplatesRequest,
                                                                           org.opensearch.client.RequestOptions options,
                                                                           org.opensearch.action.ActionListener<GetComponentTemplatesResponse> listener)
        Asynchronously gets component templates using the Components Templates API
        Parameters:
        getComponentTemplatesRequest - 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
      • existsComponentTemplate

        public boolean existsComponentTemplate​(ComponentTemplatesExistRequest componentTemplatesRequest,
                                               org.opensearch.client.RequestOptions options)
                                        throws java.io.IOException
        Uses the Component Templates API to determine if component templates exist
        Parameters:
        componentTemplatesRequest - the request
        options - the request options (e.g. headers), use RequestOptions.DEFAULT if nothing needs to be customized
        Returns:
        true if any index templates in the request exist, false otherwise
        Throws:
        java.io.IOException - in case there is a problem sending the request or parsing back the response
      • existsComponentTemplateAsync

        public org.opensearch.client.Cancellable existsComponentTemplateAsync​(ComponentTemplatesExistRequest componentTemplatesRequest,
                                                                              org.opensearch.client.RequestOptions options,
                                                                              org.opensearch.action.ActionListener<java.lang.Boolean> listener)
        Uses the Index Templates API to determine if index templates exist
        Parameters:
        componentTemplatesRequest - 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. The listener will be called with the value true
        Returns:
        cancellable that may be used to cancel the request