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
This commit is contained in:
Jason Tedor 2017-02-23 08:55:13 -05:00 committed by GitHub
parent 2f3f9b9961
commit e579629b16
4 changed files with 120 additions and 28 deletions

View File

@ -0,0 +1,71 @@
{
"exists_source": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html",
"methods": ["HEAD"],
"url": {
"path": "/{index}/{type}/{id}/_source",
"paths": ["/{index}/{type}/{id}/_source"],
"parts": {
"id": {
"type" : "string",
"required" : true,
"description" : "The document ID"
},
"index": {
"type" : "string",
"required" : true,
"description" : "The name of the index"
},
"type": {
"type" : "string",
"required" : true,
"description" : "The type of the document; use `_all` to fetch the first document matching the ID across all types"
}
},
"params": {
"parent": {
"type" : "string",
"description" : "The ID of the parent document"
},
"preference": {
"type" : "string",
"description" : "Specify the node or shard the operation should be performed on (default: random)"
},
"realtime": {
"type" : "boolean",
"description" : "Specify whether to perform the operation in realtime or search mode"
},
"refresh": {
"type" : "boolean",
"description" : "Refresh the shard containing the document before performing the operation"
},
"routing": {
"type" : "string",
"description" : "Specific routing value"
},
"_source": {
"type" : "list",
"description" : "True or false to return the _source field or not, or a list of fields to return"
},
"_source_exclude": {
"type" : "list",
"description" : "A list of fields to exclude from the returned _source field"
},
"_source_include": {
"type" : "list",
"description" : "A list of fields to extract and return from the _source field"
},
"version" : {
"type" : "number",
"description" : "Explicit version number for concurrency control"
},
"version_type": {
"type" : "enum",
"options" : ["internal", "external", "external_gte", "force"],
"description" : "Specific version type"
}
}
},
"body": null
}
}

View File

@ -9,19 +9,36 @@
"index": { "index": {
"type": "list", "type": "list",
"required": true, "required": true,
"description" : "A comma-separated list of indices to check" "description": "A comma-separated list of index names"
} }
}, },
"params": { "params": {
"local": {
"type": "boolean",
"description": "Return local information, do not retrieve the state from master node (default: false)"
},
"ignore_unavailable": {
"type": "boolean",
"description": "Ignore unavailable indexes (default: false)"
},
"allow_no_indices": {
"type": "boolean",
"description": "Ignore if a wildcard expression resolves to no concrete indices (default: false)"
},
"expand_wildcards": { "expand_wildcards": {
"type": "enum", "type": "enum",
"options": [ "open", "closed", "none", "all" ], "options": [ "open", "closed", "none", "all" ],
"default": "open", "default": "open",
"description" : "Whether to expand wildcard expression to concrete indices that are open, closed or both." "description": "Whether wildcard expressions should get expanded to open or closed indices (default: open)"
}, },
"local": { "flat_settings": {
"type": "boolean", "type": "boolean",
"description": "Return local information, do not retrieve the state from master node (default: false)" "description": "Return settings in flat format (default: false)"
},
"include_defaults": {
"type": "boolean",
"description": "Whether to return all default setting for each of the indices.",
"default": false
} }
} }
}, },

View File

@ -4,7 +4,7 @@
"methods": ["HEAD"], "methods": ["HEAD"],
"url": { "url": {
"path": "/_alias/{name}", "path": "/_alias/{name}",
"paths": ["/_alias/{name}", "/{index}/_alias/{name}", "/{index}/_alias"], "paths": ["/_alias/{name}", "/{index}/_alias/{name}"],
"parts": { "parts": {
"index": { "index": {
"type" : "list", "type" : "list",
@ -27,7 +27,7 @@
"expand_wildcards": { "expand_wildcards": {
"type" : "enum", "type" : "enum",
"options" : ["open","closed","none","all"], "options" : ["open","closed","none","all"],
"default" : ["open", "closed"], "default" : "all",
"description" : "Whether to expand wildcard expression to concrete indices that are open, closed or both." "description" : "Whether to expand wildcard expression to concrete indices that are open, closed or both."
}, },
"local": { "local": {

View File

@ -7,12 +7,16 @@
"paths": [ "/_template/{name}" ], "paths": [ "/_template/{name}" ],
"parts": { "parts": {
"name": { "name": {
"type": "string", "type": "list",
"required": true, "required": false,
"description": "The name of the template" "description": "The comma separated names of the index templates"
} }
}, },
"params": { "params": {
"flat_settings": {
"type": "boolean",
"description": "Return settings in flat format (default: false)"
},
"master_timeout": { "master_timeout": {
"type": "time", "type": "time",
"description": "Explicit operation timeout for connection to master node" "description": "Explicit operation timeout for connection to master node"