2019-12-18 03:10:12 -05:00
|
|
|
[role="xpack"]
|
|
|
|
[testenv="basic"]
|
2020-10-02 07:34:28 -04:00
|
|
|
[[delete-trained-models]]
|
2020-10-02 13:15:14 -04:00
|
|
|
= Delete trained models API
|
2019-12-18 03:10:12 -05:00
|
|
|
[subs="attributes"]
|
|
|
|
++++
|
2020-10-02 13:15:14 -04:00
|
|
|
<titleabbrev>Delete trained models</titleabbrev>
|
2019-12-18 03:10:12 -05:00
|
|
|
++++
|
|
|
|
|
2020-10-02 07:34:28 -04:00
|
|
|
Deletes an existing trained {infer} model that is currently not referenced by an
|
2019-12-18 03:10:12 -05:00
|
|
|
ingest pipeline.
|
|
|
|
|
|
|
|
experimental[]
|
|
|
|
|
|
|
|
|
2020-10-02 07:34:28 -04:00
|
|
|
[[ml-delete-trained-models-request]]
|
2020-07-20 16:06:29 -04:00
|
|
|
== {api-request-title}
|
2019-12-18 03:10:12 -05:00
|
|
|
|
2020-10-02 07:34:28 -04:00
|
|
|
`DELETE _ml/trained_models/<model_id>`
|
2019-12-18 03:10:12 -05:00
|
|
|
|
|
|
|
|
2020-10-02 07:34:28 -04:00
|
|
|
[[ml-delete-trained-models-prereq]]
|
2020-07-20 16:06:29 -04:00
|
|
|
== {api-prereq-title}
|
2019-12-18 03:10:12 -05:00
|
|
|
|
2020-01-09 04:44:07 -05:00
|
|
|
If the {es} {security-features} are enabled, you must have the following built-in roles or equivalent privileges:
|
|
|
|
|
|
|
|
* `machine_learning_admin`
|
|
|
|
|
2020-07-23 19:43:10 -04:00
|
|
|
For more information, see <<built-in-roles>> and {ml-docs-setup-privileges}.
|
2019-12-18 03:10:12 -05:00
|
|
|
|
|
|
|
|
2020-10-02 07:34:28 -04:00
|
|
|
[[ml-delete-trained-models-path-params]]
|
2020-07-20 16:06:29 -04:00
|
|
|
== {api-path-parms-title}
|
2019-12-18 03:10:12 -05:00
|
|
|
|
|
|
|
`<model_id>`::
|
2020-10-02 07:34:28 -04:00
|
|
|
(Optional, string)
|
2020-06-01 16:46:15 -04:00
|
|
|
include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=model-id]
|
2019-12-18 03:10:12 -05:00
|
|
|
|
|
|
|
|
2020-10-02 07:34:28 -04:00
|
|
|
[[ml-delete-trained-models-response-codes]]
|
2020-07-20 16:06:29 -04:00
|
|
|
== {api-response-codes-title}
|
2019-12-18 03:10:12 -05:00
|
|
|
|
|
|
|
`409`::
|
2020-10-02 07:34:28 -04:00
|
|
|
The code indicates that the trained model is referenced by an ingest pipeline
|
2020-09-07 06:14:13 -04:00
|
|
|
and cannot be deleted.
|
2019-12-18 03:10:12 -05:00
|
|
|
|
|
|
|
|
2020-10-02 07:34:28 -04:00
|
|
|
[[ml-delete-trained-models-example]]
|
2020-07-20 16:06:29 -04:00
|
|
|
== {api-examples-title}
|
2019-12-18 03:10:12 -05:00
|
|
|
|
2020-10-02 07:34:28 -04:00
|
|
|
The following example deletes the `regression-job-one-1574775307356` trained
|
2019-12-18 03:10:12 -05:00
|
|
|
model:
|
|
|
|
|
|
|
|
[source,console]
|
|
|
|
--------------------------------------------------
|
2020-10-02 07:34:28 -04:00
|
|
|
DELETE _ml/trained_models/regression-job-one-1574775307356
|
2019-12-18 03:10:12 -05:00
|
|
|
--------------------------------------------------
|
|
|
|
// TEST[skip:TBD]
|
|
|
|
|
|
|
|
The API returns the following result:
|
|
|
|
|
|
|
|
|
|
|
|
[source,console-result]
|
|
|
|
----
|
|
|
|
{
|
|
|
|
"acknowledged" : true
|
|
|
|
}
|
|
|
|
----
|
|
|
|
|