get-dfanalytics.asciidoc 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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. [[ml-get-dfanalytics-path-params]]
  27. ==== {api-path-parms-title}
  28. `<data_frame_analytics_id>`::
  29. (Optional, string) Identifier for the {dfanalytics-job}. If you do not specify
  30. one of these options, the API returns information for the first hundred
  31. {dfanalytics-jobs}. You can get information for all {dfanalytics-jobs} by
  32. using _all, by specifying `*` as the `<data_frame_analytics_id>`, or by
  33. omitting the `<data_frame_analytics_id>`.
  34. [[ml-get-dfanalytics-query-params]]
  35. ==== {api-query-parms-title}
  36. `allow_no_match`::
  37. (Optional, boolean) Specifies what to do when the request:
  38. +
  39. --
  40. * Contains wildcard expressions and there are no {dfanalytics-jobs} that match.
  41. * Contains the `_all` string or no identifiers and there are no matches.
  42. * Contains wildcard expressions and there are only partial matches.
  43. The default value is `true`, which returns an empty `data_frame_analytics` array
  44. when there are no matches and the subset of results when there are partial
  45. matches. If this parameter is `false`, the request returns a `404` status code
  46. when there are no matches or only partial matches.
  47. --
  48. `from`::
  49. (Optional, integer) Skips the specified number of {dfanalytics-jobs}. The
  50. default value is `0`.
  51. `size`::
  52. (Optional, integer) Specifies the maximum number of {dfanalytics-jobs} to
  53. obtain. The default value is `100`.
  54. [[ml-get-dfanalytics-results]]
  55. ==== {api-response-body-title}
  56. `data_frame_analytics`::
  57. (array) An array of {dfanalytics-job} resources. For more information, see
  58. <<ml-dfanalytics-resources>>.
  59. [[ml-get-dfanalytics-response-codes]]
  60. ==== {api-response-codes-title}
  61. `404` (Missing resources)::
  62. If `allow_no_match` is `false`, this code indicates that there are no
  63. resources that match the request or only partial matches for the request.
  64. [[ml-get-dfanalytics-example]]
  65. ==== {api-examples-title}
  66. The following example gets configuration information for the `loganalytics`
  67. {dfanalytics-job}:
  68. [source,js]
  69. --------------------------------------------------
  70. GET _ml/data_frame/analytics/loganalytics
  71. --------------------------------------------------
  72. // CONSOLE
  73. // TEST[skip:TBD]
  74. The API returns the following results:
  75. [source,js]
  76. ----
  77. {
  78. "count": 1,
  79. "data_frame_analytics": [
  80. {
  81. "id": "loganalytics",
  82. "source": {
  83. "index": "logdata",
  84. "query": {
  85. "match_all": {}
  86. }
  87. },
  88. "dest": {
  89. "index": "logdata_out",
  90. "results_field": "ml"
  91. },
  92. "analysis": {
  93. "outlier_detection": {}
  94. },
  95. "model_memory_limit": "1gb",
  96. "create_time": 1562265491319,
  97. "version" : "8.0.0"
  98. }
  99. ]
  100. }
  101. ----
  102. // TESTRESPONSE