elasticsearch/docs/reference/ml/trained-models/apis/delete-trained-models.asciidoc
Liam Thompson 33a71e3289
[DOCS] Refactor book-scoped variables in docs/reference/index.asciidoc (#107413)
* Remove `es-test-dir` book-scoped variable

* Remove `plugins-examples-dir` book-scoped variable

* Remove `:dependencies-dir:` and `:xes-repo-dir:` book-scoped variables

- In `index.asciidoc`, two variables (`:dependencies-dir:` and `:xes-repo-dir:`) were removed.
- In `sql/index.asciidoc`, the `:sql-tests:` path was updated to fuller path
- In `esql/index.asciidoc`, the `:esql-tests:` path was updated idem

* Replace `es-repo-dir` with `es-ref-dir`

* Move `:include-xpack: true` to few files that use it, remove from index.asciidoc
2024-04-17 14:37:07 +02:00

67 lines
1.5 KiB
Text

[role="xpack"]
[[delete-trained-models]]
= Delete trained models API
[subs="attributes"]
++++
<titleabbrev>Delete trained models</titleabbrev>
++++
Deletes an existing trained {infer} model.
[[ml-delete-trained-models-request]]
== {api-request-title}
`DELETE _ml/trained_models/<model_id>`
[[ml-delete-trained-models-prereq]]
== {api-prereq-title}
Requires the `manage_ml` cluster privilege. This privilege is included in the
`machine_learning_admin` built-in role.
[[ml-delete-trained-models-path-params]]
== {api-path-parms-title}
`<model_id>`::
(Optional, string)
include::{es-ref-dir}/ml/ml-shared.asciidoc[tag=model-id]
[[ml-delete-trained-models-query-parms]]
== {api-query-parms-title}
`force`::
(Optional, Boolean) Use to forcefully delete a trained model that is referenced
by ingest pipelines or has a started deployment.
[[ml-delete-trained-models-response-codes]]
== {api-response-codes-title}
`409`::
The code indicates that the trained model is referenced by an ingest pipeline
and cannot be deleted.
[[ml-delete-trained-models-example]]
== {api-examples-title}
The following example deletes the `regression-job-one-1574775307356` trained
model:
[source,console]
--------------------------------------------------
DELETE _ml/trained_models/regression-job-one-1574775307356
--------------------------------------------------
// TEST[skip:TBD]
The API returns the following result:
[source,console-result]
----
{
"acknowledged" : true
}
----