stop-datafeed.asciidoc 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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) Identifier for the {dfeed}. It can be a {dfeed} identifier
  31. or a wildcard expression.
  32. [[ml-stop-datafeed-query-parms]]
  33. ==== {api-query-parms-title}
  34. `allow_no_datafeeds`::
  35. (Optional, boolean) Specifies what to do when the request:
  36. +
  37. --
  38. * Contains wildcard expressions and there are no {datafeeds} that match.
  39. * Contains the `_all` string or no identifiers and there are no matches.
  40. * Contains wildcard expressions and there are only partial matches.
  41. The default value is `true`, which returns an empty `datafeeds` array when
  42. there are no matches and the subset of results when there are partial matches.
  43. If this parameter is `false`, the request returns a `404` status code when there
  44. are no matches or only partial matches.
  45. --
  46. [[ml-stop-datafeed-request-body]]
  47. ==== {api-request-body-title}
  48. `force`::
  49. (Optional, boolean) If true, the {dfeed} is stopped forcefully.
  50. `timeout`::
  51. (Optional, time) Controls the amount of time to wait until a {dfeed} stops.
  52. The default value is 20 seconds.
  53. [[ml-stop-datafeed-response-codes]]
  54. ==== {api-response-codes-title}
  55. `404` (Missing resources)::
  56. If `allow_no_datafeeds` is `false`, this code indicates that there are no
  57. resources that match the request or only partial matches for the request.
  58. [[ml-stop-datafeed-example]]
  59. ==== {api-examples-title}
  60. The following example stops the `datafeed-total-requests` {dfeed}:
  61. [source,console]
  62. --------------------------------------------------
  63. POST _ml/datafeeds/datafeed-total-requests/_stop
  64. {
  65. "timeout": "30s"
  66. }
  67. --------------------------------------------------
  68. // TEST[skip:setup:server_metrics_startdf]
  69. When the {dfeed} stops, you receive the following results:
  70. [source,console-result]
  71. ----
  72. {
  73. "stopped": true
  74. }
  75. ----