get-dfanalytics-stats.asciidoc 2.8 KB

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