2016-09-20 04:40:23 -04:00
|
|
|
[[cat-templates]]
|
|
|
|
== cat templates
|
|
|
|
|
|
|
|
The `templates` command provides information about existing templates.
|
|
|
|
|
2017-05-03 20:58:23 -04:00
|
|
|
[source,js]
|
2016-09-20 04:40:23 -04:00
|
|
|
--------------------------------------------------
|
2017-05-03 20:58:23 -04:00
|
|
|
GET /_cat/templates?v&s=name
|
2016-09-20 04:40:23 -04:00
|
|
|
--------------------------------------------------
|
2017-05-03 20:58:23 -04:00
|
|
|
// CONSOLE
|
|
|
|
// TEST[s/^/PUT _template\/template0\n{"index_patterns": "te*", "order": 0}\n/]
|
|
|
|
// TEST[s/^/PUT _template\/template1\n{"index_patterns": "tea*", "order": 1}\n/]
|
|
|
|
// TEST[s/^/PUT _template\/template2\n{"index_patterns": "teak*", "order": 2, "version": 7}\n/]
|
|
|
|
|
|
|
|
which looks like
|
|
|
|
|
|
|
|
[source,txt]
|
|
|
|
--------------------------------------------------
|
|
|
|
name index_patterns order version
|
|
|
|
template0 [te*] 0
|
|
|
|
template1 [tea*] 1
|
|
|
|
template2 [teak*] 2 7
|
|
|
|
--------------------------------------------------
|
|
|
|
// TESTRESPONSE[s/\*/\\*/ s/\[/\\[/ s/\]/\\]/ _cat]
|
2016-09-20 04:40:23 -04:00
|
|
|
|
|
|
|
The output shows that there are three existing templates,
|
2017-02-16 14:41:42 -05:00
|
|
|
with template2 having a version value.
|
2016-09-20 04:40:23 -04:00
|
|
|
|
|
|
|
The endpoint also supports giving a template name or pattern in the url
|
|
|
|
to filter the results, for example `/_cat/templates/template*` or
|
|
|
|
`/_cat/templates/template0`.
|