get-pipeline.asciidoc 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. [[get-pipeline-api]]
  2. === Get Pipeline API
  3. The get pipeline API returns pipelines based on ID. This API always returns a local reference of the pipeline.
  4. //////////////////////////
  5. [source,console]
  6. --------------------------------------------------
  7. PUT _ingest/pipeline/my-pipeline-id
  8. {
  9. "description" : "describe pipeline",
  10. "processors" : [
  11. {
  12. "set" : {
  13. "field": "foo",
  14. "value": "bar"
  15. }
  16. }
  17. ]
  18. }
  19. --------------------------------------------------
  20. //////////////////////////
  21. [source,console]
  22. --------------------------------------------------
  23. GET _ingest/pipeline/my-pipeline-id
  24. --------------------------------------------------
  25. // TEST[continued]
  26. Example response:
  27. [source,console-result]
  28. --------------------------------------------------
  29. {
  30. "my-pipeline-id" : {
  31. "description" : "describe pipeline",
  32. "processors" : [
  33. {
  34. "set" : {
  35. "field" : "foo",
  36. "value" : "bar"
  37. }
  38. }
  39. ]
  40. }
  41. }
  42. --------------------------------------------------
  43. For each returned pipeline, the source and the version are returned.
  44. The version is useful for knowing which version of the pipeline the node has.
  45. You can specify multiple IDs to return more than one pipeline. Wildcards are also supported.
  46. [float]
  47. [[versioning-pipelines]]
  48. ==== Pipeline Versioning
  49. Pipelines can optionally add a `version` number, which can be any integer value,
  50. in order to simplify pipeline management by external systems. The `version`
  51. field is completely optional and it is meant solely for external management of
  52. pipelines. To unset a `version`, simply replace the pipeline without specifying
  53. one.
  54. [source,console]
  55. --------------------------------------------------
  56. PUT _ingest/pipeline/my-pipeline-id
  57. {
  58. "description" : "describe pipeline",
  59. "version" : 123,
  60. "processors" : [
  61. {
  62. "set" : {
  63. "field": "foo",
  64. "value": "bar"
  65. }
  66. }
  67. ]
  68. }
  69. --------------------------------------------------
  70. To check for the `version`, you can
  71. <<common-options-response-filtering, filter responses>>
  72. using `filter_path` to limit the response to just the `version`:
  73. [source,console]
  74. --------------------------------------------------
  75. GET /_ingest/pipeline/my-pipeline-id?filter_path=*.version
  76. --------------------------------------------------
  77. // TEST[continued]
  78. This should give a small response that makes it both easy and inexpensive to parse:
  79. [source,console-result]
  80. --------------------------------------------------
  81. {
  82. "my-pipeline-id" : {
  83. "version" : 123
  84. }
  85. }
  86. --------------------------------------------------
  87. //////////////////////////
  88. [source,console]
  89. --------------------------------------------------
  90. DELETE /_ingest/pipeline/my-pipeline-id
  91. --------------------------------------------------
  92. // TEST[continued]
  93. [source,console-result]
  94. --------------------------------------------------
  95. {
  96. "acknowledged": true
  97. }
  98. --------------------------------------------------
  99. //////////////////////////