-
Notifications
You must be signed in to change notification settings - Fork 25k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[REST Compatible API] 'template' parameter and field on PUT index tem…
…plate (#71238)
- Loading branch information
Showing
3 changed files
with
138 additions
and
2 deletions.
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
...c/src/yamlRestCompatTest/resources/rest-api-spec/api/indices.put_template_with_param.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"indices.put_template_with_param":{ | ||
"documentation":{ | ||
"url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html", | ||
"description":"Creates or updates an index template." | ||
}, | ||
"stability":"stable", | ||
"visibility":"public", | ||
"headers":{ | ||
"accept": [ "application/vnd.elasticsearch+json;compatible-with=7"], | ||
"content_type": ["application/vnd.elasticsearch+json;compatible-with=7"] | ||
}, | ||
"url":{ | ||
"paths":[ | ||
{ | ||
"path":"/_template/{name}", | ||
"methods":[ | ||
"PUT", | ||
"POST" | ||
], | ||
"parts":{ | ||
"name":{ | ||
"type":"string", | ||
"description":"The name of the template" | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"params":{ | ||
"template":{ | ||
"type":"string", | ||
"description":"The indices that this template should apply to, replaced by index_patterns within the template definition." | ||
}, | ||
"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 | ||
}, | ||
"master_timeout":{ | ||
"type":"time", | ||
"description":"Specify timeout for connection to master" | ||
} | ||
}, | ||
"body":{ | ||
"description":"The template definition", | ||
"required":true | ||
} | ||
} | ||
} |
68 changes: 68 additions & 0 deletions
68
...CompatTest/resources/rest-api-spec/test/v7compat/indices.put_template/10_basic_compat.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
--- | ||
setup: | ||
- skip: | ||
version: "9.0.0 - " | ||
reason: "compatible from 8.x to 7.x" | ||
features: | ||
- "headers" | ||
- "warnings" | ||
|
||
--- | ||
"Put template": | ||
|
||
- do: | ||
headers: | ||
Content-Type: "application/vnd.elasticsearch+json;compatible-with=7" | ||
Accept: "application/vnd.elasticsearch+json;compatible-with=7" | ||
warnings: | ||
- "Deprecated field [template] used, replaced by [index_patterns]" | ||
indices.put_template: | ||
name: test | ||
body: | ||
template: test-* | ||
settings: | ||
number_of_shards: 1 | ||
number_of_replicas: 0 | ||
mappings: | ||
properties: | ||
field: | ||
type: keyword | ||
|
||
- do: | ||
indices.get_template: | ||
name: test | ||
flat_settings: true | ||
|
||
- match: {test.index_patterns: ["test-*"]} | ||
- match: {test.settings: {index.number_of_shards: '1', index.number_of_replicas: '0'}} | ||
- match: {test.mappings: {properties: {field: {type: keyword}}}} | ||
|
||
--- | ||
"Put template (with template parameter)": | ||
|
||
- do: | ||
headers: | ||
Content-Type: "application/vnd.elasticsearch+json;compatible-with=7" | ||
Accept: "application/vnd.elasticsearch+json;compatible-with=7" | ||
warnings: | ||
- "Deprecated parameter [template] used, replaced by [index_patterns]" | ||
indices.put_template_with_param: | ||
name: test | ||
template: "test-*" | ||
body: | ||
settings: | ||
number_of_shards: 1 | ||
number_of_replicas: 0 | ||
mappings: | ||
properties: | ||
field: | ||
type: keyword | ||
|
||
- do: | ||
indices.get_template: | ||
name: test | ||
flat_settings: true | ||
|
||
- match: {test.index_patterns: ["test-*"]} | ||
- match: {test.settings: {index.number_of_shards: '1', index.number_of_replicas: '0'}} | ||
- match: {test.mappings: {properties: {field: {type: keyword}}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters