get-datafeed.asciidoc 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. [role="xpack"]
  2. [testenv="platinum"]
  3. [[ml-get-datafeed]]
  4. === Get {dfeeds} API
  5. ++++
  6. <titleabbrev>Get {dfeeds}</titleabbrev>
  7. ++++
  8. Retrieves configuration information for {dfeeds}.
  9. ==== Request
  10. `GET _ml/datafeeds/<feed_id>` +
  11. `GET _ml/datafeeds/<feed_id>,<feed_id>` +
  12. `GET _ml/datafeeds/` +
  13. `GET _ml/datafeeds/_all` +
  14. ===== Description
  15. You can get information for multiple {dfeeds} in a single API request by using a
  16. comma-separated list of {dfeeds} or a wildcard expression. You can get
  17. information for all {dfeeds} by using `_all`, by specifying `*` as the
  18. `<feed_id>`, or by omitting the `<feed_id>`.
  19. IMPORTANT: This API returns a maximum of 10,000 {dfeeds}.
  20. ==== Path Parameters
  21. `feed_id`::
  22. (string) Identifier for the {dfeed}. It can be a {dfeed} identifier or a
  23. wildcard expression. If you do not specify one of these options, the API
  24. returns information about all {dfeeds}.
  25. ==== Results
  26. The API returns the following information:
  27. `datafeeds`::
  28. (array) An array of {dfeed} objects.
  29. For more information, see <<ml-datafeed-resource>>.
  30. ==== Authorization
  31. You must have `monitor_ml`, `monitor`, `manage_ml`, or `manage` cluster
  32. privileges to use this API. For more information, see
  33. {xpack-ref}/security-privileges.html[Security Privileges].
  34. ==== Examples
  35. The following example gets configuration information for the
  36. `datafeed-total-requests` {dfeed}:
  37. [source,js]
  38. --------------------------------------------------
  39. GET _ml/datafeeds/datafeed-total-requests
  40. --------------------------------------------------
  41. // CONSOLE
  42. // TEST[skip:setup:server_metrics_datafeed]
  43. The API returns the following results:
  44. [source,js]
  45. ----
  46. {
  47. "count": 1,
  48. "datafeeds": [
  49. {
  50. "datafeed_id": "datafeed-total-requests",
  51. "job_id": "total-requests",
  52. "query_delay": "83474ms",
  53. "indices": [
  54. "server-metrics"
  55. ],
  56. "query": {
  57. "match_all": {
  58. "boost": 1.0
  59. }
  60. },
  61. "scroll_size": 1000,
  62. "chunking_config": {
  63. "mode": "auto"
  64. }
  65. }
  66. ]
  67. }
  68. ----
  69. // TESTRESPONSE[s/"query.boost": "1.0"/"query.boost": $body.query.boost/]