Method: Elasticsearch::API::Cluster::Actions#allocation_explain

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

#allocation_explain(arguments = {}) ⇒ Object

Provides explanations for shard allocations in the cluster.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :include_yes_decisions (Boolean)

    Return ‘YES’ decisions in explanation (default: false)

  • :include_disk_info (Boolean)

    Return information about disk usage and shard sizes (default: false)

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The index, shard, and primary flag to explain. Empty means ‘explain a randomly-chosen unassigned shard’

See Also:

[View source]

34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/elasticsearch/api/actions/cluster/allocation_explain.rb', line 34

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

  body   = arguments.delete(:body)

  method = if body
             Elasticsearch::API::HTTP_POST
           else
             Elasticsearch::API::HTTP_GET
           end

  path   = "_cluster/allocation/explain"
  params = Utils.process_params(arguments)

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