delete-snapshot.asciidoc 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. [role="xpack"]
  2. [testenv="platinum"]
  3. [[ml-delete-snapshot]]
  4. === Delete model snapshots API
  5. ++++
  6. <titleabbrev>Delete model snapshots</titleabbrev>
  7. ++++
  8. Deletes an existing model snapshot.
  9. [[ml-delete-snapshot-request]]
  10. ==== {api-request-title}
  11. `DELETE _ml/anomaly_detectors/<job_id>/model_snapshots/<snapshot_id>`
  12. [[ml-delete-snapshot-prereqs]]
  13. ==== {api-prereq-title}
  14. * If the {es} {security-features} are enabled, you must have `manage_ml` or
  15. `manage` cluster privileges to use this API. See
  16. {stack-ov}/security-privileges.html[Security privileges].
  17. [[ml-delete-snapshot-desc]]
  18. ==== {api-description-title}
  19. IMPORTANT: You cannot delete the active model snapshot. To delete that snapshot,
  20. first revert to a different one. To identify the active model snapshot, refer to
  21. the `model_snapshot_id` in the results from the get jobs API.
  22. [[ml-delete-snapshot-path-parms]]
  23. ==== {api-path-parms-title}
  24. `<job_id>`::
  25. (Required, string) Identifier for the job.
  26. `<snapshot_id>`::
  27. (Required, string) Identifier for the model snapshot.
  28. [[ml-delete-snapshot-example]]
  29. ==== {api-examples-title}
  30. The following example deletes the `1491948163` snapshot:
  31. [source,js]
  32. --------------------------------------------------
  33. DELETE _ml/anomaly_detectors/farequote/model_snapshots/1491948163
  34. --------------------------------------------------
  35. // CONSOLE
  36. // TEST[skip:todo]
  37. When the snapshot is deleted, you receive the following results:
  38. [source,js]
  39. ----
  40. {
  41. "acknowledged": true
  42. }
  43. ----
  44. // TESTRESPONSE