Package org.opensearch.client
Class ClusterClient
java.lang.Object
org.opensearch.client.ClusterClient
A wrapper for the
RestHighLevelClient that provides methods for accessing the Cluster API.-
Method Summary
Modifier and TypeMethodDescriptionorg.opensearch.action.support.master.AcknowledgedResponsedeleteComponentTemplate(DeleteComponentTemplateRequest req, org.opensearch.client.RequestOptions options) Delete a component template using the Component Templates APIorg.opensearch.client.CancellabledeleteComponentTemplateAsync(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 APIbooleanexistsComponentTemplate(ComponentTemplatesExistRequest componentTemplatesRequest, org.opensearch.client.RequestOptions options) Uses the Component Templates API to determine if component templates existorg.opensearch.client.CancellableexistsComponentTemplateAsync(ComponentTemplatesExistRequest componentTemplatesRequest, org.opensearch.client.RequestOptions options, org.opensearch.action.ActionListener<Boolean> listener) Uses the Index Templates API to determine if index templates existgetComponentTemplate(GetComponentTemplatesRequest getComponentTemplatesRequest, org.opensearch.client.RequestOptions options) Gets component templates using the Components Templates APIorg.opensearch.client.CancellablegetComponentTemplateAsync(GetComponentTemplatesRequest getComponentTemplatesRequest, org.opensearch.client.RequestOptions options, org.opensearch.action.ActionListener<GetComponentTemplatesResponse> listener) Asynchronously gets component templates using the Components Templates APIorg.opensearch.action.admin.cluster.settings.ClusterGetSettingsResponsegetSettings(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.CancellablegetSettingsAsync(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.ClusterHealthResponsehealth(org.opensearch.action.admin.cluster.health.ClusterHealthRequest healthRequest, org.opensearch.client.RequestOptions options) Get cluster health using the Cluster Health API.org.opensearch.client.CancellablehealthAsync(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.AcknowledgedResponseputComponentTemplate(PutComponentTemplateRequest putComponentTemplateRequest, org.opensearch.client.RequestOptions options) Puts a component template using the Component Templates API.org.opensearch.client.CancellableputComponentTemplateAsync(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.ClusterUpdateSettingsResponseputSettings(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.CancellableputSettingsAsync(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.remoteInfo(RemoteInfoRequest request, org.opensearch.client.RequestOptions options) Get the remote cluster information using the Remote cluster info API.org.opensearch.client.CancellableremoteInfoAsync(RemoteInfoRequest request, org.opensearch.client.RequestOptions options, org.opensearch.action.ActionListener<RemoteInfoResponse> listener) Asynchronously get remote cluster information using the Remote cluster info API.
-
Method Details
-
putSettings
public org.opensearch.action.admin.cluster.settings.ClusterUpdateSettingsResponse putSettings(org.opensearch.action.admin.cluster.settings.ClusterUpdateSettingsRequest clusterUpdateSettingsRequest, org.opensearch.client.RequestOptions options) throws IOException Updates cluster wide specific settings using the Cluster Update Settings API.- Parameters:
clusterUpdateSettingsRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
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 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 org.opensearch.action.admin.cluster.settings.ClusterGetSettingsResponse getSettings(org.opensearch.action.admin.cluster.settings.ClusterGetSettingsRequest clusterGetSettingsRequest, org.opensearch.client.RequestOptions options) throws IOException Get the cluster wide settings using the Cluster Get Settings API.- Parameters:
clusterGetSettingsRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
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 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 org.opensearch.action.admin.cluster.health.ClusterHealthResponse health(org.opensearch.action.admin.cluster.health.ClusterHealthRequest healthRequest, org.opensearch.client.RequestOptions options) throws IOException Get cluster health using the Cluster Health API.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 customized- Returns:
- the response
- Throws:
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,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, org.opensearch.client.RequestOptions options) throws IOException Get the remote cluster information using the Remote cluster info API.- Parameters:
request- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
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 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 org.opensearch.action.support.master.AcknowledgedResponse deleteComponentTemplate(DeleteComponentTemplateRequest req, org.opensearch.client.RequestOptions options) throws IOException Delete 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:
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 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 org.opensearch.action.support.master.AcknowledgedResponse putComponentTemplate(PutComponentTemplateRequest putComponentTemplateRequest, org.opensearch.client.RequestOptions options) throws IOException 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 customized- Returns:
- the response
- Throws:
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 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, org.opensearch.client.RequestOptions options) throws IOException Gets 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:
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 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, org.opensearch.client.RequestOptions options) throws IOException Uses 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:
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<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
-