get-dfanalytics-stats.asciidoc 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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 <<security-privileges>> and <<built-in-roles>>.
  22. [[ml-get-dfanalytics-stats-path-params]]
  23. ==== {api-path-parms-title}
  24. `<data_frame_analytics_id>`::
  25. (Optional, string)
  26. include::{docdir}/ml/ml-shared.asciidoc[tag=job-id-data-frame-analytics-default]
  27. [[ml-get-dfanalytics-stats-query-params]]
  28. ==== {api-query-parms-title}
  29. `allow_no_match`::
  30. (Optional, boolean)
  31. include::{docdir}/ml/ml-shared.asciidoc[tag=allow-no-match]
  32. `from`::
  33. (Optional, integer)
  34. include::{docdir}/ml/ml-shared.asciidoc[tag=from]
  35. `size`::
  36. (Optional, integer)
  37. include::{docdir}/ml/ml-shared.asciidoc[tag=size]
  38. [[ml-get-dfanalytics-stats-response-body]]
  39. ==== {api-response-body-title}
  40. The API returns the following information:
  41. `data_frame_analytics`::
  42. (array)
  43. include::{docdir}/ml/ml-shared.asciidoc[tag=data-frame-analytics-stats]
  44. [[ml-get-dfanalytics-stats-response-codes]]
  45. ==== {api-response-codes-title}
  46. `404` (Missing resources)::
  47. If `allow_no_match` is `false`, this code indicates that there are no
  48. resources that match the request or only partial matches for the request.
  49. [[ml-get-dfanalytics-stats-example]]
  50. ==== {api-examples-title}
  51. [source,console]
  52. --------------------------------------------------
  53. GET _ml/data_frame/analytics/loganalytics/_stats
  54. --------------------------------------------------
  55. // TEST[skip:TBD]
  56. The API returns the following results:
  57. [source,console-result]
  58. ----
  59. {
  60. "count": 1,
  61. "data_frame_analytics": [
  62. {
  63. "id": "loganalytics",
  64. "state": "stopped",
  65. "progress": [
  66. {
  67. "phase": "reindexing",
  68. "progress_percent": 0
  69. },
  70. {
  71. "phase": "loading_data",
  72. "progress_percent": 0
  73. },
  74. {
  75. "phase": "analyzing",
  76. "progress_percent": 0
  77. },
  78. {
  79. "phase": "writing_results",
  80. "progress_percent": 0
  81. }
  82. ]
  83. }
  84. ]
  85. }
  86. ----