get-datafeed.asciidoc 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. {stack-ov}/security-privileges.html[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>` (Optional)::
  31. (string) Identifier for the {dfeed}. It can be a {dfeed} identifier or a
  32. wildcard expression. If you do not specify one of these options, the API
  33. returns information about all {dfeeds}.
  34. [[ml-get-datafeed-results]]
  35. ==== {api-response-body-title}
  36. The API returns the following information:
  37. `datafeeds`::
  38. (array) An array of {dfeed} objects.
  39. For more information, see <<ml-datafeed-resource>>.
  40. [[ml-get-datafeed-example]]
  41. ==== {api-examples-title}
  42. The following example gets configuration information for the
  43. `datafeed-total-requests` {dfeed}:
  44. [source,js]
  45. --------------------------------------------------
  46. GET _ml/datafeeds/datafeed-total-requests
  47. --------------------------------------------------
  48. // CONSOLE
  49. // TEST[skip:setup:server_metrics_datafeed]
  50. The API returns the following results:
  51. [source,js]
  52. ----
  53. {
  54. "count": 1,
  55. "datafeeds": [
  56. {
  57. "datafeed_id": "datafeed-total-requests",
  58. "job_id": "total-requests",
  59. "query_delay": "83474ms",
  60. "indices": [
  61. "server-metrics"
  62. ],
  63. "query": {
  64. "match_all": {
  65. "boost": 1.0
  66. }
  67. },
  68. "scroll_size": 1000,
  69. "chunking_config": {
  70. "mode": "auto"
  71. }
  72. }
  73. ]
  74. }
  75. ----
  76. // TESTRESPONSE[s/"query.boost": "1.0"/"query.boost": $body.query.boost/]