elasticsearch/docs/reference/indices/get-index-template-v1.asciidoc
Liam Thompson 33a71e3289
[DOCS] Refactor book-scoped variables in docs/reference/index.asciidoc (#107413)
* Remove `es-test-dir` book-scoped variable

* Remove `plugins-examples-dir` book-scoped variable

* Remove `:dependencies-dir:` and `:xes-repo-dir:` book-scoped variables

- In `index.asciidoc`, two variables (`:dependencies-dir:` and `:xes-repo-dir:`) were removed.
- In `sql/index.asciidoc`, the `:sql-tests:` path was updated to fuller path
- In `esql/index.asciidoc`, the `:esql-tests:` path was updated idem

* Replace `es-repo-dir` with `es-ref-dir`

* Move `:include-xpack: true` to few files that use it, remove from index.asciidoc
2024-04-17 14:37:07 +02:00

99 lines
2.4 KiB
Text

[[indices-get-template-v1]]
=== Get index template API
++++
<titleabbrev>Get index template (legacy)</titleabbrev>
++++
IMPORTANT: This documentation is about legacy index templates,
which are deprecated and will be replaced by the composable templates introduced in {es} 7.8.
For information about composable templates, see <<index-templates>>.
Retrieves information about one or more index templates.
////
[source,console]
--------------------------------------------------
PUT _template/template_1
{
"index_patterns" : ["te*"],
"settings": {
"number_of_shards": 1
}
}
--------------------------------------------------
// TESTSETUP
[source,console]
--------------------------------------------------
DELETE _template/template_1
--------------------------------------------------
// TEARDOWN
////
[source,console]
--------------------------------------------------
GET /_template/template_1
--------------------------------------------------
[[get-template-v1-api-request]]
==== {api-request-title}
`GET /_template/<index-template>`
[[get-template-v1-api-prereqs]]
==== {api-prereq-title}
* If the {es} {security-features} are enabled, you must have the
`manage_index_templates` or `manage` <<privileges-list-cluster,cluster
privilege>> to use this API.
[[get-template-v1-api-path-params]]
==== {api-path-parms-title}
include::{es-ref-dir}/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-v1-api-query-params]]
==== {api-query-parms-title}
include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=flat-settings]
include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=local]
include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=master-timeout]
[[get-template-v1-api-example]]
==== {api-examples-title}
[[get-template-v1-api-multiple-ex]]
===== Get multiple index templates
[source,console]
--------------------------------------------------
GET /_template/template_1,template_2
--------------------------------------------------
[[get-template-v1-api-wildcard-ex]]
===== Get index templates using a wildcard expression
[source,console]
--------------------------------------------------
GET /_template/temp*
--------------------------------------------------
[[get-template-v1-api-all-ex]]
===== Get all index templates
[source,console]
--------------------------------------------------
GET /_template
--------------------------------------------------