get-index-template-v1.asciidoc 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. [[indices-get-template-v1]]
  2. === Get index template API
  3. ++++
  4. <titleabbrev>Get index template (legacy)</titleabbrev>
  5. ++++
  6. IMPORTANT: This documentation is about legacy index templates,
  7. which are deprecated and will be replaced by the composable templates introduced in {es} 7.8.
  8. For information about composable templates, see <<index-templates>>.
  9. Retrieves information about one or more index templates.
  10. ////
  11. [source,console]
  12. --------------------------------------------------
  13. PUT _template/template_1
  14. {
  15. "index_patterns" : ["te*"],
  16. "settings": {
  17. "number_of_shards": 1
  18. }
  19. }
  20. --------------------------------------------------
  21. // TESTSETUP
  22. [source,console]
  23. --------------------------------------------------
  24. DELETE _template/template_1
  25. --------------------------------------------------
  26. // TEARDOWN
  27. ////
  28. [source,console]
  29. --------------------------------------------------
  30. GET /_template/template_1
  31. --------------------------------------------------
  32. [[get-template-v1-api-request]]
  33. ==== {api-request-title}
  34. `GET /_template/<index-template>`
  35. [[get-template-v1-api-prereqs]]
  36. ==== {api-prereq-title}
  37. * If the {es} {security-features} are enabled, you must have the
  38. `manage_index_templates` or `manage` <<privileges-list-cluster,cluster
  39. privilege>> to use this API.
  40. [[get-template-v1-api-path-params]]
  41. ==== {api-path-parms-title}
  42. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=index-template]
  43. +
  44. To return all index templates, omit this parameter
  45. or use a value of `_all` or `*`.
  46. [[get-template-v1-api-query-params]]
  47. ==== {api-query-parms-title}
  48. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=flat-settings]
  49. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=local]
  50. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=master-timeout]
  51. [[get-template-v1-api-example]]
  52. ==== {api-examples-title}
  53. [[get-template-v1-api-multiple-ex]]
  54. ===== Get multiple index templates
  55. [source,console]
  56. --------------------------------------------------
  57. GET /_template/template_1,template_2
  58. --------------------------------------------------
  59. [[get-template-v1-api-wildcard-ex]]
  60. ===== Get index templates using a wildcard expression
  61. [source,console]
  62. --------------------------------------------------
  63. GET /_template/temp*
  64. --------------------------------------------------
  65. [[get-template-v1-api-all-ex]]
  66. ===== Get all index templates
  67. [source,console]
  68. --------------------------------------------------
  69. GET /_template
  70. --------------------------------------------------