get-datafeed.asciidoc 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. [role="xpack"]
  2. [testenv="platinum"]
  3. [[ml-get-datafeed]]
  4. === Get {dfeeds} API
  5. [subs="attributes"]
  6. ++++
  7. <titleabbrev>Get {dfeeds}</titleabbrev>
  8. ++++
  9. Retrieves configuration information for {dfeeds}.
  10. [[ml-get-datafeed-request]]
  11. ==== {api-request-title}
  12. `GET _ml/datafeeds/<feed_id>` +
  13. `GET _ml/datafeeds/<feed_id>,<feed_id>` +
  14. `GET _ml/datafeeds/` +
  15. `GET _ml/datafeeds/_all`
  16. [[ml-get-datafeed-prereqs]]
  17. ==== {api-prereq-title}
  18. * If the {es} {security-features} are enabled, you must have `monitor_ml`,
  19. `monitor`, `manage_ml`, or `manage` cluster privileges to use this API. See
  20. <<security-privileges>>.
  21. [[ml-get-datafeed-desc]]
  22. ==== {api-description-title}
  23. You can get information for multiple {dfeeds} in a single API request by using a
  24. comma-separated list of {dfeeds} or a wildcard expression. You can get
  25. information for all {dfeeds} by using `_all`, by specifying `*` as the
  26. `<feed_id>`, or by omitting the `<feed_id>`.
  27. IMPORTANT: This API returns a maximum of 10,000 {dfeeds}.
  28. [[ml-get-datafeed-path-parms]]
  29. ==== {api-path-parms-title}
  30. `<feed_id>`::
  31. (Optional, string) Identifier for the {dfeed}. It can be a {dfeed} identifier
  32. or a wildcard expression. If you do not specify one of these options, the API
  33. returns information about all {dfeeds}.
  34. [[ml-get-datafeed-query-parms]]
  35. ==== {api-query-parms-title}
  36. `allow_no_datafeeds`::
  37. (Optional, boolean) Specifies what to do when the request:
  38. +
  39. --
  40. * Contains wildcard expressions and there are no {datafeeds} 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 `datafeeds` array when
  44. there are no matches and the subset of results when there are partial matches.
  45. If this parameter is `false`, the request returns a `404` status code when there
  46. are no matches or only partial matches.
  47. --
  48. [[ml-get-datafeed-results]]
  49. ==== {api-response-body-title}
  50. The API returns the following information:
  51. `datafeeds`::
  52. (array) An array of {dfeed} objects.
  53. For more information, see <<ml-datafeed-resource>>.
  54. [[ml-get-datafeed-response-codes]]
  55. ==== {api-response-codes-title}
  56. `404` (Missing resources)::
  57. If `allow_no_datafeeds` is `false`, this code indicates that there are no
  58. resources that match the request or only partial matches for the request.
  59. [[ml-get-datafeed-example]]
  60. ==== {api-examples-title}
  61. The following example gets configuration information for the
  62. `datafeed-total-requests` {dfeed}:
  63. [source,console]
  64. --------------------------------------------------
  65. GET _ml/datafeeds/datafeed-total-requests
  66. --------------------------------------------------
  67. // TEST[skip:setup:server_metrics_datafeed]
  68. The API returns the following results:
  69. [source,console-result]
  70. ----
  71. {
  72. "count": 1,
  73. "datafeeds": [
  74. {
  75. "datafeed_id": "datafeed-total-requests",
  76. "job_id": "total-requests",
  77. "query_delay": "83474ms",
  78. "indices": [
  79. "server-metrics"
  80. ],
  81. "query": {
  82. "match_all": {
  83. "boost": 1.0
  84. }
  85. },
  86. "scroll_size": 1000,
  87. "chunking_config": {
  88. "mode": "auto"
  89. }
  90. }
  91. ]
  92. }
  93. ----
  94. // TESTRESPONSE[s/"query.boost": "1.0"/"query.boost": $body.query.boost/]