Skip to content

Commit b3426dd

Browse files
authored
[DOCS] Add delete snapshot repo API docs (#57043)
Changes: * Adds API reference docs for the delete snapshot repo API. * Corrects an error in the delete snapshot repo API spec. Comma-separated repository names are not supported. * Relocates the existing delete snapshot repo API example docs.
1 parent a2de43d commit b3426dd

File tree

5 files changed

+71
-14
lines changed

5 files changed

+71
-14
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
[[delete-snapshot-repo-api]]
2+
=== Delete snapshot repository API
3+
++++
4+
<titleabbrev>Delete snapshot repository</titleabbrev>
5+
++++
6+
7+
Unregisters one or more <<snapshots-register-repository,snapshot repositories>>.
8+
9+
When a repository is unregistered, {es} only removes the reference to the
10+
location where the repository is storing the snapshots. The snapshots themselves
11+
are left untouched and in place.
12+
13+
////
14+
[source,console]
15+
----
16+
PUT /_snapshot/my_repository
17+
{
18+
"type": "fs",
19+
"settings": {
20+
"location": "my_backup_location"
21+
}
22+
}
23+
----
24+
////
25+
26+
[source,console]
27+
----
28+
DELETE /_snapshot/my_repository
29+
----
30+
// TEST[continued]
31+
32+
[[delete-snapshot-repo-api-request]]
33+
==== {api-request-title}
34+
35+
`DELETE /_snapshot/<repository>`
36+
37+
[[delete-snapshot-repo-api-path-params]]
38+
==== {api-path-parms-title}
39+
40+
`<repository>`::
41+
(Required, string)
42+
Name of the snapshot repository to unregister. Wildcard (`*`) patterns are
43+
supported.
44+
45+
[[delete-snapshot-repo-api-query-params]]
46+
==== {api-query-parms-title}
47+
48+
`master_timeout`::
49+
(Optional, <<time-units, time units>>) Specifies the period of time to wait for
50+
a connection to the master node. If no response is received before the timeout
51+
expires, the request fails and returns an error. Defaults to `30s`.
52+
53+
`timeout`::
54+
(Optional, <<time-units, time units>>) Specifies the period of time to wait for
55+
a response. If no response is received before the timeout expires, the request
56+
fails and returns an error. Defaults to `30s`.

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

+2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ content may not be included yet.
1717
=== Snapshot repository management APIs
1818

1919
* <<clean-up-snapshot-repo-api,Clean up snapshot repository>>
20+
* <<delete-snapshot-repo-api,Delete snapshot repository>>
2021
* <<put-snapshot-repo-api,Put snapshot repository>>
2122

2223

2324
include::clean-up-repo-api.asciidoc[]
25+
include::delete-repo-api.asciidoc[]
2426
include::put-repo-api.asciidoc[]

docs/reference/snapshot-restore/register-repository.asciidoc

+12
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,18 @@ or
7979
GET /_snapshot/_all
8080
-----------------------------------
8181

82+
You can unregister a repository using the <<delete-snapshot-repo-api,delete
83+
snapshot repository API>>:
84+
85+
[source,console]
86+
-----------------------------------
87+
DELETE /_snapshot/my_backup
88+
-----------------------------------
89+
90+
When a repository is unregistered, {es} only removes the reference to the
91+
location where the repository is storing the snapshots. The snapshots themselves
92+
are left untouched and in place.
93+
8294
[float]
8395
[[snapshots-filesystem-repository]]
8496
=== Shared file system repository

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

-13
Original file line numberDiff line numberDiff line change
@@ -201,16 +201,3 @@ DELETE /_snapshot/my_backup/my_backup,my_fs_backup
201201
DELETE /_snapshot/my_backup/snap*
202202
-----------------------------------
203203
// TEST[skip:no my_fs_backup]
204-
205-
A repository can be unregistered using the following command:
206-
207-
[source,console]
208-
-----------------------------------
209-
DELETE /_snapshot/my_backup
210-
-----------------------------------
211-
// TEST[continued]
212-
213-
When a repository is unregistered, Elasticsearch only removes the reference to the location where the repository is storing
214-
the snapshots. The snapshots themselves are left untouched and in place.
215-
216-

rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.delete_repository.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"parts":{
1616
"repository":{
1717
"type":"list",
18-
"description":"A comma-separated list of repository names"
18+
"description":"Name of the snapshot repository to unregister. Wildcard (`*`) patterns are supported."
1919
}
2020
}
2121
}

0 commit comments

Comments
 (0)