Skip to content

Commit 4a040b6

Browse files
cluster/allocation/explain Query Parameters (#4939)
Extends the documentation for the `cluster/allocation/explain` API after query parameter support was added in elastic/elasticsearch#129342
1 parent aa84744 commit 4a040b6

File tree

8 files changed

+232
-44
lines changed

8 files changed

+232
-44
lines changed

docs/examples/languageExamples.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16836,5 +16836,27 @@
1683616836
"language": "Java",
1683716837
"code": "client.sql().query(q -> q\n .format(SqlFormat.Txt)\n .query(\"SELECT * FROM library ORDER BY page_count DESC LIMIT 5\")\n);\n"
1683816838
}
16839+
],
16840+
"specification/cluster/allocation_explain/examples/request/ClusterAllocationExplainRequestExample2.yaml": [
16841+
{
16842+
"language": "Python",
16843+
"code": "resp = client.cluster.allocation_explain(\n index=\"my-index-000001\",\n shard=\"0\",\n primary=False,\n current_node=\"my-node\",\n)"
16844+
},
16845+
{
16846+
"language": "JavaScript",
16847+
"code": "const response = await client.cluster.allocationExplain({\n index: \"my-index-000001\",\n shard: 0,\n primary: \"false\",\n current_node: \"my-node\",\n});"
16848+
},
16849+
{
16850+
"language": "Ruby",
16851+
"code": "response = client.cluster.allocation_explain(\n index: \"my-index-000001\",\n shard: \"0\",\n primary: \"false\",\n current_node: \"my-node\",\n body: {}\n)"
16852+
},
16853+
{
16854+
"language": "PHP",
16855+
"code": "$resp = $client->cluster()->allocationExplain([\n \"index\" => \"my-index-000001\",\n \"shard\" => \"0\",\n \"primary\" => \"false\",\n \"current_node\" => \"my-node\",\n \"body\" => new ArrayObject([]),\n]);"
16856+
},
16857+
{
16858+
"language": "curl",
16859+
"code": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{}' \"$ELASTICSEARCH_URL/_cluster/allocation/explain?index=my-index-000001&shard=0&primary=false&current_node=my-node\""
16860+
}
1683916861
]
1684016862
}

output/openapi/elasticsearch-openapi.json

Lines changed: 79 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/schema/schema.json

Lines changed: 91 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/schema/validation-errors.json

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
{
22
"endpointErrors": {
3-
"cluster.allocation_explain": {
4-
"request": [
5-
"Request: missing json spec query parameter 'index'",
6-
"Request: missing json spec query parameter 'shard'",
7-
"Request: missing json spec query parameter 'primary'",
8-
"Request: missing json spec query parameter 'current_node'"
9-
],
10-
"response": []
11-
},
123
"msearch": {
134
"request": [
145
"Request: query parameter 'allow_no_indices' does not exist in the json spec",

0 commit comments

Comments
 (0)