Class ElasticsearchClusterClient
-
Field Summary
Fields inherited from class co.elastic.clients.ApiClient
transport, transportOptions -
Constructor Summary
ConstructorsConstructorDescriptionElasticsearchClusterClient(ElasticsearchTransport transport) ElasticsearchClusterClient(ElasticsearchTransport transport, TransportOptions transportOptions) -
Method Summary
Modifier and TypeMethodDescriptionProvides explanations for shard allocations in the cluster.Provides explanations for shard allocations in the cluster.allocationExplain(Function<AllocationExplainRequest.Builder, ObjectBuilder<AllocationExplainRequest>> fn) Provides explanations for shard allocations in the cluster.Deletes component templates.deleteComponentTemplate(Function<DeleteComponentTemplateRequest.Builder, ObjectBuilder<DeleteComponentTemplateRequest>> fn) Deletes component templates.Clears cluster voting config exclusions.Clears cluster voting config exclusions.final BooleanResponsedeleteVotingConfigExclusions(Function<DeleteVotingConfigExclusionsRequest.Builder, ObjectBuilder<DeleteVotingConfigExclusionsRequest>> fn) Clears cluster voting config exclusions.Returns information about whether a particular component template existfinal BooleanResponseexistsComponentTemplate(Function<ExistsComponentTemplateRequest.Builder, ObjectBuilder<ExistsComponentTemplateRequest>> fn) Returns information about whether a particular component template existRetrieves information about component templates.Retrieves information about component templates.getComponentTemplate(Function<GetComponentTemplateRequest.Builder, ObjectBuilder<GetComponentTemplateRequest>> fn) Retrieves information about component templates.Returns cluster-wide settings.getSettings(GetClusterSettingsRequest request) Returns cluster-wide settings.getSettings(Function<GetClusterSettingsRequest.Builder, ObjectBuilder<GetClusterSettingsRequest>> fn) Returns cluster-wide settings.health()The cluster health API returns a simple status on the health of the cluster.health(HealthRequest request) The cluster health API returns a simple status on the health of the cluster.final HealthResponseThe cluster health API returns a simple status on the health of the cluster.info(ClusterInfoRequest request) Returns different information about the cluster.final ClusterInfoResponseReturns different information about the cluster.Returns cluster-level changes (such as create index, update mapping, allocate or fail shard) that have not yet been executed.pendingTasks(PendingTasksRequest request) Returns cluster-level changes (such as create index, update mapping, allocate or fail shard) that have not yet been executed.final PendingTasksResponseReturns cluster-level changes (such as create index, update mapping, allocate or fail shard) that have not yet been executed.Updates the cluster voting config exclusions by node ids or node names.Updates the cluster voting config exclusions by node ids or node names.final BooleanResponsepostVotingConfigExclusions(Function<PostVotingConfigExclusionsRequest.Builder, ObjectBuilder<PostVotingConfigExclusionsRequest>> fn) Updates the cluster voting config exclusions by node ids or node names.Creates or updates a component template.putComponentTemplate(Function<PutComponentTemplateRequest.Builder, ObjectBuilder<PutComponentTemplateRequest>> fn) Creates or updates a component template.Updates the cluster settings.putSettings(PutClusterSettingsRequest request) Updates the cluster settings.putSettings(Function<PutClusterSettingsRequest.Builder, ObjectBuilder<PutClusterSettingsRequest>> fn) Updates the cluster settings.The cluster remote info API allows you to retrieve all of the configured remote cluster information.reroute()Allows to manually change the allocation of individual shards in the cluster.reroute(RerouteRequest request) Allows to manually change the allocation of individual shards in the cluster.final RerouteResponseAllows to manually change the allocation of individual shards in the cluster.state()Returns a comprehensive information about the state of the cluster.state(StateRequest request) Returns a comprehensive information about the state of the cluster.final StateResponseReturns a comprehensive information about the state of the cluster.stats()Returns cluster statistics.stats(ClusterStatsRequest request) Returns cluster statistics.final ClusterStatsResponseReturns cluster statistics.withTransportOptions(TransportOptions transportOptions) Creates a new client with some request optionsMethods inherited from class co.elastic.clients.ApiClient
_jsonpMapper, _transport, _transportOptions, getDeserializer, withTransportOptions
-
Constructor Details
-
ElasticsearchClusterClient
-
ElasticsearchClusterClient
public ElasticsearchClusterClient(ElasticsearchTransport transport, @Nullable TransportOptions transportOptions)
-
-
Method Details
-
withTransportOptions
Description copied from class:ApiClientCreates a new client with some request options- Specified by:
withTransportOptionsin classApiClient<ElasticsearchTransport,ElasticsearchClusterClient>
-
allocationExplain
public AllocationExplainResponse allocationExplain(AllocationExplainRequest request) throws IOException, ElasticsearchException Provides explanations for shard allocations in the cluster.- Throws:
IOExceptionElasticsearchException- See Also:
-
allocationExplain
public final AllocationExplainResponse allocationExplain(Function<AllocationExplainRequest.Builder, ObjectBuilder<AllocationExplainRequest>> fn) throws IOException, ElasticsearchExceptionProvides explanations for shard allocations in the cluster.- Parameters:
fn- a function that initializes a builder to create theAllocationExplainRequest- Throws:
IOExceptionElasticsearchException- See Also:
-
allocationExplain
Provides explanations for shard allocations in the cluster.- Throws:
IOExceptionElasticsearchException- See Also:
-
deleteComponentTemplate
public DeleteComponentTemplateResponse deleteComponentTemplate(DeleteComponentTemplateRequest request) throws IOException, ElasticsearchException Deletes component templates. Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases.- Throws:
IOExceptionElasticsearchException- See Also:
-
deleteComponentTemplate
public final DeleteComponentTemplateResponse deleteComponentTemplate(Function<DeleteComponentTemplateRequest.Builder, ObjectBuilder<DeleteComponentTemplateRequest>> fn) throws IOException, ElasticsearchExceptionDeletes component templates. Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases.- Parameters:
fn- a function that initializes a builder to create theDeleteComponentTemplateRequest- Throws:
IOExceptionElasticsearchException- See Also:
-
deleteVotingConfigExclusions
public BooleanResponse deleteVotingConfigExclusions(DeleteVotingConfigExclusionsRequest request) throws IOException, ElasticsearchException Clears cluster voting config exclusions.- Throws:
IOExceptionElasticsearchException- See Also:
-
deleteVotingConfigExclusions
public final BooleanResponse deleteVotingConfigExclusions(Function<DeleteVotingConfigExclusionsRequest.Builder, ObjectBuilder<DeleteVotingConfigExclusionsRequest>> fn) throws IOException, ElasticsearchExceptionClears cluster voting config exclusions.- Parameters:
fn- a function that initializes a builder to create theDeleteVotingConfigExclusionsRequest- Throws:
IOExceptionElasticsearchException- See Also:
-
deleteVotingConfigExclusions
Clears cluster voting config exclusions.- Throws:
IOExceptionElasticsearchException- See Also:
-
existsComponentTemplate
public BooleanResponse existsComponentTemplate(ExistsComponentTemplateRequest request) throws IOException, ElasticsearchException Returns information about whether a particular component template exist- Throws:
IOExceptionElasticsearchException- See Also:
-
existsComponentTemplate
public final BooleanResponse existsComponentTemplate(Function<ExistsComponentTemplateRequest.Builder, ObjectBuilder<ExistsComponentTemplateRequest>> fn) throws IOException, ElasticsearchExceptionReturns information about whether a particular component template exist- Parameters:
fn- a function that initializes a builder to create theExistsComponentTemplateRequest- Throws:
IOExceptionElasticsearchException- See Also:
-
getComponentTemplate
public GetComponentTemplateResponse getComponentTemplate(GetComponentTemplateRequest request) throws IOException, ElasticsearchException Retrieves information about component templates.- Throws:
IOExceptionElasticsearchException- See Also:
-
getComponentTemplate
public final GetComponentTemplateResponse getComponentTemplate(Function<GetComponentTemplateRequest.Builder, ObjectBuilder<GetComponentTemplateRequest>> fn) throws IOException, ElasticsearchExceptionRetrieves information about component templates.- Parameters:
fn- a function that initializes a builder to create theGetComponentTemplateRequest- Throws:
IOExceptionElasticsearchException- See Also:
-
getComponentTemplate
public GetComponentTemplateResponse getComponentTemplate() throws IOException, ElasticsearchExceptionRetrieves information about component templates.- Throws:
IOExceptionElasticsearchException- See Also:
-
getSettings
public GetClusterSettingsResponse getSettings(GetClusterSettingsRequest request) throws IOException, ElasticsearchException Returns cluster-wide settings. By default, it returns only settings that have been explicitly defined.- Throws:
IOExceptionElasticsearchException- See Also:
-
getSettings
public final GetClusterSettingsResponse getSettings(Function<GetClusterSettingsRequest.Builder, ObjectBuilder<GetClusterSettingsRequest>> fn) throws IOException, ElasticsearchExceptionReturns cluster-wide settings. By default, it returns only settings that have been explicitly defined.- Parameters:
fn- a function that initializes a builder to create theGetClusterSettingsRequest- Throws:
IOExceptionElasticsearchException- See Also:
-
getSettings
Returns cluster-wide settings. By default, it returns only settings that have been explicitly defined.- Throws:
IOExceptionElasticsearchException- See Also:
-
health
The cluster health API returns a simple status on the health of the cluster. You can also use the API to get the health status of only specified data streams and indices. For data streams, the API retrieves the health status of the stream’s backing indices. The cluster health status is: green, yellow or red. On the shard level, a red status indicates that the specific shard is not allocated in the cluster, yellow means that the primary shard is allocated but replicas are not, and green means that all shards are allocated. The index level status is controlled by the worst shard status. The cluster status is controlled by the worst index status.- Throws:
IOExceptionElasticsearchException- See Also:
-
health
public final HealthResponse health(Function<HealthRequest.Builder, ObjectBuilder<HealthRequest>> fn) throws IOException, ElasticsearchExceptionThe cluster health API returns a simple status on the health of the cluster. You can also use the API to get the health status of only specified data streams and indices. For data streams, the API retrieves the health status of the stream’s backing indices. The cluster health status is: green, yellow or red. On the shard level, a red status indicates that the specific shard is not allocated in the cluster, yellow means that the primary shard is allocated but replicas are not, and green means that all shards are allocated. The index level status is controlled by the worst shard status. The cluster status is controlled by the worst index status.- Parameters:
fn- a function that initializes a builder to create theHealthRequest- Throws:
IOExceptionElasticsearchException- See Also:
-
health
The cluster health API returns a simple status on the health of the cluster. You can also use the API to get the health status of only specified data streams and indices. For data streams, the API retrieves the health status of the stream’s backing indices. The cluster health status is: green, yellow or red. On the shard level, a red status indicates that the specific shard is not allocated in the cluster, yellow means that the primary shard is allocated but replicas are not, and green means that all shards are allocated. The index level status is controlled by the worst shard status. The cluster status is controlled by the worst index status.- Throws:
IOExceptionElasticsearchException- See Also:
-
info
public ClusterInfoResponse info(ClusterInfoRequest request) throws IOException, ElasticsearchException Returns different information about the cluster.- Throws:
IOExceptionElasticsearchException- See Also:
-
info
public final ClusterInfoResponse info(Function<ClusterInfoRequest.Builder, ObjectBuilder<ClusterInfoRequest>> fn) throws IOException, ElasticsearchExceptionReturns different information about the cluster.- Parameters:
fn- a function that initializes a builder to create theClusterInfoRequest- Throws:
IOExceptionElasticsearchException- See Also:
-
pendingTasks
public PendingTasksResponse pendingTasks(PendingTasksRequest request) throws IOException, ElasticsearchException Returns cluster-level changes (such as create index, update mapping, allocate or fail shard) that have not yet been executed. NOTE: This API returns a list of any pending updates to the cluster state. These are distinct from the tasks reported by the Task Management API which include periodic tasks and tasks initiated by the user, such as node stats, search queries, or create index requests. However, if a user-initiated task such as a create index command causes a cluster state update, the activity of this task might be reported by both task api and pending cluster tasks API.- Throws:
IOExceptionElasticsearchException- See Also:
-
pendingTasks
public final PendingTasksResponse pendingTasks(Function<PendingTasksRequest.Builder, ObjectBuilder<PendingTasksRequest>> fn) throws IOException, ElasticsearchExceptionReturns cluster-level changes (such as create index, update mapping, allocate or fail shard) that have not yet been executed. NOTE: This API returns a list of any pending updates to the cluster state. These are distinct from the tasks reported by the Task Management API which include periodic tasks and tasks initiated by the user, such as node stats, search queries, or create index requests. However, if a user-initiated task such as a create index command causes a cluster state update, the activity of this task might be reported by both task api and pending cluster tasks API.- Parameters:
fn- a function that initializes a builder to create thePendingTasksRequest- Throws:
IOExceptionElasticsearchException- See Also:
-
pendingTasks
Returns cluster-level changes (such as create index, update mapping, allocate or fail shard) that have not yet been executed. NOTE: This API returns a list of any pending updates to the cluster state. These are distinct from the tasks reported by the Task Management API which include periodic tasks and tasks initiated by the user, such as node stats, search queries, or create index requests. However, if a user-initiated task such as a create index command causes a cluster state update, the activity of this task might be reported by both task api and pending cluster tasks API.- Throws:
IOExceptionElasticsearchException- See Also:
-
postVotingConfigExclusions
public BooleanResponse postVotingConfigExclusions(PostVotingConfigExclusionsRequest request) throws IOException, ElasticsearchException Updates the cluster voting config exclusions by node ids or node names.- Throws:
IOExceptionElasticsearchException- See Also:
-
postVotingConfigExclusions
public final BooleanResponse postVotingConfigExclusions(Function<PostVotingConfigExclusionsRequest.Builder, ObjectBuilder<PostVotingConfigExclusionsRequest>> fn) throws IOException, ElasticsearchExceptionUpdates the cluster voting config exclusions by node ids or node names.- Parameters:
fn- a function that initializes a builder to create thePostVotingConfigExclusionsRequest- Throws:
IOExceptionElasticsearchException- See Also:
-
postVotingConfigExclusions
Updates the cluster voting config exclusions by node ids or node names.- Throws:
IOExceptionElasticsearchException- See Also:
-
putComponentTemplate
public PutComponentTemplateResponse putComponentTemplate(PutComponentTemplateRequest request) throws IOException, ElasticsearchException Creates or updates a component template. Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases.An index template can be composed of multiple component templates. To use a component template, specify it in an index template’s
composed_oflist. Component templates are only applied to new data streams and indices as part of a matching index template.Settings and mappings specified directly in the index template or the create index request override any settings or mappings specified in a component template.
Component templates are only used during index creation. For data streams, this includes data stream creation and the creation of a stream’s backing indices. Changes to component templates do not affect existing indices, including a stream’s backing indices.
You can use C-style
/* *\/block comments in component templates. You can include comments anywhere in the request body except before the opening curly bracket.- Throws:
IOExceptionElasticsearchException- See Also:
-
putComponentTemplate
public final PutComponentTemplateResponse putComponentTemplate(Function<PutComponentTemplateRequest.Builder, ObjectBuilder<PutComponentTemplateRequest>> fn) throws IOException, ElasticsearchExceptionCreates or updates a component template. Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases.An index template can be composed of multiple component templates. To use a component template, specify it in an index template’s
composed_oflist. Component templates are only applied to new data streams and indices as part of a matching index template.Settings and mappings specified directly in the index template or the create index request override any settings or mappings specified in a component template.
Component templates are only used during index creation. For data streams, this includes data stream creation and the creation of a stream’s backing indices. Changes to component templates do not affect existing indices, including a stream’s backing indices.
You can use C-style
/* *\/block comments in component templates. You can include comments anywhere in the request body except before the opening curly bracket.- Parameters:
fn- a function that initializes a builder to create thePutComponentTemplateRequest- Throws:
IOExceptionElasticsearchException- See Also:
-
putSettings
public PutClusterSettingsResponse putSettings(PutClusterSettingsRequest request) throws IOException, ElasticsearchException Updates the cluster settings.- Throws:
IOExceptionElasticsearchException- See Also:
-
putSettings
public final PutClusterSettingsResponse putSettings(Function<PutClusterSettingsRequest.Builder, ObjectBuilder<PutClusterSettingsRequest>> fn) throws IOException, ElasticsearchExceptionUpdates the cluster settings.- Parameters:
fn- a function that initializes a builder to create thePutClusterSettingsRequest- Throws:
IOExceptionElasticsearchException- See Also:
-
putSettings
Updates the cluster settings.- Throws:
IOExceptionElasticsearchException- See Also:
-
remoteInfo
The cluster remote info API allows you to retrieve all of the configured remote cluster information. It returns connection and endpoint information keyed by the configured remote cluster alias.- Throws:
IOExceptionElasticsearchException- See Also:
-
reroute
Allows to manually change the allocation of individual shards in the cluster.- Throws:
IOExceptionElasticsearchException- See Also:
-
reroute
public final RerouteResponse reroute(Function<RerouteRequest.Builder, ObjectBuilder<RerouteRequest>> fn) throws IOException, ElasticsearchExceptionAllows to manually change the allocation of individual shards in the cluster.- Parameters:
fn- a function that initializes a builder to create theRerouteRequest- Throws:
IOExceptionElasticsearchException- See Also:
-
reroute
Allows to manually change the allocation of individual shards in the cluster.- Throws:
IOExceptionElasticsearchException- See Also:
-
state
Returns a comprehensive information about the state of the cluster.- Throws:
IOExceptionElasticsearchException- See Also:
-
state
public final StateResponse state(Function<StateRequest.Builder, ObjectBuilder<StateRequest>> fn) throws IOException, ElasticsearchExceptionReturns a comprehensive information about the state of the cluster.- Parameters:
fn- a function that initializes a builder to create theStateRequest- Throws:
IOExceptionElasticsearchException- See Also:
-
state
Returns a comprehensive information about the state of the cluster.- Throws:
IOExceptionElasticsearchException- See Also:
-
stats
public ClusterStatsResponse stats(ClusterStatsRequest request) throws IOException, ElasticsearchException Returns cluster statistics. It returns basic index metrics (shard numbers, store size, memory usage) and information about the current nodes that form the cluster (number, roles, os, jvm versions, memory usage, cpu and installed plugins).- Throws:
IOExceptionElasticsearchException- See Also:
-
stats
public final ClusterStatsResponse stats(Function<ClusterStatsRequest.Builder, ObjectBuilder<ClusterStatsRequest>> fn) throws IOException, ElasticsearchExceptionReturns cluster statistics. It returns basic index metrics (shard numbers, store size, memory usage) and information about the current nodes that form the cluster (number, roles, os, jvm versions, memory usage, cpu and installed plugins).- Parameters:
fn- a function that initializes a builder to create theClusterStatsRequest- Throws:
IOExceptionElasticsearchException- See Also:
-
stats
Returns cluster statistics. It returns basic index metrics (shard numbers, store size, memory usage) and information about the current nodes that form the cluster (number, roles, os, jvm versions, memory usage, cpu and installed plugins).- Throws:
IOExceptionElasticsearchException- See Also:
-