Commit Graph

8 Commits

Author SHA1 Message Date
Lee Hinman e53a43800e Add `explain` flag support to the reroute API
By specifying the `explain` flag, an explanation for the reason a
command can or cannot be executed is returned. No allocation commands
are actually performed.

Returns a response similar to:

{
  "state": {...cluster state...},
  "acknowledged": true,
  "explanations" : [ {
    "command" : "cancel",
      "parameters" : {
        "index" : "decide",
        "shard" : 0,
        "node" : "IvpoKRdtRiGrQ_WKtt4_4w",
        "allow_primary" : false
      },
      "decisions" : [ {
        "decider" : "cancel_allocation_command",
        "decision" : "YES",
        "explanation" : "..."
        } ]
     }, {
      "command" : "move",
      "parameters" : {
        "index" : "decide",
        "shard" : 0,
        "from_node" : "IvpoKRdtRiGrQ_WKtt4_4w",
        "to_node" : "IvpoKRdtRiGrQ_WKtt4_4w"
       },
       "decisions" : [ {
         "decider" : "same_shard",
         "decision" : "NO",
         "explanation" : "shard cannot be allocated on same node [IvpoKRdtRiGrQ_WKtt4_4w] it already exists on"
       },
       etc
       ]
  }]
}

also removes AllocationExplanation from cluster state

Closes #2483
Closes #5169
2014-02-27 09:48:51 -07:00
Clinton Gormley d70e6c4730 [SPEC] Updated docs URLs to point to master 2014-01-22 14:40:31 +01:00
Clinton Gormley 056609b46c [SPEC] Added timeout, master_timeout to cluster.get_settings and cluster.reroute 2014-01-16 15:29:50 +01:00
Spencer Alger 71d77d17e1 Updated the documentation urls in the rest api spec. 2014-01-09 14:44:14 -07:00
Honza Kral 18a866d011 cluster reroute filter_metadata description 2013-06-04 17:35:22 +02:00
Karel Minarik 9e7b668409 Small text edits for `_cluster/reroute` 2013-05-28 10:32:27 +02:00
Karel Minarik cff45b4a7d Added the API definition for `_cluster/reroute` 2013-05-26 15:51:58 +02:00
Karel Minarik a55750dd70 [SETUP] Added the generated JSON skeleton files
Files were generated with the `thor api:generate:spec --force --verbose --crawl` command,
and based on the 0.90 branch (elasticsearch/elasticsearch@5ec4064).
2013-05-24 13:33:06 +02:00