elasticsearch/docs/reference/indices/get-index-template.asciidoc
Niels Bauman 65e4ec129c
Run TransportGetComposableIndexTemplate on local node (#119830)
This action solely needs the cluster state, it can run on any node.
Additionally, it needs to be cancellable to avoid doing unnecessary work
after a client failure or timeout.

As a drive-by, this removes another usage of the trappy default master
node timeout.
2025-01-10 09:00:31 +10:00

95 lines
2.4 KiB
Text

[[indices-get-template]]
=== Get index template API [[getting-templates]]
++++
<titleabbrev>Get index template</titleabbrev>
++++
.New API reference
[sidebar]
--
For the most up-to-date API details, refer to {api-es}/group/endpoint-indices[Index APIs].
--
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-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, or the `monitor` cluster privilege to retrieve templates.
[[get-template-api-path-params]]
==== {api-path-parms-title}
(Optional, string) The name of the template to return. Accepts wildcard
expressions. If omitted, all templates are returned.
[[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=local-deprecated-9.0.0]
include::{docdir}/rest-api/common-parms.asciidoc[tag=master-timeout]
`include_defaults`::
(Optional, Boolean) Functionality in preview:[]. If `true`, return all default settings in the response.
Defaults to `false`.
[[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
--------------------------------------------------