Open
Description
Today allocation explain takes its parameters in the request body:
GET _cluster/allocation/explain
{
"index": "my-index-000001",
"shard": 0,
"primary": false,
"current_node": "my-node"
}
Leaving aside the question of the validity of GET-with-body (you can use POST
here) it's also just kinda awkward to pass in a flat map of 4 somewhat-optional parameters in the body. We could just as well make the API accept the same parameters in the query-part of the URI1:
GET _cluster/allocation/explain?index=my-index-000001&shard=0&primary=false¤t_node=my-node
Note that we probably shouldn't accept a mix of these two styles: if there are any parameters, they must all be in the body or all in the query string. We might even want to deprecate the use of the body for these arguments and remove it in the next major?
Footnotes
-
Technically ok you can already do this using the
source
andsource_content_type
params:GET _cluster/allocation/explain?source_content_type=application/json&source=%7B%22index%22%3A%22my-index-000001%22%2C%22shard%22%3A0%2C%22primary%22%3Afalse%2C%22current_node%22%3A%22my-node%22%7D
But eh that's not all that nice is it? ↩