delete-snapshot-api.asciidoc 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. [[delete-snapshot-api]]
  2. === Delete snapshot API
  3. ++++
  4. <titleabbrev>Delete snapshot</titleabbrev>
  5. ++++
  6. Deletes a <<snapshot-restore,snapshot>>.
  7. ////
  8. [source,console]
  9. ----
  10. PUT /_snapshot/my_repository
  11. {
  12. "type": "fs",
  13. "settings": {
  14. "location": "my_backup_location"
  15. }
  16. }
  17. PUT /_snapshot/my_repository/my_snapshot?wait_for_completion=true
  18. PUT /_snapshot/my_repository/snapshot_2?wait_for_completion=true
  19. PUT /_snapshot/my_repository/snapshot_3?wait_for_completion=true
  20. ----
  21. // TESTSETUP
  22. ////
  23. [source,console]
  24. -----------------------------------
  25. DELETE /_snapshot/my_repository/my_snapshot
  26. -----------------------------------
  27. [[delete-snapshot-api-request]]
  28. ==== {api-request-title}
  29. `DELETE /_snapshot/<repository>/<snapshot>`
  30. [[delete-snapshot-api-prereqs]]
  31. ==== {api-prereq-title}
  32. * If the {es} {security-features} are enabled, you must have the `manage`
  33. <<privileges-list-cluster,cluster privilege>> to use this API.
  34. [[delete-snapshot-api-path-params]]
  35. ==== {api-path-parms-title}
  36. `<repository>`::
  37. (Required, string)
  38. Name of the repository to delete a snapshot from.
  39. `<snapshot>`::
  40. (Required, string)
  41. Comma-separated list of snapshot names to delete. Also accepts wildcards (`*`).
  42. [[delete-snapshot-api-example]]
  43. ==== {api-example-title}
  44. The following request deletes `snapshot_2` and `snapshot_3` from the repository named `my_repository`.
  45. [source,console]
  46. ----
  47. DELETE /_snapshot/my_repository/snapshot_2,snapshot_3
  48. ----
  49. The API returns the following response:
  50. [source,console-result]
  51. ----
  52. {
  53. "acknowledged" : true
  54. }
  55. ----