2020-07-23 22:48:19 -04:00
|
|
|
[[indices-get-template]]
|
|
|
|
=== Get index template API [[getting-templates]]
|
2019-09-04 10:58:24 -04:00
|
|
|
++++
|
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.
|
|
|
|
|
|
|
|
////
|
2020-07-23 22:48:19 -04:00
|
|
|
|
2019-09-06 11:31:13 -04:00
|
|
|
[source,console]
|
2019-09-04 10:58:24 -04:00
|
|
|
--------------------------------------------------
|
2020-07-23 22:48:19 -04:00
|
|
|
PUT /_index_template/template_1
|
2019-09-04 10:58:24 -04:00
|
|
|
{
|
2020-07-23 22:48:19 -04:00
|
|
|
"index_patterns" : ["te*"],
|
|
|
|
"priority" : 1,
|
|
|
|
"template": {
|
|
|
|
"settings" : {
|
|
|
|
"number_of_shards" : 2
|
|
|
|
}
|
2019-09-04 10:58:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
// TESTSETUP
|
2020-01-28 03:52:24 -05:00
|
|
|
|
|
|
|
[source,console]
|
|
|
|
--------------------------------------------------
|
2020-07-23 22:48:19 -04:00
|
|
|
DELETE _index_template/template_*
|
2020-01-28 03:52:24 -05:00
|
|
|
--------------------------------------------------
|
|
|
|
// 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
|
|
|
--------------------------------------------------
|
2020-07-23 22:48:19 -04:00
|
|
|
GET /_index_template/template_1
|
2019-09-04 10:58:24 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
|
2020-07-23 22:48:19 -04:00
|
|
|
[[get-template-api-request]]
|
2019-09-04 10:58:24 -04:00
|
|
|
==== {api-request-title}
|
|
|
|
|
2020-07-23 22:48:19 -04:00
|
|
|
`GET /_index_template/<index-template>`
|
2019-09-04 10:58:24 -04:00
|
|
|
|
|
|
|
|
2020-07-23 22:48:19 -04:00
|
|
|
[[get-template-api-path-params]]
|
2019-09-04 10:58:24 -04:00
|
|
|
==== {api-path-parms-title}
|
|
|
|
|
2020-07-23 22:48:19 -04:00
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=index-template]
|
2019-09-04 10:58:24 -04:00
|
|
|
+
|
2020-07-23 22:48:19 -04:00
|
|
|
To retrieve all index templates, omit this parameter or use a value of `*`.
|
2019-09-04 10:58:24 -04:00
|
|
|
|
|
|
|
|
2020-07-23 22:48:19 -04:00
|
|
|
[[get-template-api-query-params]]
|
2019-09-04 10:58:24 -04:00
|
|
|
==== {api-query-parms-title}
|
|
|
|
|
2020-07-23 22:48:19 -04:00
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=flat-settings]
|
2019-09-04 10:58:24 -04:00
|
|
|
|
2020-06-01 19:42:53 -04:00
|
|
|
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=include-type-name]
|
2019-09-04 10:58:24 -04:00
|
|
|
|
2020-06-01 19:42:53 -04:00
|
|
|
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=local]
|
2019-09-04 10:58:24 -04:00
|
|
|
|
2020-07-23 22:48:19 -04:00
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=master-timeout]
|
2019-09-04 10:58:24 -04:00
|
|
|
|
|
|
|
|
2020-07-23 22:48:19 -04:00
|
|
|
[[get-template-api-example]]
|
2019-09-04 10:58:24 -04:00
|
|
|
==== {api-examples-title}
|
|
|
|
|
|
|
|
|
2020-07-23 22:48:19 -04:00
|
|
|
[[get-template-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
|
|
|
--------------------------------------------------
|
2020-07-23 22:48:19 -04:00
|
|
|
GET /_index_template/temp*
|
2019-09-04 10:58:24 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
|
|
|
|
|
2020-07-23 22:48:19 -04:00
|
|
|
[[get-template-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
|
|
|
--------------------------------------------------
|
2020-07-23 22:48:19 -04:00
|
|
|
GET /_index_template
|
|
|
|
--------------------------------------------------
|