get_pipeline.asciidoc 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. [[java-rest-high-ingest-get-pipeline]]
  2. === Get Pipeline API
  3. [[java-rest-high-ingest-get-pipeline-request]]
  4. ==== Get Pipeline Request
  5. A `GetPipelineRequest` requires one or more `pipelineIds` to fetch.
  6. ["source","java",subs="attributes,callouts,macros"]
  7. --------------------------------------------------
  8. include-tagged::{doc-tests}/IngestClientDocumentationIT.java[get-pipeline-request]
  9. --------------------------------------------------
  10. <1> The pipeline id to fetch
  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[get-pipeline-request-masterTimeout]
  16. --------------------------------------------------
  17. <1> Timeout to connect to the master node as a `TimeValue`
  18. <2> Timeout to connect to the master node as a `String`
  19. [[java-rest-high-ingest-get-pipeline-sync]]
  20. ==== Synchronous Execution
  21. ["source","java",subs="attributes,callouts,macros"]
  22. --------------------------------------------------
  23. include-tagged::{doc-tests}/IngestClientDocumentationIT.java[get-pipeline-execute]
  24. --------------------------------------------------
  25. <1> Execute the request and get back the response in a GetPipelineResponse object.
  26. [[java-rest-high-ingest-get-pipeline-async]]
  27. ==== Asynchronous Execution
  28. The asynchronous execution of a get pipeline request requires both the `GetPipelineRequest`
  29. instance and an `ActionListener` instance to be passed to the asynchronous
  30. method:
  31. ["source","java",subs="attributes,callouts,macros"]
  32. --------------------------------------------------
  33. include-tagged::{doc-tests}/IngestClientDocumentationIT.java[get-pipeline-execute-async]
  34. --------------------------------------------------
  35. <1> The `GetPipelineRequest` to execute and the `ActionListener` to use when
  36. the execution completes
  37. The asynchronous method does not block and returns immediately. Once it is
  38. completed the `ActionListener` is called back using the `onResponse` method
  39. if the execution successfully completed or using the `onFailure` method if
  40. it failed.
  41. A typical listener for `GetPipelineResponse` looks like:
  42. ["source","java",subs="attributes,callouts,macros"]
  43. --------------------------------------------------
  44. include-tagged::{doc-tests}/IngestClientDocumentationIT.java[get-pipeline-execute-listener]
  45. --------------------------------------------------
  46. <1> Called when the execution is successfully completed. The response is
  47. provided as an argument
  48. <2> Called in case of failure. The raised exception is provided as an argument
  49. [[java-rest-high-ingest-get-pipeline-response]]
  50. ==== Get Pipeline Response
  51. The returned `GetPipelineResponse` allows to retrieve information about the executed
  52. operation as follows:
  53. ["source","java",subs="attributes,callouts,macros"]
  54. --------------------------------------------------
  55. include-tagged::{doc-tests}/IngestClientDocumentationIT.java[get-pipeline-response]
  56. --------------------------------------------------
  57. <1> Check if a matching pipeline id was found or not.
  58. <2> Get the list of pipelines found as a list of `PipelineConfig` objects.
  59. <3> Get the individual configuration of each pipeline as a `Map<String, Object>`.