get-dfanalytics.asciidoc 3.6 KB

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