Skip to content

Commit e579629

Browse files
authored
Align REST specs for HEAD requests
Previous changes aligned HEAD requests to be consistent with GET requests to the same endpoint. This commit aligns the REST spec for the impacted endpoints. Relates #23313
1 parent 2f3f9b9 commit e579629

File tree

4 files changed

+119
-27
lines changed

4 files changed

+119
-27
lines changed
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{
2+
"exists_source": {
3+
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html",
4+
"methods": ["HEAD"],
5+
"url": {
6+
"path": "/{index}/{type}/{id}/_source",
7+
"paths": ["/{index}/{type}/{id}/_source"],
8+
"parts": {
9+
"id": {
10+
"type" : "string",
11+
"required" : true,
12+
"description" : "The document ID"
13+
},
14+
"index": {
15+
"type" : "string",
16+
"required" : true,
17+
"description" : "The name of the index"
18+
},
19+
"type": {
20+
"type" : "string",
21+
"required" : true,
22+
"description" : "The type of the document; use `_all` to fetch the first document matching the ID across all types"
23+
}
24+
},
25+
"params": {
26+
"parent": {
27+
"type" : "string",
28+
"description" : "The ID of the parent document"
29+
},
30+
"preference": {
31+
"type" : "string",
32+
"description" : "Specify the node or shard the operation should be performed on (default: random)"
33+
},
34+
"realtime": {
35+
"type" : "boolean",
36+
"description" : "Specify whether to perform the operation in realtime or search mode"
37+
},
38+
"refresh": {
39+
"type" : "boolean",
40+
"description" : "Refresh the shard containing the document before performing the operation"
41+
},
42+
"routing": {
43+
"type" : "string",
44+
"description" : "Specific routing value"
45+
},
46+
"_source": {
47+
"type" : "list",
48+
"description" : "True or false to return the _source field or not, or a list of fields to return"
49+
},
50+
"_source_exclude": {
51+
"type" : "list",
52+
"description" : "A list of fields to exclude from the returned _source field"
53+
},
54+
"_source_include": {
55+
"type" : "list",
56+
"description" : "A list of fields to extract and return from the _source field"
57+
},
58+
"version" : {
59+
"type" : "number",
60+
"description" : "Explicit version number for concurrency control"
61+
},
62+
"version_type": {
63+
"type" : "enum",
64+
"options" : ["internal", "external", "external_gte", "force"],
65+
"description" : "Specific version type"
66+
}
67+
}
68+
},
69+
"body": null
70+
}
71+
}

rest-api-spec/src/main/resources/rest-api-spec/api/indices.exists.json

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,44 @@
11
{
22
"indices.exists": {
33
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-exists.html",
4-
"methods": ["HEAD"],
4+
"methods": [ "HEAD" ],
55
"url": {
66
"path": "/{index}",
7-
"paths": ["/{index}"],
7+
"paths": [ "/{index}" ],
88
"parts": {
99
"index": {
10-
"type" : "list",
11-
"required" : true,
12-
"description" : "A comma-separated list of indices to check"
10+
"type": "list",
11+
"required": true,
12+
"description": "A comma-separated list of index names"
1313
}
1414
},
1515
"params": {
16+
"local": {
17+
"type": "boolean",
18+
"description": "Return local information, do not retrieve the state from master node (default: false)"
19+
},
20+
"ignore_unavailable": {
21+
"type": "boolean",
22+
"description": "Ignore unavailable indexes (default: false)"
23+
},
24+
"allow_no_indices": {
25+
"type": "boolean",
26+
"description": "Ignore if a wildcard expression resolves to no concrete indices (default: false)"
27+
},
1628
"expand_wildcards": {
17-
"type" : "enum",
18-
"options" : ["open","closed","none","all"],
19-
"default" : "open",
20-
"description" : "Whether to expand wildcard expression to concrete indices that are open, closed or both."
29+
"type": "enum",
30+
"options": [ "open", "closed", "none", "all" ],
31+
"default": "open",
32+
"description": "Whether wildcard expressions should get expanded to open or closed indices (default: open)"
2133
},
22-
"local": {
23-
"type": "boolean",
24-
"description": "Return local information, do not retrieve the state from master node (default: false)"
34+
"flat_settings": {
35+
"type": "boolean",
36+
"description": "Return settings in flat format (default: false)"
37+
},
38+
"include_defaults": {
39+
"type": "boolean",
40+
"description": "Whether to return all default setting for each of the indices.",
41+
"default": false
2542
}
2643
}
2744
},

rest-api-spec/src/main/resources/rest-api-spec/api/indices.exists_alias.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"methods": ["HEAD"],
55
"url": {
66
"path": "/_alias/{name}",
7-
"paths": ["/_alias/{name}", "/{index}/_alias/{name}", "/{index}/_alias"],
7+
"paths": ["/_alias/{name}", "/{index}/_alias/{name}"],
88
"parts": {
99
"index": {
1010
"type" : "list",
@@ -17,22 +17,22 @@
1717
},
1818
"params": {
1919
"ignore_unavailable": {
20-
"type" : "boolean",
21-
"description" : "Whether specified concrete indices should be ignored when unavailable (missing or closed)"
20+
"type" : "boolean",
21+
"description" : "Whether specified concrete indices should be ignored when unavailable (missing or closed)"
2222
},
2323
"allow_no_indices": {
24-
"type" : "boolean",
25-
"description" : "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)"
24+
"type" : "boolean",
25+
"description" : "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)"
2626
},
2727
"expand_wildcards": {
28-
"type" : "enum",
29-
"options" : ["open","closed","none","all"],
30-
"default" : ["open", "closed"],
31-
"description" : "Whether to expand wildcard expression to concrete indices that are open, closed or both."
28+
"type" : "enum",
29+
"options" : ["open","closed","none","all"],
30+
"default" : "all",
31+
"description" : "Whether to expand wildcard expression to concrete indices that are open, closed or both."
3232
},
3333
"local": {
34-
"type": "boolean",
35-
"description": "Return local information, do not retrieve the state from master node (default: false)"
34+
"type": "boolean",
35+
"description": "Return local information, do not retrieve the state from master node (default: false)"
3636
}
3737
}
3838
},

rest-api-spec/src/main/resources/rest-api-spec/api/indices.exists_template.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,19 @@
44
"methods": ["HEAD"],
55
"url": {
66
"path": "/_template/{name}",
7-
"paths": ["/_template/{name}"],
7+
"paths": [ "/_template/{name}" ],
88
"parts": {
99
"name": {
10-
"type": "string",
11-
"required": true,
12-
"description": "The name of the template"
10+
"type": "list",
11+
"required": false,
12+
"description": "The comma separated names of the index templates"
1313
}
1414
},
1515
"params": {
16+
"flat_settings": {
17+
"type": "boolean",
18+
"description": "Return settings in flat format (default: false)"
19+
},
1620
"master_timeout": {
1721
"type": "time",
1822
"description": "Explicit operation timeout for connection to master node"

0 commit comments

Comments
 (0)