put-pipeline.asciidoc 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. [[put-pipeline-api]]
  2. === Put pipeline API
  3. ++++
  4. <titleabbrev>Put pipeline</titleabbrev>
  5. ++++
  6. Creates or updates an ingest pipeline.
  7. Changes made using this API take effect immediately.
  8. [source,console]
  9. ----
  10. PUT _ingest/pipeline/my-pipeline-id
  11. {
  12. "description" : "describe pipeline",
  13. "processors" : [
  14. {
  15. "set" : {
  16. "field": "foo",
  17. "value": "bar"
  18. }
  19. }
  20. ]
  21. }
  22. ----
  23. [[put-pipeline-api-request]]
  24. ==== {api-request-title}
  25. `PUT /_ingest/pipeline/<pipeline>`
  26. [[put-pipeline-api-path-params]]
  27. ==== {api-path-parms-title}
  28. `<pipeline>`::
  29. (Required, string) ID of the ingest pipeline to create or update.
  30. [[put-pipeline-api-query-params]]
  31. ==== {api-query-parms-title}
  32. include::{docdir}/rest-api/common-parms.asciidoc[tag=master-timeout]
  33. [[put-pipeline-api-response-body]]
  34. ==== {api-response-body-title}
  35. `description`::
  36. (Required, string)
  37. Description of the ingest pipeline.
  38. `processors`::
  39. +
  40. --
  41. (Required, array of <<ingest-processors,processor objects>>)
  42. Array of processors used to pre-process documents
  43. before indexing.
  44. Processors are executed in the order provided.
  45. See <<ingest-processors>> for processor object definitions
  46. and a list of built-in processors.
  47. --
  48. `version`::
  49. +
  50. --
  51. (Optional, integer)
  52. Optional version number used by external systems to manage ingest pipelines.
  53. Versions are not used or validated by {es};
  54. they are intended for external management only.
  55. --
  56. [[put-pipeline-api-example]]
  57. ==== {api-examples-title}
  58. [[versioning-pipelines]]
  59. ===== Pipeline versioning
  60. When creating or updating an ingest pipeline,
  61. you can specify an optional `version` parameter.
  62. The version is useful for managing changes to pipeline
  63. and viewing the current pipeline for an ingest node.
  64. The following request sets a version number of `123`
  65. for `my-pipeline-id`.
  66. [source,console]
  67. --------------------------------------------------
  68. PUT /_ingest/pipeline/my-pipeline-id
  69. {
  70. "description" : "describe pipeline",
  71. "version" : 123,
  72. "processors" : [
  73. {
  74. "set" : {
  75. "field": "foo",
  76. "value": "bar"
  77. }
  78. }
  79. ]
  80. }
  81. --------------------------------------------------
  82. To unset the version number,
  83. replace the pipeline without specifying a `version` parameter.
  84. [source,console]
  85. --------------------------------------------------
  86. PUT /_ingest/pipeline/my-pipeline-id
  87. {
  88. "description" : "describe pipeline",
  89. "processors" : [
  90. {
  91. "set" : {
  92. "field": "foo",
  93. "value": "bar"
  94. }
  95. }
  96. ]
  97. }
  98. --------------------------------------------------
  99. ////
  100. [source,console]
  101. --------------------------------------------------
  102. DELETE /_ingest/pipeline/my-pipeline-id
  103. --------------------------------------------------
  104. // TEST[continued]
  105. [source,console-result]
  106. --------------------------------------------------
  107. {
  108. "acknowledged": true
  109. }
  110. --------------------------------------------------
  111. ////