Method: Elasticsearch::API::Cluster::Actions#reroute

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

#reroute(arguments = {}) ⇒ Object

Allows to manually change the allocation of individual shards in the cluster.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :dry_run (Boolean)

    Simulate the operation only and return the resulting state

  • :explain (Boolean)

    Return an explanation of why the commands can or cannot be executed

  • :retry_failed (Boolean)

    Retries allocation of shards that are blocked due to too many subsequent allocation failures

  • :metric (List)

    Limit the information returned to the specified metrics. Defaults to all but metadata (options: _all, blocks, metadata, nodes, none, routing_table, master_node, version)

  • :master_timeout (Time)

    Explicit operation timeout for connection to master node

  • :timeout (Time)

    Explicit operation timeout

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The definition of ‘commands` to perform (`move`, `cancel`, `allocate`)

See Also:

[View source]

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

def reroute(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'cluster.reroute' }

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

  body = arguments.delete(:body) || {}

  method = Elasticsearch::API::HTTP_POST
  path   = '_cluster/reroute'
  params = Utils.process_params(arguments)

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