forecast-job.asciidoc 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. --
  2. :api: forecast-job
  3. :request: ForecastJobRequest
  4. :response: ForecastJobResponse
  5. --
  6. [role="xpack"]
  7. [id="{upid}-{api}"]
  8. === Forecast Job API
  9. The Forecast Job API provides the ability to forecast a {ml} job's behavior based
  10. on historical data.
  11. It accepts a +{request}+ object and responds
  12. with a +{response}+ object.
  13. [id="{upid}-{api}-request"]
  14. ==== Forecast 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 when the forecast for the job should expire
  29. <2> Set how far into the future should the forecast predict
  30. [id="{upid}-{api}-response"]
  31. ==== Forecast Job Response
  32. A +{response}+ contains an acknowledgement and the forecast ID
  33. ["source","java",subs="attributes,callouts,macros"]
  34. --------------------------------------------------
  35. include-tagged::{doc-tests-file}[{api}-response]
  36. --------------------------------------------------
  37. <1> `isAcknowledged()` indicates if the forecast was successful
  38. <2> `getForecastId()` provides the ID of the forecast that was created
  39. include::../execution.asciidoc[]