mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-07 13:38:49 +00:00
This switches the docs tests from the `oss-zip` distribution to the `zip` distribution so they have xpack installed and configured with the default basic license. The goal is to be able to merge the `x-pack/docs` directory into the `docs` directory, marking the x-pack docs with some kind of marker. This is the first step in that process. This also enables `-Dtests.distribution` support for the `docs` directory so you can run the tests against the `oss-zip` distribution with something like ``` ./gradlew -p docs check -Dtests.distribution=oss-zip ``` We can set up Jenkins to run both. Relates to #30665
39 lines
1.4 KiB
Plaintext
39 lines
1.4 KiB
Plaintext
[[cat-templates]]
|
|
== cat templates
|
|
|
|
The `templates` command provides information about existing templates.
|
|
|
|
[source,js]
|
|
--------------------------------------------------
|
|
GET /_cat/templates?v&s=name
|
|
--------------------------------------------------
|
|
// CONSOLE
|
|
// TEST[s/templates/templates\/template*/]
|
|
// TEST[s/^/PUT _template\/template0\n{"index_patterns": "te*", "order": 0}\n/]
|
|
// TEST[s/^/PUT _template\/template1\n{"index_patterns": "tea*", "order": 1}\n/]
|
|
// TEST[s/^/PUT _template\/template2\n{"index_patterns": "teak*", "order": 2, "version": 7}\n/]
|
|
// The substitions do two things:
|
|
// 1. Filter the response to just templates matching the te* pattern
|
|
// so that we only get the templates we expect regardless of which
|
|
// templates exist. If xpack is installed there will be unexpected
|
|
// templates.
|
|
// 2. Create some templates to expect in the response.
|
|
|
|
which looks like
|
|
|
|
[source,txt]
|
|
--------------------------------------------------
|
|
name index_patterns order version
|
|
template0 [te*] 0
|
|
template1 [tea*] 1
|
|
template2 [teak*] 2 7
|
|
--------------------------------------------------
|
|
// TESTRESPONSE[s/\*/\\*/ s/\[/\\[/ s/\]/\\]/ _cat]
|
|
|
|
The output shows that there are three existing templates,
|
|
with template2 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`.
|