2017-04-11 21:52:47 -04:00
|
|
|
//lcawley: Verified example output 2017-04-11
|
2017-04-04 18:26:39 -04:00
|
|
|
[[ml-delete-job]]
|
2017-06-06 16:42:47 -04:00
|
|
|
=== Delete Jobs
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-26 18:29:55 -04:00
|
|
|
The delete job API enables you to delete an existing anomaly detection job.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-25 17:08:29 -04:00
|
|
|
|
2017-06-06 16:42:47 -04:00
|
|
|
==== Request
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
`DELETE _xpack/ml/anomaly_detectors/<job_id>`
|
|
|
|
|
2017-04-25 17:08:29 -04:00
|
|
|
|
2017-06-06 16:42:47 -04:00
|
|
|
==== Description
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
All job configuration, model state and results are deleted.
|
|
|
|
|
|
|
|
IMPORTANT: Deleting a job must be done via this API only. Do not delete the
|
|
|
|
job directly from the `.ml-*` indices using the Elasticsearch
|
|
|
|
DELETE Document API. When {security} is enabled, make sure no `write`
|
|
|
|
privileges are granted to anyone over the `.ml-*` indices.
|
|
|
|
|
2017-05-02 15:45:42 -04:00
|
|
|
Before you can delete a job, you must delete the {dfeeds} that are associated
|
2017-06-06 04:41:33 -04:00
|
|
|
with it. See <<ml-delete-datafeed,Delete {dfeeds-cap}>>. Unless the `force` parameter
|
|
|
|
is used the job must be closed before it can be deleted.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-25 17:08:29 -04:00
|
|
|
It is not currently possible to delete multiple jobs using wildcards or a comma
|
|
|
|
separated list.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-06-06 16:42:47 -04:00
|
|
|
==== Path Parameters
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
`job_id` (required)::
|
2017-05-02 15:45:42 -04:00
|
|
|
(string) Identifier for the job
|
2017-04-11 21:52:47 -04:00
|
|
|
|
2017-06-06 04:41:33 -04:00
|
|
|
===== Query Parameters
|
|
|
|
|
|
|
|
`force`::
|
|
|
|
(boolean) Use to forcefully delete an opened job; this method is quicker than
|
|
|
|
closing and deleting the job.
|
|
|
|
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-06-06 16:42:47 -04:00
|
|
|
==== Authorization
|
2017-04-25 17:08:29 -04:00
|
|
|
|
|
|
|
You must have `manage_ml`, or `manage` cluster privileges to use this API.
|
|
|
|
For more information, see <<privileges-list-cluster>>.
|
|
|
|
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-06-06 16:42:47 -04:00
|
|
|
==== Examples
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
The following example deletes the `event_rate` job:
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
DELETE _xpack/ml/anomaly_detectors/event_rate
|
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
// TEST[skip:todo]
|
|
|
|
|
|
|
|
When the job is deleted, you receive the following results:
|
2017-04-21 11:23:27 -04:00
|
|
|
[source,js]
|
2017-04-04 18:26:39 -04:00
|
|
|
----
|
|
|
|
{
|
|
|
|
"acknowledged": true
|
|
|
|
}
|
|
|
|
----
|