flush-job.asciidoc 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. --
  2. :api: flush-job
  3. :request: FlushJobRequest
  4. :response: FlushJobResponse
  5. --
  6. [role="xpack"]
  7. [id="{upid}-{api}"]
  8. === Flush Job API
  9. The Flush Job API provides the ability to flush a {ml} job's
  10. datafeed in the cluster.
  11. It accepts a +{request}+ object and responds
  12. with a +{response}+ object.
  13. [id="{upid}-{api}-request"]
  14. ==== Flush Job Request
  15. A +{request}+ object gets created with an existing non-null `jobId`.
  16. All other fields are optional for the request.
  17. ["source","java",subs="attributes,callouts,macros"]
  18. --------------------------------------------------
  19. include-tagged::{doc-tests-file}[{api}-request]
  20. --------------------------------------------------
  21. <1> Constructing a new request referencing an existing `jobId`
  22. ==== Optional Arguments
  23. The following arguments are optional.
  24. ["source","java",subs="attributes,callouts,macros"]
  25. --------------------------------------------------
  26. include-tagged::{doc-tests-file}[{api}-request-options]
  27. --------------------------------------------------
  28. <1> Set request to calculate the interim results
  29. <2> Set the advanced time to flush to the particular time value
  30. <3> Set the start time for the range of buckets on which
  31. to calculate the interim results (requires `calc_interim` to be `true`)
  32. <4> Set the end time for the range of buckets on which
  33. to calculate interim results (requires `calc_interim` to be `true`)
  34. <5> Set the skip time to skip a particular time value
  35. [id="{upid}-{api}-response"]
  36. ==== Flush Job Response
  37. A +{response}+ contains an acknowledgement and an optional end date for the
  38. last finalized bucket
  39. ["source","java",subs="attributes,callouts,macros"]
  40. --------------------------------------------------
  41. include-tagged::{doc-tests-file}[{api}-response]
  42. --------------------------------------------------
  43. <1> `isFlushed()` indicates if the job was successfully flushed or not.
  44. <2> `getLastFinalizedBucketEnd()` provides the timestamp
  45. (in milliseconds-since-the-epoch) of the end of the last bucket that was processed.
  46. include::../execution.asciidoc[]