get-index-template.asciidoc 1.9 KB

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