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
  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. [role="child_attributes"]
  41. [[ml-get-dfanalytics-stats-response-body]]
  42. ==== {api-response-body-title}
  43. The API returns the following information:
  44. `data_frame_analytics`::
  45. (array)
  46. include::{docdir}/ml/ml-shared.asciidoc[tag=data-frame-analytics-stats]
  47. [[ml-get-dfanalytics-stats-response-codes]]
  48. ==== {api-response-codes-title}
  49. `404` (Missing resources)::
  50. If `allow_no_match` is `false`, this code indicates that there are no
  51. resources that match the request or only partial matches for the request.
  52. [[ml-get-dfanalytics-stats-example]]
  53. ==== {api-examples-title}
  54. [source,console]
  55. --------------------------------------------------
  56. GET _ml/data_frame/analytics/loganalytics/_stats
  57. --------------------------------------------------
  58. // TEST[skip:TBD]
  59. The API returns the following results:
  60. [source,console-result]
  61. ----
  62. {
  63. "count": 1,
  64. "data_frame_analytics": [
  65. {
  66. "id": "loganalytics",
  67. "state": "stopped",
  68. "progress": [
  69. {
  70. "phase": "reindexing",
  71. "progress_percent": 0
  72. },
  73. {
  74. "phase": "loading_data",
  75. "progress_percent": 0
  76. },
  77. {
  78. "phase": "analyzing",
  79. "progress_percent": 0
  80. },
  81. {
  82. "phase": "writing_results",
  83. "progress_percent": 0
  84. }
  85. ]
  86. }
  87. ]
  88. }
  89. ----