templates.asciidoc 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. [[cat-templates]]
  2. == cat templates
  3. The `templates` command provides information about existing templates.
  4. [source,js]
  5. --------------------------------------------------
  6. GET /_cat/templates?v&s=name
  7. --------------------------------------------------
  8. // CONSOLE
  9. // TEST[s/^/PUT _template\/template0\n{"index_patterns": "te*", "order": 0}\n/]
  10. // TEST[s/^/PUT _template\/template1\n{"index_patterns": "tea*", "order": 1}\n/]
  11. // TEST[s/^/PUT _template\/template2\n{"index_patterns": "teak*", "order": 2, "version": 7}\n/]
  12. which looks like
  13. [source,txt]
  14. --------------------------------------------------
  15. name index_patterns order version
  16. template0 [te*] 0
  17. template1 [tea*] 1
  18. template2 [teak*] 2 7
  19. --------------------------------------------------
  20. // TESTRESPONSE[s/\*/\\*/ s/\[/\\[/ s/\]/\\]/ _cat]
  21. The output shows that there are three existing templates,
  22. with template2 having a version value.
  23. The endpoint also supports giving a template name or pattern in the url
  24. to filter the results, for example `/_cat/templates/template*` or
  25. `/_cat/templates/template0`.