Class HealthRequest
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. Green means that all shards are allocated. The index level status is controlled by the worst shard status.
One of the main benefits of the API is the ability to wait until the cluster reaches a certain high watermark health level. The cluster status is controlled by the worst index status.
- See Also:
- 
Nested Class SummaryNested ClassesNested classes/interfaces inherited from class co.elastic.clients.elasticsearch._types.RequestBaseRequestBase.AbstractBuilder<BuilderT extends RequestBase.AbstractBuilder<BuilderT>>
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final Endpoint<HealthRequest,HealthResponse, ErrorResponse> Endpoint "cluster.health".
- 
Method SummaryModifier and TypeMethodDescriptionfinal List<ExpandWildcard>Whether to expand wildcard expression to concrete indices that are open, closed or both.index()Comma-separated list of data streams, indices, and index aliases used to limit the request.final Levellevel()Can be one of cluster, indices or shards.final Booleanlocal()If true, the request retrieves information from the local node only.final TimePeriod to wait for a connection to the master node.static HealthRequestfinal Timetimeout()Period to wait for a response.final WaitForActiveShardsA number controlling to how many active shards to wait for, all to wait for all shards in the cluster to be active, or 0 to not wait.final WaitForEventsCan be one of immediate, urgent, high, normal, low, languid.final StringThe request waits until the specified number N of nodes is available.final BooleanA boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard initializations.final BooleanA boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard relocations.final HealthStatusOne of green, yellow or red.Methods inherited from class co.elastic.clients.elasticsearch._types.RequestBasetoString
- 
Field Details- 
_ENDPOINTEndpoint "cluster.health".
 
- 
- 
Method Details- 
of
- 
expandWildcardsWhether to expand wildcard expression to concrete indices that are open, closed or both.API name: expand_wildcards
- 
indexComma-separated list of data streams, indices, and index aliases used to limit the request. Wildcard expressions (*) are supported. To target all data streams and indices in a cluster, omit this parameter or use _all or*.API name: index
- 
levelCan be one of cluster, indices or shards. Controls the details level of the health information returned.API name: level
- 
localIf true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node.API name: local
- 
masterTimeoutPeriod to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.API name: master_timeout
- 
timeoutPeriod to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.API name: timeout
- 
waitForActiveShardsA number controlling to how many active shards to wait for, all to wait for all shards in the cluster to be active, or 0 to not wait.API name: wait_for_active_shards
- 
waitForEventsCan be one of immediate, urgent, high, normal, low, languid. Wait until all currently queued events with the given priority are processed.API name: wait_for_events
- 
waitForNoInitializingShardsA boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard initializations. Defaults to false, which means it will not wait for initializing shards.API name: wait_for_no_initializing_shards
- 
waitForNoRelocatingShardsA boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard relocations. Defaults to false, which means it will not wait for relocating shards.API name: wait_for_no_relocating_shards
- 
waitForNodesThe request waits until the specified number N of nodes is available. It also accepts >=N, <=N, >N and <N. Alternatively, it is possible to use ge(N), le(N), gt(N) and lt(N) notation.API name: wait_for_nodes
- 
waitForStatusOne of green, yellow or red. Will wait (until the timeout provided) until the status of the cluster changes to the one provided or better, i.e. green > yellow > red. By default, will not wait for any status.API name: wait_for_status
 
-