Method: Elasticsearch::API::Cluster::Actions#health

Defined in:
lib/elasticsearch/api/actions/cluster/health.rb

#health(arguments = {}) ⇒ Object

Returns basic information about the health of the cluster.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :index (List)

    Limit the information returned to a specific index

  • :expand_wildcards (String)

    Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)

  • :level (String)

    Specify the level of detail for returned information (options: cluster, indices, shards)

  • :local (Boolean)

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

  • :master_timeout (Time)

    Explicit operation timeout for connection to master node

  • :timeout (Time)

    Explicit operation timeout

  • :wait_for_active_shards (String)

    Wait until the specified number of shards is active

  • :wait_for_nodes (String)

    Wait until the specified number of nodes is available

  • :wait_for_events (String)

    Wait until all currently queued events with the given priority are processed (options: immediate, urgent, high, normal, low, languid)

  • :wait_for_no_relocating_shards (Boolean)

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

  • :wait_for_no_initializing_shards (Boolean)

    Whether to wait until there are no initializing shards in the cluster

  • :wait_for_status (String)

    Wait until cluster is in a specific state (options: green, yellow, red)

  • :headers (Hash)

    Custom HTTP headers

See Also:


43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/elasticsearch/api/actions/cluster/health.rb', line 43

def health(arguments = {})
  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = nil

  _index = arguments.delete(:index)

  method = Elasticsearch::API::HTTP_GET
  path   = if _index
             "_cluster/health/#{Utils.__listify(_index)}"
           else
             "_cluster/health"
           end
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers)
  )
end