get-index-template.asciidoc 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. `include_defaults`::
  50. (Optional, Boolean) Functionality in preview:[]. If `true`, return all default settings in the response.
  51. Defaults to `false`.
  52. [[get-template-api-example]]
  53. ==== {api-examples-title}
  54. [[get-template-api-wildcard-ex]]
  55. ===== Get index templates using a wildcard expression
  56. [source,console]
  57. --------------------------------------------------
  58. GET /_index_template/temp*
  59. --------------------------------------------------
  60. [[get-template-api-all-ex]]
  61. ===== Get all index templates
  62. [source,console]
  63. --------------------------------------------------
  64. GET /_index_template
  65. --------------------------------------------------