Skip to content

Commit e68a2ec

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 902f0cd commit e68a2ec

File tree

5 files changed

+71
-14
lines changed

5 files changed

+71
-14
lines changed
Lines changed: 56 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 12 additions & 0 deletions
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

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -192,16 +192,3 @@ snapshot and not used by any other snapshots. If the deleted snapshot operation
192192
created the snapshotting process will be aborted and all files created as part of the snapshotting process will be
193193
cleaned. Therefore, the delete snapshot operation can be used to cancel long running snapshot operations that were
194194
started by mistake.
195-
196-
A repository can be unregistered using the following command:
197-
198-
[source,console]
199-
-----------------------------------
200-
DELETE /_snapshot/my_backup
201-
-----------------------------------
202-
// TEST[continued]
203-
204-
When a repository is unregistered, Elasticsearch only removes the reference to the location where the repository is storing
205-
the snapshots. The snapshots themselves are left untouched and in place.
206-
207-

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

Lines changed: 1 addition & 1 deletion
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)