delete-snapshot.asciidoc 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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) Identifier for the job.
  25. `<snapshot_id>`::
  26. (Required, string) Identifier for the model snapshot.
  27. [[ml-delete-snapshot-example]]
  28. ==== {api-examples-title}
  29. The following example deletes the `1491948163` snapshot:
  30. [source,console]
  31. --------------------------------------------------
  32. DELETE _ml/anomaly_detectors/farequote/model_snapshots/1491948163
  33. --------------------------------------------------
  34. // TEST[skip:todo]
  35. When the snapshot is deleted, you receive the following results:
  36. [source,console-result]
  37. ----
  38. {
  39. "acknowledged": true
  40. }
  41. ----