2019-09-04 10:58:24 -04:00
|
|
|
[[indices-get-template]]
|
|
|
|
=== 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
|
|
|
|
////
|
|
|
|
|
2019-09-06 11:31:13 -04:00
|
|
|
[source,console]
|
2019-09-04 10:58:24 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
GET /_template/template_1
|
|
|
|
--------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
[[get-template-api-request]]
|
|
|
|
==== {api-request-title}
|
|
|
|
|
|
|
|
`GET /_template/<index-template>`
|
|
|
|
|
|
|
|
|
|
|
|
[[get-template-api-path-params]]
|
|
|
|
==== {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 `*`.
|
|
|
|
|
|
|
|
|
|
|
|
[[get-template-api-query-params]]
|
|
|
|
==== {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]
|
|
|
|
|
|
|
|
|
|
|
|
[[get-template-api-example]]
|
|
|
|
==== {api-examples-title}
|
|
|
|
|
|
|
|
|
|
|
|
[[get-template-api-multiple-ex]]
|
|
|
|
===== 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
|
|
|
|
--------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
[[get-template-api-wildcard-ex]]
|
|
|
|
===== 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*
|
|
|
|
--------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
[[get-template-api-all-ex]]
|
|
|
|
===== Get all index templates
|
|
|
|
|
2019-09-06 11:31:13 -04:00
|
|
|
[source,console]
|
2019-09-04 10:58:24 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
GET /_template
|
|
|
|
--------------------------------------------------
|