put-pipeline.asciidoc 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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-prereqs]]
  27. ==== {api-prereq-title}
  28. * If the {es} {security-features} are enabled, you must have the
  29. `manage_pipeline`, `manage_ingest_pipelines`, or `manage`
  30. <<privileges-list-cluster,cluster privilege>> to use this API.
  31. [[put-pipeline-api-path-params]]
  32. ==== {api-path-parms-title}
  33. `<pipeline>`::
  34. (Required, string) ID of the ingest pipeline to create or update.
  35. [[put-pipeline-api-query-params]]
  36. ==== {api-query-parms-title}
  37. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=master-timeout]
  38. [[put-pipeline-api-response-body]]
  39. ==== {api-response-body-title}
  40. `description`::
  41. (Required, string)
  42. Description of the ingest pipeline.
  43. `processors`::
  44. +
  45. --
  46. (Required, array of <<ingest-processors,processor objects>>)
  47. Array of processors used to pre-process documents
  48. before indexing.
  49. Processors are executed in the order provided.
  50. See <<ingest-processors>> for processor object definitions
  51. and a list of built-in processors.
  52. --
  53. `version`::
  54. +
  55. --
  56. (Optional, integer)
  57. Optional version number used by external systems to manage ingest pipelines.
  58. Versions are not used or validated by {es};
  59. they are intended for external management only.
  60. --
  61. [[put-pipeline-api-example]]
  62. ==== {api-examples-title}
  63. [[versioning-pipelines]]
  64. ===== Pipeline versioning
  65. When creating or updating an ingest pipeline,
  66. you can specify an optional `version` parameter.
  67. The version is useful for managing changes to pipeline
  68. and viewing the current pipeline for an ingest node.
  69. The following request sets a version number of `123`
  70. for `my-pipeline-id`.
  71. [source,console]
  72. --------------------------------------------------
  73. PUT /_ingest/pipeline/my-pipeline-id
  74. {
  75. "description" : "describe pipeline",
  76. "version" : 123,
  77. "processors" : [
  78. {
  79. "set" : {
  80. "field": "foo",
  81. "value": "bar"
  82. }
  83. }
  84. ]
  85. }
  86. --------------------------------------------------
  87. To unset the version number,
  88. replace the pipeline without specifying a `version` parameter.
  89. [source,console]
  90. --------------------------------------------------
  91. PUT /_ingest/pipeline/my-pipeline-id
  92. {
  93. "description" : "describe pipeline",
  94. "processors" : [
  95. {
  96. "set" : {
  97. "field": "foo",
  98. "value": "bar"
  99. }
  100. }
  101. ]
  102. }
  103. --------------------------------------------------
  104. ////
  105. [source,console]
  106. --------------------------------------------------
  107. DELETE /_ingest/pipeline/my-pipeline-id
  108. --------------------------------------------------
  109. // TEST[continued]
  110. [source,console-result]
  111. --------------------------------------------------
  112. {
  113. "acknowledged": true
  114. }
  115. --------------------------------------------------
  116. ////