OpenSearch/docs/en/rest-api/ml/stop-datafeed.asciidoc

62 lines
1.4 KiB
Plaintext

//lcawley Verified example output 2017-04-11
[[ml-stop-datafeed]]
==== Stop Data Feeds
A data feed that is stopped ceases to retrieve data from {es}.
A data feed can be opened and closed multiple times throughout its lifecycle.
===== Request
`POST _xpack/ml/datafeeds/<feed_id>/_stop`
===== Description
You must have `manage_ml`, or `manage` cluster privileges to use this API.
For more information, see <<privileges-list-cluster>>.
===== Path Parameters
`feed_id` (required)::
(string) Identifier for the data feed
===== Request Body
`force`::
(boolean) If true, the data feed is stopped forcefully.
`timeout`::
(time) Controls the amount of time to wait until a data feed stops.
The default value is 20 seconds.
////
===== Responses
200
(EmptyResponse) The cluster has been successfully deleted
404
(BasicFailedReply) The cluster specified by {cluster_id} cannot be found (code: clusters.cluster_not_found)
412
(BasicFailedReply) The Elasticsearch cluster has not been shutdown yet (code: clusters.cluster_plan_state_error)
////
===== Examples
The following example stops the `datafeed-it-ops-kpi` data feed:
[source,js]
--------------------------------------------------
POST _xpack/ml/datafeeds/datafeed-it-ops-kpi/_stop
{
"timeout": "30s"
}
--------------------------------------------------
// CONSOLE
// TEST[skip:todo]
When the data feed stops, you receive the following results:
[source,js]
----
{
"stopped": true
}
----