OpenSearch/rest-api-spec/api/put_template.json
javanna a857798e1c Indexed scripts: make sure headers are handed over to internal requests and streamline versioning support
The get, put and delete indexed script apis map to get, index and delete api and internally create those corresponding requests. We need to make sure that the original headers are handed over to the new request by passing the original request in the constructor when creating the new one.

Also streamlined the support for version and version_type in the REST layer since the parameters were not consistently parsed and set to the internal java API requests.

Modified the REST delete template and delete script actions to make use of a client instead of using the `ScriptService` directly.

Closes #7569
2014-09-04 16:00:32 +02:00

39 lines
1007 B
JSON

{
"put_template": {
"documentation": "http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-template.html",
"methods": ["PUT", "POST"],
"url": {
"path": "/_search/template/{id}",
"paths": [ "/_search/template/{id}" ],
"parts": {
"id": {
"type" : "string",
"description" : "Template ID",
"required" : true
}
}
},
"params" : {
"op_type": {
"type" : "enum",
"options" : ["index", "create"],
"default" : "index",
"description" : "Explicit operation type"
},
"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": {
"description" : "The document",
"required" : true
}
}
}