get-dfanalytics-stats.asciidoc 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. Retrieves usage information for {dfanalytics-jobs}.
  10. experimental[]
  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>`::
  26. (Optional, string)Identifier for the {dfanalytics-job}. If you do not specify
  27. one of 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`::
  32. (Optional, boolean) Specifies what to do when the request:
  33. +
  34. --
  35. * Contains wildcard expressions and there are no {dfanalytics-jobs} that match.
  36. * Contains the `_all` string or no identifiers and there are no matches.
  37. * Contains wildcard expressions and there are only partial matches.
  38. The default value is `true`, which returns an empty `data_frame_analytics` array
  39. when there are no matches and the subset of results when there are partial
  40. matches. If this parameter is `false`, the request returns a `404` status code
  41. when there are no matches or only partial matches.
  42. --
  43. `from`::
  44. (Optional, integer) Skips the specified number of {dfanalytics-jobs}. The
  45. default value is `0`.
  46. `size`::
  47. (Optional, integer) Specifies the maximum number of {dfanalytics-jobs} to
  48. obtain. The default value is `100`.
  49. [[ml-get-dfanalytics-stats-response-body]]
  50. ==== {api-response-body-title}
  51. The API returns the following information:
  52. `data_frame_analytics`::
  53. (array) An array of statistics objects for {dfanalytics-jobs}, which are
  54. sorted by the `id` value in ascending order.
  55. [[ml-get-dfanalytics-stats-response-codes]]
  56. ==== {api-response-codes-title}
  57. `404` (Missing resources)::
  58. If `allow_no_match` is `false`, this code indicates that there are no
  59. resources that match the request or only partial matches for the request.
  60. [[ml-get-dfanalytics-stats-example]]
  61. ==== {api-examples-title}
  62. [source,js]
  63. --------------------------------------------------
  64. GET _ml/data_frame/analytics/loganalytics/_stats
  65. --------------------------------------------------
  66. // CONSOLE
  67. // TEST[skip:TBD]
  68. The API returns the following results:
  69. [source,js]
  70. ----
  71. {
  72. "count": 1,
  73. "data_frame_analytics": [
  74. {
  75. "id": "loganalytics",
  76. "state": "stopped"
  77. }
  78. ]
  79. }
  80. ----
  81. // TESTRESPONSE