mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-06 04:58:50 +00:00
d31a8e6558
Adds a cat api endpoint: /_cat/templates and its more specific version, /_cat/templates/{name}. It looks something like: $ curl "localhost:9200/_cat/templates?v" name template order version sushi_california_roll *avocado* 1 1 pizza_hawaiian *pineapples* 1 pizza_pepperoni *pepperoni* 1 The specified version (only allows * globs) looks like: $ curl "localhost:9200/_cat/templates/pizza*" name template order version pizza_hawaiian *pineapples* 1 pizza_pepperoni *pepperoni* 1 Partially specified columns: $ curl "localhost:9200/_cat/templates/pizza*?v=true&h=name,template" name template pizza_hawaiian *pineapples* pizza_pepperoni *pepperoni* The help text: $ curl "localhost:9200/_cat/templates/pizza*?help" name | n | template name template | t | template pattern string order | o | template application order number version | v | version Closes #20467
21 lines
639 B
Plaintext
21 lines
639 B
Plaintext
[[cat-templates]]
|
|
== cat templates
|
|
|
|
The `templates` command provides information about existing templates.
|
|
|
|
[source, sh]
|
|
--------------------------------------------------
|
|
% curl 'localhost:9200/_cat/templates?v=true'
|
|
name template order version
|
|
template0 te* 0
|
|
template1 tea* 1
|
|
template2 teak* 2 7
|
|
--------------------------------------------------
|
|
|
|
The output shows that there are three existing templates,
|
|
with template_2 having a version value.
|
|
|
|
The endpoint also supports giving a template name or pattern in the url
|
|
to filter the results, for example `/_cat/templates/template*` or
|
|
`/_cat/templates/template0`.
|