get-dfanalytics.asciidoc 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. [role="xpack"]
  2. [testenv="platinum"]
  3. [[get-dfanalytics]]
  4. === Get {dfanalytics-jobs} API
  5. [subs="attributes"]
  6. ++++
  7. <titleabbrev>Get {dfanalytics-jobs}</titleabbrev>
  8. ++++
  9. Retrieves configuration information for {dfanalytics-jobs}.
  10. experimental[]
  11. [[ml-get-dfanalytics-request]]
  12. ==== {api-request-title}
  13. `GET _ml/data_frame/analytics/<data_frame_analytics_id>` +
  14. `GET _ml/data_frame/analytics/<data_frame_analytics_id>,<data_frame_analytics_id>` +
  15. `GET _ml/data_frame/analytics/` +
  16. `GET _ml/data_frame/analytics/_all`
  17. [[ml-get-dfanalytics-prereq]]
  18. ==== {api-prereq-title}
  19. * You must have `monitor_ml` privilege to use this API. For more
  20. information, see {stack-ov}/security-privileges.html[Security privileges] and
  21. {stack-ov}/built-in-roles.html[Built-in roles].
  22. [[ml-get-dfanalytics-desc]]
  23. ==== {api-description-title}
  24. You can get information for multiple {dfanalytics-jobs} in a single API request
  25. by using a comma-separated list of {dfanalytics-jobs} or a wildcard expression.
  26. You can get information for all {dfanalytics-jobs} by using _all, by specifying
  27. `*` as the `<data_frame_analytics_id>`, or by omitting the
  28. `<data_frame_analytics_id>`.
  29. [[ml-get-dfanalytics-path-params]]
  30. ==== {api-path-parms-title}
  31. `<data_frame_analytics_id>`::
  32. (Optional, string) Identifier for the {dfanalytics-job}. If you do not specify
  33. one of these options, the API returns information for the first hundred
  34. {dfanalytics-jobs}.
  35. `allow_no_match` (Optional)::
  36. (boolean) If `false` and the `data_frame_analytics_id` does not match any
  37. {dfanalytics-job} an error will be returned. The default value is `true`.
  38. [[ml-get-dfanalytics-query-params]]
  39. ==== {api-query-parms-title}
  40. `allow_no_match`::
  41. (Optional, boolean) If `false` and the `data_frame_analytics_id` does not
  42. match any {dfanalytics-job} an error will be returned. The default value is
  43. `true`.
  44. `from`::
  45. (Optional, integer) Skips the specified number of {dfanalytics-jobs}. The
  46. default value is `0`.
  47. `size`::
  48. (Optional, integer) Specifies the maximum number of {dfanalytics-jobs} to obtain. The
  49. default value is `100`.
  50. [[ml-get-dfanalytics-results]]
  51. ==== {api-response-body-title}
  52. `data_frame_analytics`::
  53. (array) An array of {dfanalytics-job} resources. For more information, see
  54. <<ml-dfanalytics-resources>>.
  55. [[ml-get-dfanalytics-example]]
  56. ==== {api-examples-title}
  57. The following example gets configuration information for the `loganalytics`
  58. {dfanalytics-job}:
  59. [source,js]
  60. --------------------------------------------------
  61. GET _ml/data_frame/analytics/loganalytics
  62. --------------------------------------------------
  63. // CONSOLE
  64. // TEST[skip:TBD]
  65. The API returns the following results:
  66. [source,js]
  67. ----
  68. {
  69. "count": 1,
  70. "data_frame_analytics": [
  71. {
  72. "id": "loganalytics",
  73. "source": {
  74. "index": "logdata",
  75. "query": {
  76. "match_all": {}
  77. }
  78. },
  79. "dest": {
  80. "index": "logdata_out",
  81. "results_field": "ml"
  82. },
  83. "analysis": {
  84. "outlier_detection": {}
  85. },
  86. "model_memory_limit": "1gb",
  87. "create_time": 1562265491319,
  88. "version" : "8.0.0"
  89. }
  90. ]
  91. }
  92. ----
  93. // TESTRESPONSE