get-dfanalytics-stats.asciidoc 2.8 KB

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