get-index-template.asciidoc 1.9 KB

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