Class ClusterHealthRequest

All Implemented Interfaces:
IndicesRequest, IndicesRequest.Replaceable, Writeable, org.elasticsearch.core.RefCounted, TaskAwareRequest

public class ClusterHealthRequest extends MasterNodeReadRequest<ClusterHealthRequest> implements IndicesRequest.Replaceable
  • Constructor Details

    • ClusterHealthRequest

      public ClusterHealthRequest()
    • ClusterHealthRequest

      public ClusterHealthRequest(String... indices)
    • ClusterHealthRequest

      public ClusterHealthRequest(StreamInput in) throws IOException
      Throws:
      IOException
  • Method Details

    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Overrides:
      writeTo in class MasterNodeReadRequest<ClusterHealthRequest>
      Throws:
      IOException
    • indices

      public String[] indices()
      Description copied from interface: IndicesRequest
      Returns the array of indices that the action relates to
      Specified by:
      indices in interface IndicesRequest
    • indices

      public ClusterHealthRequest indices(String... indices)
      Description copied from interface: IndicesRequest.Replaceable
      Sets the indices that the action relates to.
      Specified by:
      indices in interface IndicesRequest.Replaceable
    • indicesOptions

      public IndicesOptions indicesOptions()
      Description copied from interface: IndicesRequest
      Returns the indices options used to resolve indices. They tell for instance whether a single index is accepted, whether an empty array will be converted to _all, and how wildcards will be expanded if needed.
      Specified by:
      indicesOptions in interface IndicesRequest
    • indicesOptions

      public ClusterHealthRequest indicesOptions(IndicesOptions indicesOptions)
    • includeDataStreams

      public boolean includeDataStreams()
      Description copied from interface: IndicesRequest
      Determines whether the request should be applied to data streams. When false, none of the names or wildcard expressions in IndicesRequest.indices() should be applied to or expanded to any data streams. All layers involved in the request's fulfillment including security, name resolution, etc., should respect this flag.
      Specified by:
      includeDataStreams in interface IndicesRequest
    • timeout

      public org.elasticsearch.core.TimeValue timeout()
    • timeout

      public ClusterHealthRequest timeout(org.elasticsearch.core.TimeValue timeout)
    • timeout

      public ClusterHealthRequest timeout(String timeout)
    • waitForStatus

      public ClusterHealthStatus waitForStatus()
    • waitForStatus

      public ClusterHealthRequest waitForStatus(ClusterHealthStatus waitForStatus)
    • waitForGreenStatus

      public ClusterHealthRequest waitForGreenStatus()
    • waitForYellowStatus

      public ClusterHealthRequest waitForYellowStatus()
    • waitForNoRelocatingShards

      public boolean waitForNoRelocatingShards()
    • waitForNoRelocatingShards

      public ClusterHealthRequest waitForNoRelocatingShards(boolean waitForNoRelocatingShards)
      Sets whether the request should wait for there to be no relocating shards before retrieving the cluster health status. Defaults to false, meaning the operation does not wait on there being no more relocating shards. Set to true to wait until the number of relocating shards in the cluster is 0.
    • waitForNoInitializingShards

      public boolean waitForNoInitializingShards()
    • waitForNoInitializingShards

      public ClusterHealthRequest waitForNoInitializingShards(boolean waitForNoInitializingShards)
      Sets whether the request should wait for there to be no initializing shards before retrieving the cluster health status. Defaults to false, meaning the operation does not wait on there being no more initializing shards. Set to true to wait until the number of initializing shards in the cluster is 0.
    • waitForActiveShards

      public ActiveShardCount waitForActiveShards()
    • waitForActiveShards

      public ClusterHealthRequest waitForActiveShards(ActiveShardCount waitForActiveShards)
      Sets the number of shard copies that must be active across all indices before getting the health status. Defaults to ActiveShardCount.NONE, meaning we don't wait on any active shards. Set this value to ActiveShardCount.ALL to wait for all shards (primary and all replicas) to be active across all indices in the cluster. Otherwise, use ActiveShardCount.from(int) to set this value to any non-negative integer, up to the total number of shard copies to wait for.
    • waitForActiveShards

      public ClusterHealthRequest waitForActiveShards(int waitForActiveShards)
      A shortcut for waitForActiveShards(ActiveShardCount) where the numerical shard count is passed in, instead of having to first call ActiveShardCount.from(int) to get the ActiveShardCount.
    • waitForNodes

      public String waitForNodes()
    • waitForNodes

      public ClusterHealthRequest waitForNodes(String waitForNodes)
      Waits for N number of nodes. Use "12" for exact mapping, ">12" and "<12" for range.
    • waitForEvents

      public ClusterHealthRequest waitForEvents(Priority waitForEvents)
    • waitForEvents

      public Priority waitForEvents()
    • level

      public void level(ClusterHealthRequest.Level level)
      Set the level of detail for the health information to be returned. Only used by the high-level REST Client.
    • level

      Get the level of detail for the health information to be returned. Only used by the high-level REST Client.
    • validate

      Specified by:
      validate in class ActionRequest