get-dfanalytics-stats.asciidoc 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. [role="xpack"]
  2. [testenv="platinum"]
  3. [[get-dfanalytics-stats]]
  4. === Get {dfanalytics-jobs} statistics API
  5. [subs="attributes"]
  6. ++++
  7. <titleabbrev>Get {dfanalytics-jobs} stats</titleabbrev>
  8. ++++
  9. experimental[]
  10. Retrieves usage information for {dfanalytics-jobs}.
  11. [[ml-get-dfanalytics-stats-request]]
  12. ==== {api-request-title}
  13. `GET _ml/data_frame/analytics/<data_frame_analytics_id>/_stats` +
  14. `GET _ml/data_frame/analytics/<data_frame_analytics_id>,<data_frame_analytics_id>/_stats` +
  15. `GET _ml/data_frame/analytics/_stats` +
  16. `GET _ml/data_frame/analytics/_all/_stats` +
  17. `GET _ml/data_frame/analytics/*/_stats`
  18. [[ml-get-dfanalytics-stats-prereq]]
  19. ==== {api-prereq-title}
  20. * You must have `monitor_ml` privilege to use this API. For more
  21. information, see {stack-ov}/security-privileges.html[Security privileges] and
  22. {stack-ov}/built-in-roles.html[Built-in roles].
  23. [[ml-get-dfanalytics-stats-path-params]]
  24. ==== {api-path-parms-title}
  25. `<data_frame_analytics_id>` (Optional)::
  26. (string) Identifier for the {dfanalytics-job}. If you do not specify one of
  27. these options, the API returns information for the first hundred
  28. {dfanalytics-jobs}.
  29. `allow_no_match` (Optional)
  30. (boolean) If `false` and the `data_frame_analytics_id` does not match any
  31. {dfanalytics-job} an error will be returned. The default value is `true`.
  32. [[ml-get-dfanalytics-stats-query-params]]
  33. ==== {api-query-parms-title}
  34. `from` (Optional)::
  35. (integer) Skips the specified number of {dfanalytics-jobs}. The default value
  36. is `0`.
  37. `size` (Optional)::
  38. (integer) Specifies the maximum number of {dfanalytics-jobs} to obtain. The
  39. default value is `100`.
  40. [discrete]
  41. [[ml-get-dfanalytics-stats-response-body]]
  42. ==== {api-response-body-title}
  43. The API returns the following information:
  44. `data_frame_analytics`::
  45. (array) An array of statistics objects for {dfanalytics-jobs}, which are
  46. sorted by the `id` value in ascending order.
  47. [[ml-get-dfanalytics-stats-example]]
  48. ==== {api-examples-title}
  49. [source,js]
  50. --------------------------------------------------
  51. GET _ml/data_frame/analytics/loganalytics/_stats
  52. --------------------------------------------------
  53. // CONSOLE
  54. // TEST[skip:TBD]
  55. The API returns the following results:
  56. [source,js]
  57. ----
  58. {
  59. "count": 1,
  60. "data_frame_analytics": [
  61. {
  62. "id": "loganalytics",
  63. "state": "stopped"
  64. }
  65. ]
  66. }
  67. ----
  68. // TESTRESPONSE