OpenSearch/docs/reference/indices/get-component-template.asci...

89 lines
2.1 KiB
Plaintext

[[getting-component-templates]]
=== Get component template API
++++
<titleabbrev>Get component template</titleabbrev>
++++
Retrieves information about one or more component templates.
//////////////////////////
[source,console]
--------------------------------------------------
PUT /_component_template/template_1
{
"template": {
"settings": {
"index.number_of_replicas": 0
},
"mappings": {
"properties": {
"@timestamp": {
"type": "date"
}
}
}
}
}
--------------------------------------------------
// TESTSETUP
[source,console]
--------------------------------------------------
DELETE /_component_template/template_*
--------------------------------------------------
// TEARDOWN
//////////////////////////
[source,console]
--------------------------------------------------
GET /_component_template/template_1
--------------------------------------------------
[[get-component-template-api-request]]
==== {api-request-title}
`GET /_component-template/<component-template>`
[[get-component-template-api-path-params]]
==== {api-path-parms-title}
`<component-template>`
(Optional, string)
Comma-separated list of component template names used to limit the request.
Wildcard (`*`) expressions are supported.
[[get-component-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]
include::{docdir}/rest-api/common-parms.asciidoc[tag=master-timeout]
[[get-component-template-api-example]]
==== {api-examples-title}
[[get-component-template-api-wildcard-ex]]
===== Get component templates using a wildcard expression
[source,console]
--------------------------------------------------
GET /_component_template/temp*
--------------------------------------------------
[[get-component-template-api-all-ex]]
===== Get all component templates
[source,console]
--------------------------------------------------
GET /_component_template
--------------------------------------------------