Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor ingest node API docs (#36962)
This commit is a simple refactoring of the ingest node API docs, breaking each API into a single file for ease of maintaining.
- Loading branch information
1 parent
e2e8203
commit 9137d92
Showing
5 changed files
with
510 additions
and
411 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
[[delete-pipeline-api]] | ||
=== Delete Pipeline API | ||
|
||
The delete pipeline API deletes pipelines by ID or wildcard match (`my-*`, `*`). | ||
|
||
////////////////////////// | ||
[source,js] | ||
-------------------------------------------------- | ||
PUT _ingest/pipeline/my-pipeline-id | ||
{ | ||
"description" : "describe pipeline", | ||
"version" : 123, | ||
"processors" : [ | ||
{ | ||
"set" : { | ||
"field": "foo", | ||
"value": "bar" | ||
} | ||
} | ||
] | ||
} | ||
-------------------------------------------------- | ||
// CONSOLE | ||
////////////////////////// | ||
|
||
[source,js] | ||
-------------------------------------------------- | ||
DELETE _ingest/pipeline/my-pipeline-id | ||
-------------------------------------------------- | ||
// CONSOLE | ||
// TEST[continued] | ||
|
||
////////////////////////// | ||
[source,js] | ||
-------------------------------------------------- | ||
{ | ||
"acknowledged": true | ||
} | ||
-------------------------------------------------- | ||
// TESTRESPONSE | ||
[source,js] | ||
-------------------------------------------------- | ||
PUT _ingest/pipeline/wild-one | ||
{ | ||
"description" : "first pipeline to be wildcard deleted", | ||
"processors" : [ ] | ||
} | ||
PUT _ingest/pipeline/wild-two | ||
{ | ||
"description" : "second pipeline to be wildcard deleted", | ||
"processors" : [ ] | ||
} | ||
-------------------------------------------------- | ||
// CONSOLE | ||
////////////////////////// | ||
|
||
[source,js] | ||
-------------------------------------------------- | ||
DELETE _ingest/pipeline/* | ||
-------------------------------------------------- | ||
// CONSOLE | ||
|
||
////////////////////////// | ||
[source,js] | ||
-------------------------------------------------- | ||
{ | ||
"acknowledged": true | ||
} | ||
-------------------------------------------------- | ||
// TESTRESPONSE | ||
////////////////////////// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
[[get-pipeline-api]] | ||
=== Get Pipeline API | ||
|
||
The get pipeline API returns pipelines based on ID. This API always returns a local reference of the pipeline. | ||
|
||
////////////////////////// | ||
[source,js] | ||
-------------------------------------------------- | ||
PUT _ingest/pipeline/my-pipeline-id | ||
{ | ||
"description" : "describe pipeline", | ||
"processors" : [ | ||
{ | ||
"set" : { | ||
"field": "foo", | ||
"value": "bar" | ||
} | ||
} | ||
] | ||
} | ||
-------------------------------------------------- | ||
// CONSOLE | ||
////////////////////////// | ||
|
||
[source,js] | ||
-------------------------------------------------- | ||
GET _ingest/pipeline/my-pipeline-id | ||
-------------------------------------------------- | ||
// CONSOLE | ||
// TEST[continued] | ||
|
||
Example response: | ||
|
||
[source,js] | ||
-------------------------------------------------- | ||
{ | ||
"my-pipeline-id" : { | ||
"description" : "describe pipeline", | ||
"processors" : [ | ||
{ | ||
"set" : { | ||
"field" : "foo", | ||
"value" : "bar" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
-------------------------------------------------- | ||
// TESTRESPONSE | ||
|
||
For each returned pipeline, the source and the version are returned. | ||
The version is useful for knowing which version of the pipeline the node has. | ||
You can specify multiple IDs to return more than one pipeline. Wildcards are also supported. | ||
|
||
[float] | ||
[[versioning-pipelines]] | ||
==== Pipeline Versioning | ||
|
||
Pipelines can optionally add a `version` number, which can be any integer value, | ||
in order to simplify pipeline management by external systems. The `version` | ||
field is completely optional and it is meant solely for external management of | ||
pipelines. To unset a `version`, simply replace the pipeline without specifying | ||
one. | ||
|
||
[source,js] | ||
-------------------------------------------------- | ||
PUT _ingest/pipeline/my-pipeline-id | ||
{ | ||
"description" : "describe pipeline", | ||
"version" : 123, | ||
"processors" : [ | ||
{ | ||
"set" : { | ||
"field": "foo", | ||
"value": "bar" | ||
} | ||
} | ||
] | ||
} | ||
-------------------------------------------------- | ||
// CONSOLE | ||
|
||
To check for the `version`, you can | ||
<<common-options-response-filtering, filter responses>> | ||
using `filter_path` to limit the response to just the `version`: | ||
|
||
[source,js] | ||
-------------------------------------------------- | ||
GET /_ingest/pipeline/my-pipeline-id?filter_path=*.version | ||
-------------------------------------------------- | ||
// CONSOLE | ||
// TEST[continued] | ||
|
||
This should give a small response that makes it both easy and inexpensive to parse: | ||
|
||
[source,js] | ||
-------------------------------------------------- | ||
{ | ||
"my-pipeline-id" : { | ||
"version" : 123 | ||
} | ||
} | ||
-------------------------------------------------- | ||
// TESTRESPONSE | ||
|
||
////////////////////////// | ||
[source,js] | ||
-------------------------------------------------- | ||
DELETE /_ingest/pipeline/my-pipeline-id | ||
-------------------------------------------------- | ||
// CONSOLE | ||
// TEST[continued] | ||
[source,js] | ||
-------------------------------------------------- | ||
{ | ||
"acknowledged": true | ||
} | ||
-------------------------------------------------- | ||
// TESTRESPONSE | ||
////////////////////////// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
[[put-pipeline-api]] | ||
=== Put Pipeline API | ||
|
||
The put pipeline API adds pipelines and updates existing pipelines in the cluster. | ||
|
||
[source,js] | ||
-------------------------------------------------- | ||
PUT _ingest/pipeline/my-pipeline-id | ||
{ | ||
"description" : "describe pipeline", | ||
"processors" : [ | ||
{ | ||
"set" : { | ||
"field": "foo", | ||
"value": "bar" | ||
} | ||
} | ||
] | ||
} | ||
-------------------------------------------------- | ||
// CONSOLE | ||
|
||
////////////////////////// | ||
[source,js] | ||
-------------------------------------------------- | ||
DELETE /_ingest/pipeline/my-pipeline-id | ||
-------------------------------------------------- | ||
// CONSOLE | ||
// TEST[continued] | ||
[source,js] | ||
-------------------------------------------------- | ||
{ | ||
"acknowledged": true | ||
} | ||
-------------------------------------------------- | ||
// TESTRESPONSE | ||
////////////////////////// | ||
|
||
NOTE: The put pipeline API also instructs all ingest nodes to reload their in-memory representation of pipelines, so that | ||
pipeline changes take effect immediately. |
Oops, something went wrong.