delete_pipeline.asciidoc 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. [[java-rest-high-ingest-delete-pipeline]]
  2. === Delete Pipeline API
  3. [[java-rest-high-ingest-delete-pipeline-request]]
  4. ==== Delete Pipeline Request
  5. A `DeletePipelineRequest` requires a pipeline `id` to delete.
  6. ["source","java",subs="attributes,callouts,macros"]
  7. --------------------------------------------------
  8. include-tagged::{doc-tests}/IngestClientDocumentationIT.java[delete-pipeline-request]
  9. --------------------------------------------------
  10. <1> The pipeline id to delete
  11. ==== Optional arguments
  12. The following arguments can optionally be provided:
  13. ["source","java",subs="attributes,callouts,macros"]
  14. --------------------------------------------------
  15. include-tagged::{doc-tests}/IngestClientDocumentationIT.java[delete-pipeline-request-timeout]
  16. --------------------------------------------------
  17. <1> Timeout to wait for the all the nodes to acknowledge the pipeline deletion as a `TimeValue`
  18. <2> Timeout to wait for the all the nodes to acknowledge the pipeline deletion as a `String`
  19. ["source","java",subs="attributes,callouts,macros"]
  20. --------------------------------------------------
  21. include-tagged::{doc-tests}/IngestClientDocumentationIT.java[delete-pipeline-request-masterTimeout]
  22. --------------------------------------------------
  23. <1> Timeout to connect to the master node as a `TimeValue`
  24. <2> Timeout to connect to the master node as a `String`
  25. [[java-rest-high-ingest-delete-pipeline-sync]]
  26. ==== Synchronous Execution
  27. ["source","java",subs="attributes,callouts,macros"]
  28. --------------------------------------------------
  29. include-tagged::{doc-tests}/IngestClientDocumentationIT.java[delete-pipeline-execute]
  30. --------------------------------------------------
  31. <1> Execute the request and get back the response in a `WritePipelineResponse` object.
  32. [[java-rest-high-ingest-delete-pipeline-async]]
  33. ==== Asynchronous Execution
  34. The asynchronous execution of a delete pipeline request requires both the `DeletePipelineRequest`
  35. instance and an `ActionListener` instance to be passed to the asynchronous
  36. method:
  37. ["source","java",subs="attributes,callouts,macros"]
  38. --------------------------------------------------
  39. include-tagged::{doc-tests}/IngestClientDocumentationIT.java[delete-pipeline-execute-async]
  40. --------------------------------------------------
  41. <1> The `DeletePipelineRequest` to execute and the `ActionListener` to use when
  42. the execution completes
  43. The asynchronous method does not block and returns immediately. Once it is
  44. completed the `ActionListener` is called back using the `onResponse` method
  45. if the execution successfully completed or using the `onFailure` method if
  46. it failed.
  47. A typical listener for `WritePipelineResponse` looks like:
  48. ["source","java",subs="attributes,callouts,macros"]
  49. --------------------------------------------------
  50. include-tagged::{doc-tests}/IngestClientDocumentationIT.java[delete-pipeline-execute-listener]
  51. --------------------------------------------------
  52. <1> Called when the execution is successfully completed. The response is
  53. provided as an argument
  54. <2> Called in case of failure. The raised exception is provided as an argument
  55. [[java-rest-high-ingest-delete-pipeline-response]]
  56. ==== Delete Pipeline Response
  57. The returned `WritePipelineResponse` allows to retrieve information about the executed
  58. operation as follows:
  59. ["source","java",subs="attributes,callouts,macros"]
  60. --------------------------------------------------
  61. include-tagged::{doc-tests}/IngestClientDocumentationIT.java[delete-pipeline-response]
  62. --------------------------------------------------
  63. <1> Indicates whether all of the nodes have acknowledged the request