stop-datafeed.asciidoc 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. <<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)
  31. include::{docdir}/ml/ml-shared.asciidoc[tag=datafeed-id-wildcard]
  32. [[ml-stop-datafeed-query-parms]]
  33. ==== {api-query-parms-title}
  34. `allow_no_datafeeds`::
  35. (Optional, boolean)
  36. include::{docdir}/ml/ml-shared.asciidoc[tag=allow-no-datafeeds]
  37. [[ml-stop-datafeed-request-body]]
  38. ==== {api-request-body-title}
  39. `force`::
  40. (Optional, boolean) If true, the {dfeed} is stopped forcefully.
  41. `timeout`::
  42. (Optional, time) Controls the amount of time to wait until a {dfeed} stops.
  43. The default value is 20 seconds.
  44. [[ml-stop-datafeed-response-codes]]
  45. ==== {api-response-codes-title}
  46. `404` (Missing resources)::
  47. If `allow_no_datafeeds` is `false`, this code indicates that there are no
  48. resources that match the request or only partial matches for the request.
  49. [[ml-stop-datafeed-example]]
  50. ==== {api-examples-title}
  51. The following example stops the `datafeed-total-requests` {dfeed}:
  52. [source,console]
  53. --------------------------------------------------
  54. POST _ml/datafeeds/datafeed-total-requests/_stop
  55. {
  56. "timeout": "30s"
  57. }
  58. --------------------------------------------------
  59. // TEST[skip:setup:server_metrics_startdf]
  60. When the {dfeed} stops, you receive the following results:
  61. [source,console-result]
  62. ----
  63. {
  64. "stopped": true
  65. }
  66. ----