get-index-template.asciidoc 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. (Optional, string) The name of the template to return. Accepts wildcard
  43. expressions. If omitted, all templates are returned.
  44. [[get-template-api-query-params]]
  45. ==== {api-query-parms-title}
  46. include::{docdir}/rest-api/common-parms.asciidoc[tag=flat-settings]
  47. include::{docdir}/rest-api/common-parms.asciidoc[tag=local]
  48. include::{docdir}/rest-api/common-parms.asciidoc[tag=master-timeout]
  49. [[get-template-api-example]]
  50. ==== {api-examples-title}
  51. [[get-template-api-wildcard-ex]]
  52. ===== Get index templates using a wildcard expression
  53. [source,console]
  54. --------------------------------------------------
  55. GET /_index_template/temp*
  56. --------------------------------------------------
  57. [[get-template-api-all-ex]]
  58. ===== Get all index templates
  59. [source,console]
  60. --------------------------------------------------
  61. GET /_index_template
  62. --------------------------------------------------