2018-12-23 08:59:18 -05:00
|
|
|
[[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.
|
|
|
|
|
|
|
|
//////////////////////////
|
|
|
|
|
2019-09-06 11:31:13 -04:00
|
|
|
[source,console]
|
2018-12-23 08:59:18 -05:00
|
|
|
--------------------------------------------------
|
|
|
|
PUT _ingest/pipeline/my-pipeline-id
|
|
|
|
{
|
|
|
|
"description" : "describe pipeline",
|
|
|
|
"processors" : [
|
|
|
|
{
|
|
|
|
"set" : {
|
|
|
|
"field": "foo",
|
|
|
|
"value": "bar"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
|
|
|
|
//////////////////////////
|
|
|
|
|
2019-09-06 11:31:13 -04:00
|
|
|
[source,console]
|
2018-12-23 08:59:18 -05:00
|
|
|
--------------------------------------------------
|
|
|
|
GET _ingest/pipeline/my-pipeline-id
|
|
|
|
--------------------------------------------------
|
|
|
|
// TEST[continued]
|
|
|
|
|
|
|
|
Example response:
|
|
|
|
|
2019-09-06 09:22:08 -04:00
|
|
|
[source,console-result]
|
2018-12-23 08:59:18 -05:00
|
|
|
--------------------------------------------------
|
|
|
|
{
|
|
|
|
"my-pipeline-id" : {
|
|
|
|
"description" : "describe pipeline",
|
|
|
|
"processors" : [
|
|
|
|
{
|
|
|
|
"set" : {
|
|
|
|
"field" : "foo",
|
|
|
|
"value" : "bar"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
2019-09-06 11:31:13 -04:00
|
|
|
[source,console]
|
2018-12-23 08:59:18 -05:00
|
|
|
--------------------------------------------------
|
|
|
|
PUT _ingest/pipeline/my-pipeline-id
|
|
|
|
{
|
|
|
|
"description" : "describe pipeline",
|
|
|
|
"version" : 123,
|
|
|
|
"processors" : [
|
|
|
|
{
|
|
|
|
"set" : {
|
|
|
|
"field": "foo",
|
|
|
|
"value": "bar"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
|
|
|
|
To check for the `version`, you can
|
|
|
|
<<common-options-response-filtering, filter responses>>
|
|
|
|
using `filter_path` to limit the response to just the `version`:
|
|
|
|
|
2019-09-06 11:31:13 -04:00
|
|
|
[source,console]
|
2018-12-23 08:59:18 -05:00
|
|
|
--------------------------------------------------
|
|
|
|
GET /_ingest/pipeline/my-pipeline-id?filter_path=*.version
|
|
|
|
--------------------------------------------------
|
|
|
|
// TEST[continued]
|
|
|
|
|
|
|
|
This should give a small response that makes it both easy and inexpensive to parse:
|
|
|
|
|
2019-09-06 09:22:08 -04:00
|
|
|
[source,console-result]
|
2018-12-23 08:59:18 -05:00
|
|
|
--------------------------------------------------
|
|
|
|
{
|
|
|
|
"my-pipeline-id" : {
|
|
|
|
"version" : 123
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
|
|
|
|
//////////////////////////
|
|
|
|
|
2019-09-06 11:31:13 -04:00
|
|
|
[source,console]
|
2018-12-23 08:59:18 -05:00
|
|
|
--------------------------------------------------
|
|
|
|
DELETE /_ingest/pipeline/my-pipeline-id
|
|
|
|
--------------------------------------------------
|
|
|
|
// TEST[continued]
|
|
|
|
|
2019-09-06 09:22:08 -04:00
|
|
|
[source,console-result]
|
2018-12-23 08:59:18 -05:00
|
|
|
--------------------------------------------------
|
|
|
|
{
|
|
|
|
"acknowledged": true
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
|
|
|
|
//////////////////////////
|