get-index-template.asciidoc 2.0 KB

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