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 <<security-privileges>>.
  16. [[ml-delete-snapshot-desc]]
  17. ==== {api-description-title}
  18. IMPORTANT: You cannot delete the active model snapshot. To delete that snapshot,
  19. first revert to a different one. To identify the active model snapshot, refer to
  20. the `model_snapshot_id` in the results from the get jobs API.
  21. [[ml-delete-snapshot-path-parms]]
  22. ==== {api-path-parms-title}
  23. `<job_id>`::
  24. (Required, string)
  25. include::{docdir}/ml/ml-shared.asciidoc[tag=job-id-anomaly-detection]
  26. `<snapshot_id>`::
  27. (Required, string)
  28. include::{docdir}/ml/ml-shared.asciidoc[tag=snapshot-id]
  29. [[ml-delete-snapshot-example]]
  30. ==== {api-examples-title}
  31. The following example deletes the `1491948163` snapshot:
  32. [source,console]
  33. --------------------------------------------------
  34. DELETE _ml/anomaly_detectors/farequote/model_snapshots/1491948163
  35. --------------------------------------------------
  36. // TEST[skip:todo]
  37. When the snapshot is deleted, you receive the following results:
  38. [source,console-result]
  39. ----
  40. {
  41. "acknowledged": true
  42. }
  43. ----