Package org.elasticsearch.client
Class ClusterClient
java.lang.Object
org.elasticsearch.client.ClusterClient
public final class ClusterClient
extends java.lang.Object
A wrapper for the
RestHighLevelClient
that provides methods for accessing the Cluster API.
-
Method Summary
Modifier and Type Method Description ClusterGetSettingsResponse
getSettings(ClusterGetSettingsRequest clusterGetSettingsRequest, RequestOptions options)
Get the cluster wide settings using the Cluster Get Settings API.Cancellable
getSettingsAsync(ClusterGetSettingsRequest clusterGetSettingsRequest, RequestOptions options, ActionListener<ClusterGetSettingsResponse> listener)
Asynchronously get the cluster wide settings using the Cluster Get Settings API.ClusterHealthResponse
health(ClusterHealthRequest healthRequest, RequestOptions options)
Get cluster health using the Cluster Health API.Cancellable
healthAsync(ClusterHealthRequest healthRequest, RequestOptions options, ActionListener<ClusterHealthResponse> listener)
Asynchronously get cluster health using the Cluster Health API.ClusterUpdateSettingsResponse
putSettings(ClusterUpdateSettingsRequest clusterUpdateSettingsRequest, RequestOptions options)
Updates cluster wide specific settings using the Cluster Update Settings API.Cancellable
putSettingsAsync(ClusterUpdateSettingsRequest clusterUpdateSettingsRequest, RequestOptions options, ActionListener<ClusterUpdateSettingsResponse> listener)
Asynchronously updates cluster wide specific settings using the Cluster Update Settings API.RemoteInfoResponse
remoteInfo(RemoteInfoRequest request, RequestOptions options)
Get the remote cluster information using the Remote cluster info API.Cancellable
remoteInfoAsync(RemoteInfoRequest request, RequestOptions options, ActionListener<RemoteInfoResponse> listener)
Asynchronously get remote cluster information using the Remote cluster info API.
-
Method Details
-
putSettings
public ClusterUpdateSettingsResponse putSettings(ClusterUpdateSettingsRequest clusterUpdateSettingsRequest, RequestOptions options) throws java.io.IOExceptionUpdates cluster wide specific settings using the Cluster Update Settings API. See Cluster Update Settings API on elastic.co- Parameters:
clusterUpdateSettingsRequest
- 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
-
putSettingsAsync
public Cancellable putSettingsAsync(ClusterUpdateSettingsRequest clusterUpdateSettingsRequest, RequestOptions options, ActionListener<ClusterUpdateSettingsResponse> listener)Asynchronously updates cluster wide specific settings using the Cluster Update Settings API. See Cluster Update Settings API on elastic.co- Parameters:
clusterUpdateSettingsRequest
- 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
-
getSettings
public ClusterGetSettingsResponse getSettings(ClusterGetSettingsRequest clusterGetSettingsRequest, RequestOptions options) throws java.io.IOExceptionGet the cluster wide settings using the Cluster Get Settings API. See Cluster Get Settings API on elastic.co- Parameters:
clusterGetSettingsRequest
- 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
-
getSettingsAsync
public Cancellable getSettingsAsync(ClusterGetSettingsRequest clusterGetSettingsRequest, RequestOptions options, ActionListener<ClusterGetSettingsResponse> listener)Asynchronously get the cluster wide settings using the Cluster Get Settings API. See Cluster Get Settings API on elastic.co- Parameters:
clusterGetSettingsRequest
- 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
-
health
public ClusterHealthResponse health(ClusterHealthRequest healthRequest, RequestOptions options) throws java.io.IOExceptionGet cluster health using the Cluster Health API. See Cluster Health API on elastic.coIf timeout occurred,
ClusterHealthResponse
will have isTimedOut() == true and status() == RestStatus.REQUEST_TIMEOUT- Parameters:
healthRequest
- 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
-
healthAsync
public Cancellable healthAsync(ClusterHealthRequest healthRequest, RequestOptions options, ActionListener<ClusterHealthResponse> listener)Asynchronously get cluster health using the Cluster Health API. See Cluster Health API on elastic.co If timeout occurred,ClusterHealthResponse
will have isTimedOut() == true and status() == RestStatus.REQUEST_TIMEOUT- Parameters:
healthRequest
- 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
-
remoteInfo
public RemoteInfoResponse remoteInfo(RemoteInfoRequest request, RequestOptions options) throws java.io.IOExceptionGet the remote cluster information using the Remote cluster info API. See Remote cluster info API on elastic.co- Parameters:
request
- 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
-
remoteInfoAsync
public Cancellable remoteInfoAsync(RemoteInfoRequest request, RequestOptions options, ActionListener<RemoteInfoResponse> listener)Asynchronously get remote cluster information using the Remote cluster info API. See Remote cluster info API on elastic.co- Parameters:
request
- 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
-