mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-17 10:25:15 +00:00
[DOCS] Add "get index template" API docs (#46296)
This commit is contained in:
parent
0f0b77b263
commit
034a37aa01
@ -51,6 +51,7 @@ index settings, aliases, mappings, and index templates.
|
|||||||
[[index-templates]]
|
[[index-templates]]
|
||||||
=== Index templates:
|
=== Index templates:
|
||||||
* <<indices-delete-template>>
|
* <<indices-delete-template>>
|
||||||
|
* <<indices-get-template>>
|
||||||
* <<indices-template-exists>>
|
* <<indices-template-exists>>
|
||||||
* <<indices-templates>>
|
* <<indices-templates>>
|
||||||
|
|
||||||
@ -120,6 +121,8 @@ include::indices/analyze.asciidoc[]
|
|||||||
|
|
||||||
include::indices/delete-index-template.asciidoc[]
|
include::indices/delete-index-template.asciidoc[]
|
||||||
|
|
||||||
|
include::indices/get-index-template.asciidoc[]
|
||||||
|
|
||||||
include::indices/template-exists.asciidoc[]
|
include::indices/template-exists.asciidoc[]
|
||||||
|
|
||||||
include::indices/templates.asciidoc[]
|
include::indices/templates.asciidoc[]
|
||||||
|
89
docs/reference/indices/get-index-template.asciidoc
Normal file
89
docs/reference/indices/get-index-template.asciidoc
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
[[indices-get-template]]
|
||||||
|
=== Get index template API
|
||||||
|
++++
|
||||||
|
<titleabbrev>Get template index</titleabbrev>
|
||||||
|
++++
|
||||||
|
|
||||||
|
Returns information about one or more index templates.
|
||||||
|
|
||||||
|
////
|
||||||
|
[source,js]
|
||||||
|
--------------------------------------------------
|
||||||
|
PUT _template/template_1
|
||||||
|
{
|
||||||
|
"index_patterns" : ["te*"],
|
||||||
|
"settings": {
|
||||||
|
"number_of_shards": 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
--------------------------------------------------
|
||||||
|
// CONSOLE
|
||||||
|
// TESTSETUP
|
||||||
|
////
|
||||||
|
|
||||||
|
[source,js]
|
||||||
|
--------------------------------------------------
|
||||||
|
GET /_template/template_1
|
||||||
|
--------------------------------------------------
|
||||||
|
// CONSOLE
|
||||||
|
|
||||||
|
|
||||||
|
[[get-template-api-request]]
|
||||||
|
==== {api-request-title}
|
||||||
|
|
||||||
|
`GET /_template/<index-template>`
|
||||||
|
|
||||||
|
|
||||||
|
[[get-template-api-path-params]]
|
||||||
|
==== {api-path-parms-title}
|
||||||
|
|
||||||
|
include::{docdir}/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-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=include-type-name]
|
||||||
|
|
||||||
|
include::{docdir}/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-multiple-ex]]
|
||||||
|
===== Get multiple index templates
|
||||||
|
|
||||||
|
[source,js]
|
||||||
|
--------------------------------------------------
|
||||||
|
GET /_template/template_1,template_2
|
||||||
|
--------------------------------------------------
|
||||||
|
// CONSOLE
|
||||||
|
|
||||||
|
|
||||||
|
[[get-template-api-wildcard-ex]]
|
||||||
|
===== Get index templates using a wildcard expression
|
||||||
|
|
||||||
|
[source,js]
|
||||||
|
--------------------------------------------------
|
||||||
|
GET /_template/temp*
|
||||||
|
--------------------------------------------------
|
||||||
|
// CONSOLE
|
||||||
|
|
||||||
|
|
||||||
|
[[get-template-api-all-ex]]
|
||||||
|
===== Get all index templates
|
||||||
|
|
||||||
|
[source,js]
|
||||||
|
--------------------------------------------------
|
||||||
|
GET /_template
|
||||||
|
--------------------------------------------------
|
||||||
|
// CONSOLE
|
@ -90,35 +90,11 @@ DELETE /_template/template_1
|
|||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
// CONSOLE
|
// CONSOLE
|
||||||
|
|
||||||
[float]
|
[float]
|
||||||
[[getting]]
|
[[getting]]
|
||||||
==== Getting templates
|
==== Getting templates
|
||||||
|
|
||||||
Index templates are identified by a name (in the above case
|
See <<indices-get-template>>.
|
||||||
`template_1`) and can be retrieved using the following:
|
|
||||||
|
|
||||||
[source,js]
|
|
||||||
--------------------------------------------------
|
|
||||||
GET /_template/template_1
|
|
||||||
--------------------------------------------------
|
|
||||||
// CONSOLE
|
|
||||||
|
|
||||||
You can also match several templates by using wildcards like:
|
|
||||||
|
|
||||||
[source,js]
|
|
||||||
--------------------------------------------------
|
|
||||||
GET /_template/temp*
|
|
||||||
GET /_template/template_1,template_2
|
|
||||||
--------------------------------------------------
|
|
||||||
// CONSOLE
|
|
||||||
|
|
||||||
To get list of all index templates you can run:
|
|
||||||
|
|
||||||
[source,js]
|
|
||||||
--------------------------------------------------
|
|
||||||
GET /_template
|
|
||||||
--------------------------------------------------
|
|
||||||
// CONSOLE
|
|
||||||
|
|
||||||
[float]
|
[float]
|
||||||
[[multiple-templates]]
|
[[multiple-templates]]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user