|
| 1 | +[[indices-get-template]] |
| 2 | +=== Get index template API |
| 3 | +++++ |
| 4 | +<titleabbrev>Get template index</titleabbrev> |
| 5 | +++++ |
| 6 | + |
| 7 | +Returns information about one or more index templates. |
| 8 | + |
| 9 | +//// |
| 10 | +[source,js] |
| 11 | +-------------------------------------------------- |
| 12 | +PUT _template/template_1 |
| 13 | +{ |
| 14 | + "index_patterns" : ["te*"], |
| 15 | + "settings": { |
| 16 | + "number_of_shards": 1 |
| 17 | + } |
| 18 | +} |
| 19 | +-------------------------------------------------- |
| 20 | +// CONSOLE |
| 21 | +// TESTSETUP |
| 22 | +//// |
| 23 | + |
| 24 | +[source,js] |
| 25 | +-------------------------------------------------- |
| 26 | +GET /_template/template_1 |
| 27 | +-------------------------------------------------- |
| 28 | +// CONSOLE |
| 29 | + |
| 30 | + |
| 31 | +[[get-template-api-request]] |
| 32 | +==== {api-request-title} |
| 33 | + |
| 34 | +`GET /_template/<index-template>` |
| 35 | + |
| 36 | + |
| 37 | +[[get-template-api-path-params]] |
| 38 | +==== {api-path-parms-title} |
| 39 | + |
| 40 | +include::{docdir}/rest-api/common-parms.asciidoc[tag=index-template] |
| 41 | ++ |
| 42 | +To return all index templates, omit this parameter |
| 43 | +or use a value of `_all` or `*`. |
| 44 | + |
| 45 | + |
| 46 | +[[get-template-api-query-params]] |
| 47 | +==== {api-query-parms-title} |
| 48 | + |
| 49 | +include::{docdir}/rest-api/common-parms.asciidoc[tag=flat-settings] |
| 50 | + |
| 51 | +include::{docdir}/rest-api/common-parms.asciidoc[tag=include-type-name] |
| 52 | + |
| 53 | +include::{docdir}/rest-api/common-parms.asciidoc[tag=local] |
| 54 | + |
| 55 | +include::{docdir}/rest-api/common-parms.asciidoc[tag=master-timeout] |
| 56 | + |
| 57 | + |
| 58 | +[[get-template-api-example]] |
| 59 | +==== {api-examples-title} |
| 60 | + |
| 61 | + |
| 62 | +[[get-template-api-multiple-ex]] |
| 63 | +===== Get multiple index templates |
| 64 | + |
| 65 | +[source,js] |
| 66 | +-------------------------------------------------- |
| 67 | +GET /_template/template_1,template_2 |
| 68 | +-------------------------------------------------- |
| 69 | +// CONSOLE |
| 70 | + |
| 71 | + |
| 72 | +[[get-template-api-wildcard-ex]] |
| 73 | +===== Get index templates using a wildcard expression |
| 74 | + |
| 75 | +[source,js] |
| 76 | +-------------------------------------------------- |
| 77 | +GET /_template/temp* |
| 78 | +-------------------------------------------------- |
| 79 | +// CONSOLE |
| 80 | + |
| 81 | + |
| 82 | +[[get-template-api-all-ex]] |
| 83 | +===== Get all index templates |
| 84 | + |
| 85 | +[source,js] |
| 86 | +-------------------------------------------------- |
| 87 | +GET /_template |
| 88 | +-------------------------------------------------- |
| 89 | +// CONSOLE |
0 commit comments