OpenSearch/docs/reference/indices/get-index-template.asciidoc

85 lines
1.9 KiB
Plaintext

[[indices-get-template]]
=== Get index template API [[getting-templates]]
++++
<titleabbrev>Get index template</titleabbrev>
++++
Returns information about one or more index templates.
////
[source,console]
--------------------------------------------------
PUT /_index_template/template_1
{
"index_patterns" : ["te*"],
"priority" : 1,
"template": {
"settings" : {
"number_of_shards" : 2
}
}
}
--------------------------------------------------
// TESTSETUP
[source,console]
--------------------------------------------------
DELETE _index_template/template_*
--------------------------------------------------
// TEARDOWN
////
[source,console]
--------------------------------------------------
GET /_index_template/template_1
--------------------------------------------------
[[get-template-api-request]]
==== {api-request-title}
`GET /_index_template/<index-template>`
[[get-template-api-path-params]]
==== {api-path-parms-title}
include::{docdir}/rest-api/common-parms.asciidoc[tag=index-template]
+
To retrieve all index templates, omit this parameter or use a value of `*`.
[[get-template-api-query-params]]
==== {api-query-parms-title}
include::{docdir}/rest-api/common-parms.asciidoc[tag=flat-settings]
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=include-type-name]
include::{es-repo-dir}/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-wildcard-ex]]
===== Get index templates using a wildcard expression
[source,console]
--------------------------------------------------
GET /_index_template/temp*
--------------------------------------------------
[[get-template-api-all-ex]]
===== Get all index templates
[source,console]
--------------------------------------------------
GET /_index_template
--------------------------------------------------