Skip to content

Commit 9c77862

Browse files
author
Adam Locke
authored
[7.x] [DOCS] Adding delete snapshot API docs. (#58865) (#58871)
* [DOCS] Adding delete snapshot API docs. * Adding TESTSETUP snippets and fixing original TEST. * Removing extraneous TESTSETUP. * Revising <snapshot> description. * Removing TEST. * Streamline delete API description. * Improve TESTSETUP for snippets.
1 parent 1fcaec7 commit 9c77862

File tree

2 files changed

+89
-8
lines changed

2 files changed

+89
-8
lines changed
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
[[delete-snapshot-api]]
2+
=== Delete snapshot API
3+
++++
4+
<titleabbrev>Delete snapshot</titleabbrev>
5+
++++
6+
7+
Deletes a <<snapshot-restore,snapshot>>.
8+
9+
////
10+
[source,console]
11+
----
12+
PUT /_snapshot/my_repository
13+
{
14+
"type": "fs",
15+
"settings": {
16+
"location": "my_backup_location"
17+
}
18+
}
19+
20+
PUT /_snapshot/my_repository/my_snapshot?wait_for_completion=true
21+
22+
PUT /_snapshot/my_repository/snapshot_2?wait_for_completion=true
23+
24+
PUT /_snapshot/my_repository/snapshot_3?wait_for_completion=true
25+
----
26+
// TESTSETUP
27+
////
28+
29+
[source,console]
30+
-----------------------------------
31+
DELETE /_snapshot/my_repository/my_snapshot
32+
-----------------------------------
33+
34+
[[delete-snapshot-api-request]]
35+
==== {api-request-title}
36+
37+
`DELETE /_snapshot/<repository>/<snapshot>`
38+
39+
[[delete-snapshot-api-desc]]
40+
==== {api-description-title}
41+
42+
Use the delete snapshot API to delete a <<snapshot-restore,snapshot>>, which is a backup taken from a running {es} cluster.
43+
44+
When deleting a snapshot from a repository, {es} deletes all files that are associated with the snapshot and not used by any other snapshots. All files that are shared with at least one other existing snapshot are left intact.
45+
46+
If you attempt to delete a snapshot while it is being created, the snapshot process aborts and all associated will be deleted.
47+
48+
To delete multiple snapshots in a single request, separate the snapshot names with a comma or use a wildcard (`*`).
49+
50+
TIP: Use the delete snapshot API to cancel long-running snapshot operations that were started by mistake.
51+
52+
[[delete-snapshot-api-path-params]]
53+
==== {api-path-parms-title}
54+
55+
`<repository>`::
56+
(Required, string)
57+
Name of the repository to delete a snapshot from.
58+
59+
`<snapshot>`::
60+
(Required, string)
61+
Comma-separated list of snapshot names to delete. Also accepts wildcards (`*`).
62+
63+
[[delete-snapshot-api-example]]
64+
==== {api-example-title}
65+
66+
The following request deletes `snapshot_2` and `snapshot_3` from the repository named `my_repository`.
67+
68+
[source,console]
69+
----
70+
DELETE /_snapshot/my_repository/snapshot_2,snapshot_3
71+
----
72+
73+
The API returns the following response:
74+
75+
[source,console-result]
76+
----
77+
{
78+
"acknowledged" : true
79+
}
80+
----

docs/reference/snapshot-restore/apis/snapshot-restore-apis.asciidoc

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,22 @@ content may not be included yet.
1515
[discrete]
1616
[[snapshot-restore-repo-apis]]
1717
=== Snapshot repository management APIs
18-
19-
* <<clean-up-snapshot-repo-api,Clean up snapshot repository>>
20-
* <<delete-snapshot-repo-api,Delete snapshot repository>>
21-
* <<get-snapshot-repo-api,Get snapshot repository>>
2218
* <<put-snapshot-repo-api,Put snapshot repository>>
2319
* <<verify-snapshot-repo-api,Verify snapshot repository>>
20+
* <<get-snapshot-repo-api,Get snapshot repository>>
21+
* <<delete-snapshot-repo-api,Delete snapshot repository>>
22+
* <<clean-up-snapshot-repo-api,Clean up snapshot repository>>
2423

2524
[discrete]
2625
[[snapshot-management-apis]]
2726
=== Snapshot management APIs
2827
* <<create-snapshot-api,Create snapshot>>
28+
* <<delete-snapshot-api,Delete snapshot>>
2929

30-
include::create-snapshot-api.asciidoc[]
31-
include::clean-up-repo-api.asciidoc[]
32-
include::delete-repo-api.asciidoc[]
33-
include::get-repo-api.asciidoc[]
3430
include::put-repo-api.asciidoc[]
3531
include::verify-repo-api.asciidoc[]
32+
include::get-repo-api.asciidoc[]
33+
include::delete-repo-api.asciidoc[]
34+
include::clean-up-repo-api.asciidoc[]
35+
include::create-snapshot-api.asciidoc[]
36+
include::delete-snapshot-api.asciidoc[]

0 commit comments

Comments
 (0)