2018-12-23 08:59:18 -05:00
|
|
|
[[put-pipeline-api]]
|
2019-10-01 14:48:18 -04:00
|
|
|
=== Put pipeline API
|
|
|
|
++++
|
|
|
|
<titleabbrev>Put pipeline</titleabbrev>
|
|
|
|
++++
|
2018-12-23 08:59:18 -05:00
|
|
|
|
2019-10-01 14:48:18 -04:00
|
|
|
Creates or updates an ingest pipeline.
|
|
|
|
Changes made using this API take effect immediately.
|
2018-12-23 08:59:18 -05:00
|
|
|
|
2019-09-06 11:31:13 -04:00
|
|
|
[source,console]
|
2019-10-01 14:48:18 -04:00
|
|
|
----
|
2018-12-23 08:59:18 -05:00
|
|
|
PUT _ingest/pipeline/my-pipeline-id
|
|
|
|
{
|
|
|
|
"description" : "describe pipeline",
|
|
|
|
"processors" : [
|
|
|
|
{
|
|
|
|
"set" : {
|
|
|
|
"field": "foo",
|
|
|
|
"value": "bar"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
2019-10-01 14:48:18 -04:00
|
|
|
----
|
|
|
|
|
|
|
|
|
|
|
|
[[put-pipeline-api-request]]
|
|
|
|
==== {api-request-title}
|
|
|
|
|
|
|
|
`PUT /_ingest/pipeline/<pipeline>`
|
|
|
|
|
|
|
|
|
|
|
|
[[put-pipeline-api-path-params]]
|
|
|
|
==== {api-path-parms-title}
|
|
|
|
|
|
|
|
`<pipeline>`::
|
|
|
|
(Required, string) ID of the ingest pipeline to create or update.
|
|
|
|
|
|
|
|
|
|
|
|
[[put-pipeline-api-query-params]]
|
|
|
|
==== {api-query-parms-title}
|
|
|
|
|
2020-06-01 19:42:53 -04:00
|
|
|
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=master-timeout]
|
2019-10-01 14:48:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
[[put-pipeline-api-response-body]]
|
|
|
|
==== {api-response-body-title}
|
|
|
|
|
|
|
|
`description`::
|
|
|
|
(Required, string)
|
|
|
|
Description of the ingest pipeline.
|
|
|
|
|
|
|
|
`processors`::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
(Required, array of <<ingest-processors,processor objects>>)
|
|
|
|
Array of processors used to pre-process documents
|
|
|
|
before indexing.
|
|
|
|
|
|
|
|
Processors are executed in the order provided.
|
|
|
|
|
|
|
|
See <<ingest-processors>> for processor object definitions
|
|
|
|
and a list of built-in processors.
|
|
|
|
--
|
|
|
|
|
|
|
|
`version`::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
(Optional, integer)
|
|
|
|
Optional version number used by external systems to manage ingest pipelines.
|
|
|
|
|
|
|
|
Versions are not used or validated by {es};
|
|
|
|
they are intended for external management only.
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
|
|
[[put-pipeline-api-example]]
|
|
|
|
==== {api-examples-title}
|
|
|
|
|
2018-12-23 08:59:18 -05:00
|
|
|
|
2019-09-26 08:51:12 -04:00
|
|
|
[[versioning-pipelines]]
|
2019-10-01 14:48:18 -04:00
|
|
|
===== Pipeline versioning
|
|
|
|
|
|
|
|
When creating or updating an ingest pipeline,
|
|
|
|
you can specify an optional `version` parameter.
|
|
|
|
The version is useful for managing changes to pipeline
|
|
|
|
and viewing the current pipeline for an ingest node.
|
2019-09-26 08:51:12 -04:00
|
|
|
|
2019-10-01 14:48:18 -04:00
|
|
|
The following request sets a version number of `123`
|
|
|
|
for `my-pipeline-id`.
|
2019-09-26 08:51:12 -04:00
|
|
|
|
|
|
|
[source,console]
|
|
|
|
--------------------------------------------------
|
|
|
|
PUT /_ingest/pipeline/my-pipeline-id
|
|
|
|
{
|
|
|
|
"description" : "describe pipeline",
|
|
|
|
"version" : 123,
|
|
|
|
"processors" : [
|
|
|
|
{
|
|
|
|
"set" : {
|
|
|
|
"field": "foo",
|
|
|
|
"value": "bar"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
|
2019-10-01 14:48:18 -04:00
|
|
|
To unset the version number,
|
|
|
|
replace the pipeline without specifying a `version` parameter.
|
2019-09-26 08:51:12 -04:00
|
|
|
|
|
|
|
[source,console]
|
|
|
|
--------------------------------------------------
|
|
|
|
PUT /_ingest/pipeline/my-pipeline-id
|
|
|
|
{
|
|
|
|
"description" : "describe pipeline",
|
|
|
|
"processors" : [
|
|
|
|
{
|
|
|
|
"set" : {
|
|
|
|
"field": "foo",
|
|
|
|
"value": "bar"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
|
2019-10-01 14:48:18 -04:00
|
|
|
////
|
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
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
2019-10-01 14:48:18 -04:00
|
|
|
////
|