Method: OpenSearch::API::Cluster::Actions#reroute

Defined in:
lib/opensearch/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, 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)



43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/opensearch/api/actions/cluster/reroute.rb', line 43

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

  arguments = arguments.clone

  method = OpenSearch::API::HTTP_POST
  path   = "_cluster/reroute"
  params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

  body = arguments[:body] || {}
  perform_request(method, path, params, body, headers).body
end