2020-04-28 18:10:50 -04:00
|
|
|
[[indices-get-template-v1]]
|
2019-09-04 10:58:24 -04:00
|
|
|
=== Get index template API
|
|
|
|
++++
|
2019-10-01 17:07:28 -04:00
|
|
|
<titleabbrev>Get index template</titleabbrev>
|
2019-09-04 10:58:24 -04:00
|
|
|
++++
|
|
|
|
|
|
|
|
Returns information about one or more index templates.
|
|
|
|
|
|
|
|
////
|
2019-09-06 11:31:13 -04:00
|
|
|
[source,console]
|
2019-09-04 10:58:24 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
PUT _template/template_1
|
|
|
|
{
|
|
|
|
"index_patterns" : ["te*"],
|
|
|
|
"settings": {
|
|
|
|
"number_of_shards": 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
// TESTSETUP
|
2020-01-28 03:52:24 -05:00
|
|
|
|
|
|
|
[source,console]
|
|
|
|
--------------------------------------------------
|
|
|
|
DELETE _template/template_1
|
|
|
|
--------------------------------------------------
|
|
|
|
// TEARDOWN
|
|
|
|
|
2019-09-04 10:58:24 -04:00
|
|
|
////
|
|
|
|
|
2019-09-06 11:31:13 -04:00
|
|
|
[source,console]
|
2019-09-04 10:58:24 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
GET /_template/template_1
|
|
|
|
--------------------------------------------------
|
|
|
|
|
|
|
|
|
2020-04-28 18:10:50 -04:00
|
|
|
[[get-template-v1-api-request]]
|
2019-09-04 10:58:24 -04:00
|
|
|
==== {api-request-title}
|
|
|
|
|
|
|
|
`GET /_template/<index-template>`
|
|
|
|
|
|
|
|
|
2020-04-28 18:10:50 -04:00
|
|
|
[[get-template-v1-api-path-params]]
|
2019-09-04 10:58:24 -04:00
|
|
|
==== {api-path-parms-title}
|
|
|
|
|
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=index-template]
|
|
|
|
+
|
|
|
|
To return all index templates, omit this parameter
|
|
|
|
or use a value of `_all` or `*`.
|
|
|
|
|
|
|
|
|
2020-04-28 18:10:50 -04:00
|
|
|
[[get-template-v1-api-query-params]]
|
2019-09-04 10:58:24 -04:00
|
|
|
==== {api-query-parms-title}
|
|
|
|
|
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=flat-settings]
|
|
|
|
|
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=include-type-name]
|
|
|
|
|
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=local]
|
|
|
|
|
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=master-timeout]
|
|
|
|
|
|
|
|
|
2020-04-28 18:10:50 -04:00
|
|
|
[[get-template-v1-api-example]]
|
2019-09-04 10:58:24 -04:00
|
|
|
==== {api-examples-title}
|
|
|
|
|
|
|
|
|
2020-04-28 18:10:50 -04:00
|
|
|
[[get-template-v1-api-multiple-ex]]
|
2019-09-04 10:58:24 -04:00
|
|
|
===== Get multiple index templates
|
|
|
|
|
2019-09-06 11:31:13 -04:00
|
|
|
[source,console]
|
2019-09-04 10:58:24 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
GET /_template/template_1,template_2
|
|
|
|
--------------------------------------------------
|
|
|
|
|
|
|
|
|
2020-04-28 18:10:50 -04:00
|
|
|
[[get-template-v1-api-wildcard-ex]]
|
2019-09-04 10:58:24 -04:00
|
|
|
===== Get index templates using a wildcard expression
|
|
|
|
|
2019-09-06 11:31:13 -04:00
|
|
|
[source,console]
|
2019-09-04 10:58:24 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
GET /_template/temp*
|
|
|
|
--------------------------------------------------
|
|
|
|
|
|
|
|
|
2020-04-28 18:10:50 -04:00
|
|
|
[[get-template-v1-api-all-ex]]
|
2019-09-04 10:58:24 -04:00
|
|
|
===== Get all index templates
|
|
|
|
|
2019-09-06 11:31:13 -04:00
|
|
|
[source,console]
|
2019-09-04 10:58:24 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
GET /_template
|
|
|
|
--------------------------------------------------
|