cluster.health

edit
client.cluster.health({
  index: string | string[],
  level: 'cluster' | 'indices' | 'shards',
  local: boolean,
  master_timeout: string,
  timeout: string,
  wait_for_active_shards: string,
  wait_for_nodes: string,
  wait_for_events: 'immediate' | 'urgent' | 'high' | 'normal' | 'low' | 'languid',
  wait_for_no_relocating_shards: boolean,
  wait_for_status: 'green' | 'yellow' | 'red'
})

Reference

index

string | string[] - Limit the information returned to a specific index

level

'cluster' | 'indices' | 'shards' - Specify the level of detail for returned information
Default: cluster

local

boolean - Return local information, do not retrieve the state from master node (default: false)

master_timeout or masterTimeout

string - Explicit operation timeout for connection to master node

timeout

string - Explicit operation timeout

wait_for_active_shards or waitForActiveShards

string - Wait until the specified number of shards is active

wait_for_nodes or waitForNodes

string - Wait until the specified number of nodes is available

wait_for_events or waitForEvents

'immediate' | 'urgent' | 'high' | 'normal' | 'low' | 'languid' - Wait until all currently queued events with the given priority are processed

wait_for_no_relocating_shards or waitForNoRelocatingShards

boolean - Whether to wait until there are no relocating shards in the cluster

wait_for_status or waitForStatus

'green' | 'yellow' | 'red' - Wait until cluster is in a specific state