delete-snapshot-api.asciidoc 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. [[delete-snapshot-api]]
  2. === Delete snapshot API
  3. ++++
  4. <titleabbrev>Delete snapshot</titleabbrev>
  5. ++++
  6. .New API reference
  7. [sidebar]
  8. --
  9. For the most up-to-date API details, refer to {api-es}/group/endpoint-snapshot[Snapshot and restore APIs].
  10. --
  11. Deletes a <<snapshot-restore,snapshot>>.
  12. ////
  13. [source,console]
  14. ----
  15. PUT /_snapshot/my_repository
  16. {
  17. "type": "fs",
  18. "settings": {
  19. "location": "my_backup_location"
  20. }
  21. }
  22. PUT /_snapshot/my_repository/my_snapshot?wait_for_completion=true
  23. PUT /_snapshot/my_repository/snapshot_2?wait_for_completion=true
  24. PUT /_snapshot/my_repository/snapshot_3?wait_for_completion=true
  25. ----
  26. // TESTSETUP
  27. ////
  28. [source,console]
  29. -----------------------------------
  30. DELETE /_snapshot/my_repository/my_snapshot
  31. -----------------------------------
  32. [[delete-snapshot-api-request]]
  33. ==== {api-request-title}
  34. `DELETE /_snapshot/<repository>/<snapshot>`
  35. [[delete-snapshot-api-prereqs]]
  36. ==== {api-prereq-title}
  37. * If the {es} {security-features} are enabled, you must have the `manage`
  38. <<privileges-list-cluster,cluster privilege>> to use this API.
  39. [[delete-snapshot-api-path-params]]
  40. ==== {api-path-parms-title}
  41. `<repository>`::
  42. (Required, string)
  43. Name of the repository to delete a snapshot from.
  44. `<snapshot>`::
  45. (Required, string)
  46. Comma-separated list of snapshot names to delete. Also accepts wildcards (`*`).
  47. [[delete-snapshot-api-query-params]]
  48. ==== {api-query-parms-title}
  49. include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=master-timeout]
  50. `wait_for_completion`::
  51. (Optional, Boolean) If `true`, the request returns a response when the matching
  52. snapshots are all deleted. If `false`, the request returns a response as soon as
  53. the deletes are scheduled. Defaults to `true`.
  54. [[delete-snapshot-api-example]]
  55. ==== {api-example-title}
  56. The following request deletes `snapshot_2` and `snapshot_3` from the repository named `my_repository`.
  57. [source,console]
  58. ----
  59. DELETE /_snapshot/my_repository/snapshot_2,snapshot_3
  60. ----
  61. The API returns the following response:
  62. [source,console-result]
  63. ----
  64. {
  65. "acknowledged" : true
  66. }
  67. ----