mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-06 21:18:31 +00:00
When we force delete a DF analytics job, we currently first force stop it and then we proceed with deleting the job config. This may result in logging errors if the job config is deleted before it is retrieved while the job is starting. Instead of force stopping the job, it would make more sense to try to stop the job gracefully first. So we now try that out first. If normal stop fails, then we resort to force stopping the job to ensure we can go through with the delete. In addition, this commit introduces `timeout` for the delete action and makes use of it in the child requests. Backport of #57680
71 lines
1.6 KiB
Plaintext
71 lines
1.6 KiB
Plaintext
[role="xpack"]
|
|
[testenv="platinum"]
|
|
[[delete-dfanalytics]]
|
|
=== Delete {dfanalytics-jobs} API
|
|
[subs="attributes"]
|
|
++++
|
|
<titleabbrev>Delete {dfanalytics-jobs}</titleabbrev>
|
|
++++
|
|
|
|
Deletes an existing {dfanalytics-job}.
|
|
|
|
experimental[]
|
|
|
|
|
|
[[ml-delete-dfanalytics-request]]
|
|
==== {api-request-title}
|
|
|
|
`DELETE _ml/data_frame/analytics/<data_frame_analytics_id>`
|
|
|
|
|
|
[[ml-delete-dfanalytics-prereq]]
|
|
==== {api-prereq-title}
|
|
|
|
If the {es} {security-features} are enabled, you must have the following built-in roles or equivalent privileges:
|
|
|
|
* `machine_learning_admin`
|
|
* `kibana_admin` (UI only)
|
|
|
|
For more information, see <<security-privileges>> and <<built-in-roles>>.
|
|
|
|
|
|
[[ml-delete-dfanalytics-path-params]]
|
|
==== {api-path-parms-title}
|
|
|
|
`<data_frame_analytics_id>`::
|
|
(Required, string)
|
|
include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=job-id-data-frame-analytics]
|
|
|
|
[[ml-delete-dfanalytics-query-params]]
|
|
==== {api-query-parms-title}
|
|
|
|
`force`::
|
|
(Optional, boolean) If `true`, it deletes a job that is not stopped; this method is
|
|
quicker than stopping and deleting the job.
|
|
|
|
`timeout`::
|
|
(Optional, <<time-units,time units>>) The time to wait for the job to be deleted.
|
|
Defaults to 1 minute.
|
|
|
|
|
|
|
|
[[ml-delete-dfanalytics-example]]
|
|
==== {api-examples-title}
|
|
|
|
The following example deletes the `loganalytics` {dfanalytics-job}:
|
|
|
|
[source,console]
|
|
--------------------------------------------------
|
|
DELETE _ml/data_frame/analytics/loganalytics
|
|
--------------------------------------------------
|
|
// TEST[skip:TBD]
|
|
|
|
The API returns the following result:
|
|
|
|
[source,console-result]
|
|
----
|
|
{
|
|
"acknowledged" : true
|
|
}
|
|
----
|