delete-snapshot.asciidoc 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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-desc]]
  13. ==== {api-description-title}
  14. IMPORTANT: You cannot delete the active model snapshot. To delete that snapshot,
  15. first revert to a different one. To identify the active model snapshot, refer to
  16. the `model_snapshot_id` in the results from the get jobs API.
  17. [[ml-delete-snapshot-path-parms]]
  18. ==== {api-path-parms-title}
  19. `job_id` (required)::
  20. (string) Identifier for the job
  21. `snapshot_id` (required)::
  22. (string) Identifier for the model snapshot
  23. [[ml-delete-snapshot-prereqs]]
  24. ==== {api-prereq-title}
  25. You must have `manage_ml`, or `manage` cluster privileges to use this API.
  26. For more information, see {xpack-ref}/security-privileges.html[Security Privileges].
  27. [[ml-delete-snapshot-example]]
  28. ==== {api-examples-title}
  29. The following example deletes the `1491948163` snapshot:
  30. [source,js]
  31. --------------------------------------------------
  32. DELETE _ml/anomaly_detectors/farequote/model_snapshots/1491948163
  33. --------------------------------------------------
  34. // CONSOLE
  35. // TEST[skip:todo]
  36. When the snapshot is deleted, you receive the following results:
  37. [source,js]
  38. ----
  39. {
  40. "acknowledged": true
  41. }
  42. ----
  43. // TESTRESPONSE