mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-25 07:37:19 -04:00
89 lines
2 KiB
Text
89 lines
2 KiB
Text
[[delete-snapshot-api]]
|
|
=== Delete snapshot API
|
|
++++
|
|
<titleabbrev>Delete snapshot</titleabbrev>
|
|
++++
|
|
|
|
.New API reference
|
|
[sidebar]
|
|
--
|
|
For the most up-to-date API details, refer to {api-es}/group/endpoint-snapshot[Snapshot and restore APIs].
|
|
--
|
|
|
|
Deletes a <<snapshot-restore,snapshot>>.
|
|
|
|
////
|
|
[source,console]
|
|
----
|
|
PUT /_snapshot/my_repository
|
|
{
|
|
"type": "fs",
|
|
"settings": {
|
|
"location": "my_backup_location"
|
|
}
|
|
}
|
|
|
|
PUT /_snapshot/my_repository/my_snapshot?wait_for_completion=true
|
|
|
|
PUT /_snapshot/my_repository/snapshot_2?wait_for_completion=true
|
|
|
|
PUT /_snapshot/my_repository/snapshot_3?wait_for_completion=true
|
|
----
|
|
// TESTSETUP
|
|
////
|
|
|
|
[source,console]
|
|
-----------------------------------
|
|
DELETE /_snapshot/my_repository/my_snapshot
|
|
-----------------------------------
|
|
|
|
[[delete-snapshot-api-request]]
|
|
==== {api-request-title}
|
|
|
|
`DELETE /_snapshot/<repository>/<snapshot>`
|
|
|
|
[[delete-snapshot-api-prereqs]]
|
|
==== {api-prereq-title}
|
|
|
|
* If the {es} {security-features} are enabled, you must have the `manage`
|
|
<<privileges-list-cluster,cluster privilege>> to use this API.
|
|
|
|
[[delete-snapshot-api-path-params]]
|
|
==== {api-path-parms-title}
|
|
|
|
`<repository>`::
|
|
(Required, string)
|
|
Name of the repository to delete a snapshot from.
|
|
|
|
`<snapshot>`::
|
|
(Required, string)
|
|
Comma-separated list of snapshot names to delete. Also accepts wildcards (`*`).
|
|
|
|
[[delete-snapshot-api-query-params]]
|
|
==== {api-query-parms-title}
|
|
|
|
include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=master-timeout]
|
|
|
|
`wait_for_completion`::
|
|
(Optional, Boolean) If `true`, the request returns a response when the matching
|
|
snapshots are all deleted. If `false`, the request returns a response as soon as
|
|
the deletes are scheduled. Defaults to `true`.
|
|
|
|
[[delete-snapshot-api-example]]
|
|
==== {api-example-title}
|
|
|
|
The following request deletes `snapshot_2` and `snapshot_3` from the repository named `my_repository`.
|
|
|
|
[source,console]
|
|
----
|
|
DELETE /_snapshot/my_repository/snapshot_2,snapshot_3
|
|
----
|
|
|
|
The API returns the following response:
|
|
|
|
[source,console-result]
|
|
----
|
|
{
|
|
"acknowledged" : true
|
|
}
|
|
----
|