forecast-job.asciidoc 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. <3> Set the maximum amount of memory the forecast is allowed to use.
  31. Defaults to 20mb. Maximum is 500mb, minimum is 1mb. If set to
  32. 40% or more of the job's configured memory limit, it is
  33. automatically reduced to below that number.
  34. [id="{upid}-{api}-response"]
  35. ==== Forecast job response
  36. A +{response}+ contains an acknowledgement and the forecast ID
  37. ["source","java",subs="attributes,callouts,macros"]
  38. --------------------------------------------------
  39. include-tagged::{doc-tests-file}[{api}-response]
  40. --------------------------------------------------
  41. <1> `isAcknowledged()` indicates if the forecast was successful
  42. <2> `getForecastId()` provides the ID of the forecast that was created
  43. include::../execution.asciidoc[]