get-job-stats.asciidoc 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. --
  2. :api: get-job-stats
  3. :request: GetJobStatsRequest
  4. :response: GetJobStatsResponse
  5. --
  6. [role="xpack"]
  7. [id="{upid}-{api}"]
  8. === Get {anomaly-job} stats API
  9. Retrieves statistics for any number of {anomaly-jobs} in the cluster.
  10. It accepts a +{request}+ object and responds with a +{response}+ object.
  11. [id="{upid}-{api}-request"]
  12. ==== Get job stats request
  13. A `GetJobsStatsRequest` object can have any number of `jobId`
  14. entries. However, they all must be non-null. An empty list is the same as
  15. requesting statistics for all {anomaly-jobs}.
  16. ["source","java",subs="attributes,callouts,macros"]
  17. --------------------------------------------------
  18. include-tagged::{doc-tests-file}[{api}-request]
  19. --------------------------------------------------
  20. <1> Constructing a new request referencing existing `jobIds`. It can contain
  21. wildcards.
  22. <2> Whether to ignore if a wildcard expression matches no {anomaly-jobs}.
  23. (This includes `_all` string or when no jobs have been specified).
  24. include::../execution.asciidoc[]
  25. [id="{upid}-{api}-response"]
  26. ==== Get job stats response
  27. The returned +{response}+ contains the requested job statistics:
  28. ["source","java",subs="attributes,callouts,macros"]
  29. --------------------------------------------------
  30. include-tagged::{doc-tests-file}[{api}-response]
  31. --------------------------------------------------
  32. <1> `getCount()` indicates the number of jobs statistics found.
  33. <2> `getJobStats()` is the collection of {ml} `JobStats` objects found.