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 AcknowledgedResponsedeleteComponentTemplate(DeleteComponentTemplateRequest req, RequestOptions options)Delete a component template using the Component Templates APICancellabledeleteComponentTemplateAsync(DeleteComponentTemplateRequest request, RequestOptions options, ActionListener<AcknowledgedResponse> listener)Asynchronously delete a component template using the Component Templates APIbooleanexistsComponentTemplate(ComponentTemplatesExistRequest componentTemplatesRequest, RequestOptions options)Uses the Component Templates API to determine if component templates existCancellableexistsComponentTemplateAsync(ComponentTemplatesExistRequest componentTemplatesRequest, RequestOptions options, ActionListener<java.lang.Boolean> listener)Uses the Index Templates API to determine if index templates existGetComponentTemplatesResponsegetComponentTemplate(GetComponentTemplatesRequest getComponentTemplatesRequest, RequestOptions options)Gets component templates using the Components Templates APICancellablegetComponentTemplateAsync(GetComponentTemplatesRequest getComponentTemplatesRequest, RequestOptions options, ActionListener<GetComponentTemplatesResponse> listener)Asynchronously gets component templates using the Components Templates APIClusterGetSettingsResponsegetSettings(ClusterGetSettingsRequest clusterGetSettingsRequest, RequestOptions options)Get the cluster wide settings using the Cluster Get Settings API.CancellablegetSettingsAsync(ClusterGetSettingsRequest clusterGetSettingsRequest, RequestOptions options, ActionListener<ClusterGetSettingsResponse> listener)Asynchronously get the cluster wide settings using the Cluster Get Settings API.ClusterHealthResponsehealth(ClusterHealthRequest healthRequest, RequestOptions options)Get cluster health using the Cluster Health API.CancellablehealthAsync(ClusterHealthRequest healthRequest, RequestOptions options, ActionListener<ClusterHealthResponse> listener)Asynchronously get cluster health using the Cluster Health API.AcknowledgedResponseputComponentTemplate(PutComponentTemplateRequest putComponentTemplateRequest, RequestOptions options)Puts a component template using the Component Templates API.CancellableputComponentTemplateAsync(PutComponentTemplateRequest putComponentTemplateRequest, RequestOptions options, ActionListener<AcknowledgedResponse> listener)Asynchronously puts a component template using the Component Templates API.ClusterUpdateSettingsResponseputSettings(ClusterUpdateSettingsRequest clusterUpdateSettingsRequest, RequestOptions options)Updates cluster wide specific settings using the Cluster Update Settings API.CancellableputSettingsAsync(ClusterUpdateSettingsRequest clusterUpdateSettingsRequest, RequestOptions options, ActionListener<ClusterUpdateSettingsResponse> listener)Asynchronously updates cluster wide specific settings using the Cluster Update Settings API.RemoteInfoResponseremoteInfo(RemoteInfoRequest request, RequestOptions options)Get the remote cluster information using the Remote cluster info API.CancellableremoteInfoAsync(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.DEFAULTif 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.DEFAULTif 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.DEFAULTif 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.DEFAULTif 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,
ClusterHealthResponsewill have isTimedOut() == true and status() == RestStatus.REQUEST_TIMEOUT- Parameters:
healthRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif 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,ClusterHealthResponsewill have isTimedOut() == true and status() == RestStatus.REQUEST_TIMEOUT- Parameters:
healthRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif 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.DEFAULTif 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.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
deleteComponentTemplate
public AcknowledgedResponse deleteComponentTemplate(DeleteComponentTemplateRequest req, RequestOptions options) throws java.io.IOExceptionDelete a component template using the Component Templates API- Parameters:
req- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif 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 Cancellable deleteComponentTemplateAsync(DeleteComponentTemplateRequest request, RequestOptions options, ActionListener<AcknowledgedResponse> listener)Asynchronously delete a component template using the Component Templates API- Parameters:
request- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
putComponentTemplate
public AcknowledgedResponse putComponentTemplate(PutComponentTemplateRequest putComponentTemplateRequest, RequestOptions options) throws java.io.IOExceptionPuts a component template using the Component Templates API.- Parameters:
putComponentTemplateRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif 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 Cancellable putComponentTemplateAsync(PutComponentTemplateRequest putComponentTemplateRequest, RequestOptions options, ActionListener<AcknowledgedResponse> listener)Asynchronously puts a component template using the Component Templates API.- Parameters:
putComponentTemplateRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
getComponentTemplate
public GetComponentTemplatesResponse getComponentTemplate(GetComponentTemplatesRequest getComponentTemplatesRequest, RequestOptions options) throws java.io.IOExceptionGets component templates using the Components Templates API- Parameters:
options- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedgetComponentTemplatesRequest- 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 Cancellable getComponentTemplateAsync(GetComponentTemplatesRequest getComponentTemplatesRequest, RequestOptions options, ActionListener<GetComponentTemplatesResponse> listener)Asynchronously gets component templates using the Components Templates API- Parameters:
getComponentTemplatesRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
existsComponentTemplate
public boolean existsComponentTemplate(ComponentTemplatesExistRequest componentTemplatesRequest, RequestOptions options) throws java.io.IOExceptionUses the Component Templates API to determine if component templates exist- Parameters:
componentTemplatesRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif 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 Cancellable existsComponentTemplateAsync(ComponentTemplatesExistRequest componentTemplatesRequest, RequestOptions options, ActionListener<java.lang.Boolean> listener)Uses the Index Templates API to determine if index templates exist- Parameters:
componentTemplatesRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion. The listener will be called with the valuetrue- Returns:
- cancellable that may be used to cancel the request
-