get-pipeline.asciidoc 3.0 KB

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