Skip to content

Commit 9cf7214

Browse files
authored
[DOCS] Add "version" to template and pipeline docs (#20407)
* [DOCS] Add "version" to template and pipeline docs This adds details about the "version" to both the template and pipeline pages.
1 parent 2f01f65 commit 9cf7214

File tree

3 files changed

+98
-1
lines changed

3 files changed

+98
-1
lines changed

docs/reference/api-conventions.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ Some examples are:
219219
`2015-01-01||+1M/d`:: `2015-01-01` plus one month, rounded down to the nearest day.
220220

221221
[float]
222+
[[common-options-response-filtering]]
222223
=== Response Filtering
223224

224225
All REST APIs accept a `filter_path` parameter that can be used to reduce

docs/reference/indices/templates.asciidoc

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,3 +181,49 @@ for indices of that start with `te*`, source will still be enabled.
181181
Note, for mappings, the merging is "deep", meaning that specific
182182
object/property based mappings can easily be added/overridden on higher
183183
order templates, with lower order templates providing the basis.
184+
185+
[float]
186+
[[versioning-templates]]
187+
=== Template Versioning
188+
189+
Templates can optionally add a `version` number, which can be any integer value,
190+
in order to simplify template management by external systems. The `version`
191+
field is completely optional and it is meant solely for external management of
192+
templates. To unset a `version`, simply replace the template without specifying
193+
one.
194+
195+
[source,js]
196+
--------------------------------------------------
197+
PUT /_template/template_1
198+
{
199+
"template" : "*",
200+
"order" : 0,
201+
"settings" : {
202+
"number_of_shards" : 1
203+
},
204+
"version": 123
205+
}
206+
--------------------------------------------------
207+
// CONSOLE
208+
209+
To check for the `version`, you can
210+
<<common-options-response-filtering, filter responses>>
211+
using `filter_path` to limit the response to just the `version`:
212+
213+
[source,js]
214+
--------------------------------------------------
215+
GET /_template/template_1?filter_path=*.version
216+
--------------------------------------------------
217+
// TEST[continued]
218+
219+
This should give a small response that makes it both easy and inexpensive to parse:
220+
221+
[source,js]
222+
--------------------------------------------------
223+
{
224+
"template_1" : {
225+
"version" : 123
226+
}
227+
}
228+
--------------------------------------------------
229+
// TESTRESPONSE

docs/reference/ingest/ingest-node.asciidoc

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,56 @@ For each returned pipeline, the source and the version are returned.
9090
The version is useful for knowing which version of the pipeline the node has.
9191
You can specify multiple IDs to return more than one pipeline. Wildcards are also supported.
9292

93+
[float]
94+
[[versioning-pipelines]]
95+
==== Pipeline Versioning
96+
97+
Pipelines can optionally add a `version` number, which can be any integer value,
98+
in order to simplify pipeline management by external systems. The `version`
99+
field is completely optional and it is meant solely for external management of
100+
pipelines. To unset a `version`, simply replace the pipeline without specifying
101+
one.
102+
103+
[source,js]
104+
--------------------------------------------------
105+
PUT _ingest/pipeline/my-pipeline-id
106+
{
107+
"description" : "describe pipeline",
108+
"version" : 123,
109+
"processors" : [
110+
{
111+
"set" : {
112+
"field": "foo",
113+
"value": "bar"
114+
}
115+
}
116+
]
117+
}
118+
--------------------------------------------------
119+
// CONSOLE
120+
121+
To check for the `version`, you can
122+
<<common-options-response-filtering, filter responses>>
123+
using `filter_path` to limit the response to just the `version`:
124+
125+
[source,js]
126+
--------------------------------------------------
127+
GET /_ingest/pipeline/my-pipeline-id?filter_path=*.version
128+
--------------------------------------------------
129+
// TEST[continued]
130+
131+
This should give a small response that makes it both easy and inexpensive to parse:
132+
133+
[source,js]
134+
--------------------------------------------------
135+
{
136+
"my-pipeline-id" : {
137+
"version" : 123
138+
}
139+
}
140+
--------------------------------------------------
141+
// TESTRESPONSE
142+
93143
[[delete-pipeline-api]]
94144
=== Delete Pipeline API
95145

@@ -1639,4 +1689,4 @@ pipeline should be used:
16391689
--------------------------------------------------
16401690

16411691
The reason for this is that Ingest doesn't know how to automatically cast
1642-
a scalar field to an object field.
1692+
a scalar field to an object field.

0 commit comments

Comments
 (0)