Skip to content

Commit 8daa6b5

Browse files
authored
[DOCS] Reformat get pipeline API (#47131) (#47165)
1 parent 0bae950 commit 8daa6b5

File tree

3 files changed

+79
-21
lines changed

3 files changed

+79
-21
lines changed

docs/reference/ingest/apis/get-pipeline.asciidoc

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
[[get-pipeline-api]]
2-
=== Get Pipeline API
2+
=== Get pipeline API
3+
++++
4+
<titleabbrev>Get pipeline</titleabbrev>
5+
++++
36

4-
The get pipeline API returns pipelines based on ID. This API always returns a local reference of the pipeline.
5-
6-
//////////////////////////
7+
Returns information about one or more ingest pipelines.
8+
This API returns a local reference of the pipeline.
79

810
[source,js]
911
--------------------------------------------------
1012
PUT _ingest/pipeline/my-pipeline-id
1113
{
1214
"description" : "describe pipeline",
15+
"version" : 123,
1316
"processors" : [
1417
{
1518
"set" : {
@@ -22,7 +25,12 @@ PUT _ingest/pipeline/my-pipeline-id
2225
--------------------------------------------------
2326
// CONSOLE
2427

25-
//////////////////////////
28+
[[get-pipeline-api-api-example]]
29+
==== {api-examples-title}
30+
31+
32+
[[get-pipeline-api-specific-ex]]
33+
===== Get information for a specific ingest pipeline
2634

2735
[source,js]
2836
--------------------------------------------------
@@ -31,13 +39,14 @@ GET _ingest/pipeline/my-pipeline-id
3139
// CONSOLE
3240
// TEST[continued]
3341

34-
Example response:
42+
The API returns the following response:
3543

3644
[source,js]
3745
--------------------------------------------------
3846
{
3947
"my-pipeline-id" : {
4048
"description" : "describe pipeline",
49+
"version" : 123,
4150
"processors" : [
4251
{
4352
"set" : {
@@ -51,19 +60,14 @@ Example response:
5160
--------------------------------------------------
5261
// TESTRESPONSE
5362

54-
For each returned pipeline, the source and the version are returned.
55-
The version is useful for knowing which version of the pipeline the node has.
56-
You can specify multiple IDs to return more than one pipeline. Wildcards are also supported.
5763

58-
[float]
59-
[[versioning-pipelines]]
60-
==== Pipeline Versioning
64+
[[get-pipeline-api-version-ex]]
65+
===== Get the version of an ingest pipeline
6166

62-
Pipelines can optionally add a `version` number, which can be any integer value,
63-
in order to simplify pipeline management by external systems. The `version`
64-
field is completely optional and it is meant solely for external management of
65-
pipelines. To unset a `version`, simply replace the pipeline without specifying
66-
one.
67+
When you create or update an ingest pipeline,
68+
you can specify an optional `version` parameter.
69+
The version is useful for managing changes to pipeline
70+
and viewing the current pipeline for an ingest node.
6771

6872
[source,js]
6973
--------------------------------------------------
@@ -83,9 +87,10 @@ PUT _ingest/pipeline/my-pipeline-id
8387
--------------------------------------------------
8488
// CONSOLE
8589

86-
To check for the `version`, you can
87-
<<common-options-response-filtering, filter responses>>
88-
using `filter_path` to limit the response to just the `version`:
90+
To check the pipeline version,
91+
use the `filter_path` query parameter
92+
to <<common-options-response-filtering, filter the response>>
93+
to only the version.
8994

9095
[source,js]
9196
--------------------------------------------------
@@ -94,7 +99,7 @@ GET /_ingest/pipeline/my-pipeline-id?filter_path=*.version
9499
// CONSOLE
95100
// TEST[continued]
96101

97-
This should give a small response that makes it both easy and inexpensive to parse:
102+
The API returns the following response:
98103

99104
[source,js]
100105
--------------------------------------------------

docs/reference/ingest/apis/put-pipeline.asciidoc

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,53 @@ PUT _ingest/pipeline/my-pipeline-id
2020
--------------------------------------------------
2121
// CONSOLE
2222

23+
[float]
24+
[[versioning-pipelines]]
25+
==== Pipeline versioning
26+
27+
Pipelines can optionally add a `version` number, which can be any integer value,
28+
in order to simplify pipeline management by external systems. The `version`
29+
field is completely optional and it is meant solely for external management of
30+
pipelines.
31+
32+
[source,js]
33+
--------------------------------------------------
34+
PUT /_ingest/pipeline/my-pipeline-id
35+
{
36+
"description" : "describe pipeline",
37+
"version" : 123,
38+
"processors" : [
39+
{
40+
"set" : {
41+
"field": "foo",
42+
"value": "bar"
43+
}
44+
}
45+
]
46+
}
47+
--------------------------------------------------
48+
// CONSOLE
49+
50+
To unset a `version`, simply replace the pipeline without specifying
51+
one.
52+
53+
[source,js]
54+
--------------------------------------------------
55+
PUT /_ingest/pipeline/my-pipeline-id
56+
{
57+
"description" : "describe pipeline",
58+
"processors" : [
59+
{
60+
"set" : {
61+
"field": "foo",
62+
"value": "bar"
63+
}
64+
}
65+
]
66+
}
67+
--------------------------------------------------
68+
// CONSOLE
69+
2370
//////////////////////////
2471
2572
[source,js]

docs/reference/rest-api/common-parms.asciidoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,12 @@ tag::pipeline[]
394394
(Optional, string) ID of the pipeline to use to preprocess incoming documents.
395395
end::pipeline[]
396396

397+
tag::path-pipeline[]
398+
`<pipeline>`::
399+
(Optional, string) Comma-separated list or wildcard expression of pipeline IDs
400+
used to limit the request.
401+
end::path-pipeline[]
402+
397403
tag::preference[]
398404
`preference`::
399405
(Optional, string) Specifies the node or shard the operation should be

0 commit comments

Comments
 (0)