stop-datafeed.asciidoc 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. [role="xpack"]
  2. [testenv="platinum"]
  3. [[ml-stop-datafeed]]
  4. === Stop {dfeeds} API
  5. [subs="attributes"]
  6. ++++
  7. <titleabbrev>Stop {dfeeds}</titleabbrev>
  8. ++++
  9. Stops one or more {dfeeds}.
  10. [[ml-stop-datafeed-request]]
  11. ==== {api-request-title}
  12. `POST _ml/datafeeds/<feed_id>/_stop` +
  13. `POST _ml/datafeeds/<feed_id>,<feed_id>/_stop` +
  14. `POST _ml/datafeeds/_all/_stop`
  15. [[ml-stop-datafeed-prereqs]]
  16. ==== {api-prereq-title}
  17. * If the {es} {security-features} are enabled, you must have `manage_ml` or
  18. `manage` cluster privileges to use this API. See
  19. {stack-ov}/security-privileges.html[Security privileges].
  20. [[ml-stop-datafeed-desc]]
  21. ==== {api-description-title}
  22. A {dfeed} that is stopped ceases to retrieve data from {es}.
  23. A {dfeed} can be started and stopped multiple times throughout its lifecycle.
  24. You can stop multiple {dfeeds} in a single API request by using a
  25. comma-separated list of {dfeeds} or a wildcard expression. You can close all
  26. {dfeeds} by using `_all` or by specifying `*` as the `<feed_id>`.
  27. [[ml-stop-datafeed-path-parms]]
  28. ==== {api-path-parms-title}
  29. `<feed_id>`::
  30. (Required, string) Identifier for the {dfeed}. It can be a {dfeed} identifier
  31. or a wildcard expression.
  32. [[ml-stop-datafeed-request-body]]
  33. ==== {api-request-body-title}
  34. `force`::
  35. (Optional, boolean) If true, the {dfeed} is stopped forcefully.
  36. `timeout`::
  37. (Optional, time) Controls the amount of time to wait until a {dfeed} stops.
  38. The default value is 20 seconds.
  39. [[ml-stop-datafeed-example]]
  40. ==== {api-examples-title}
  41. The following example stops the `datafeed-total-requests` {dfeed}:
  42. [source,js]
  43. --------------------------------------------------
  44. POST _ml/datafeeds/datafeed-total-requests/_stop
  45. {
  46. "timeout": "30s"
  47. }
  48. --------------------------------------------------
  49. // CONSOLE
  50. // TEST[skip:setup:server_metrics_startdf]
  51. When the {dfeed} stops, you receive the following results:
  52. [source,js]
  53. ----
  54. {
  55. "stopped": true
  56. }
  57. ----
  58. // TESTRESPONSE