get-dfanalytics-stats.asciidoc 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. [[ml-get-dfanalytics-stats-query-params]]
  30. ==== {api-query-parms-title}
  31. `allow_no_match` (Optional)::
  32. (boolean) If `false` and the `data_frame_analytics_id` does not match any
  33. {dfanalytics-job} an error will be returned. The default value is `true`.
  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. [[ml-get-dfanalytics-stats-response-body]]
  41. ==== {api-response-body-title}
  42. The API returns the following information:
  43. `data_frame_analytics`::
  44. (array) An array of statistics objects for {dfanalytics-jobs}, which are
  45. sorted by the `id` value in ascending order.
  46. [[ml-get-dfanalytics-stats-example]]
  47. ==== {api-examples-title}
  48. [source,js]
  49. --------------------------------------------------
  50. GET _ml/data_frame/analytics/loganalytics/_stats
  51. --------------------------------------------------
  52. // CONSOLE
  53. // TEST[skip:TBD]
  54. The API returns the following results:
  55. [source,js]
  56. ----
  57. {
  58. "count": 1,
  59. "data_frame_analytics": [
  60. {
  61. "id": "loganalytics",
  62. "state": "stopped"
  63. }
  64. ]
  65. }
  66. ----
  67. // TESTRESPONSE