get-job-stats.asciidoc 1.4 KB

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