mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-09 14:35:04 +00:00
The put index template api supports the create parameter (defaults to false), which tells whether the template can replace an existing one with same name or not. Unified its behaviour between PUT and POST method, whereas the POST would previously force create to true. Added create parameter to the rest spec (was missing before) and a REST test for create true scenario.
45 lines
1.4 KiB
JSON
45 lines
1.4 KiB
JSON
{
|
|
"indices.put_template": {
|
|
"documentation": "http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/indices-templates.html",
|
|
"methods": ["PUT", "POST"],
|
|
"url": {
|
|
"path": "/_template/{name}",
|
|
"paths": ["/_template/{name}"],
|
|
"parts": {
|
|
"name": {
|
|
"type" : "string",
|
|
"required" : true,
|
|
"description" : "The name of the template"
|
|
}
|
|
},
|
|
"params": {
|
|
"order": {
|
|
"type" : "number",
|
|
"description" : "The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers)"
|
|
},
|
|
"create" : {
|
|
"type" : "boolean",
|
|
"description" : "Whether the index template should only be added if new or can also replace an existing one",
|
|
"default" : false
|
|
},
|
|
"timeout": {
|
|
"type" : "time",
|
|
"description" : "Explicit operation timeout"
|
|
},
|
|
"master_timeout": {
|
|
"type" : "time",
|
|
"description" : "Specify timeout for connection to master"
|
|
},
|
|
"flat_settings": {
|
|
"type": "boolean",
|
|
"description": "Return settings in flat format (default: false)"
|
|
}
|
|
}
|
|
},
|
|
"body": {
|
|
"description" : "The template definition",
|
|
"required" : true
|
|
}
|
|
}
|
|
}
|