From a07ee6b76abe3ec133b429f66a8249f3cc140b2f Mon Sep 17 00:00:00 2001 From: James Rodewig Date: Thu, 21 May 2020 09:59:06 -0400 Subject: [PATCH 1/3] [DOCS] Add delete snapshot repo API docs Adds API reference docs for the delete snapshot repo API. Also corrects an error in the delete snapshot repo API spec. Comma-separated repository names are not supported. --- .../apis/delete-repo-api.asciidoc | 52 +++++++++++++++++++ .../apis/snapshot-restore-apis.asciidoc | 2 + .../api/snapshot.delete_repository.json | 2 +- 3 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 docs/reference/snapshot-restore/apis/delete-repo-api.asciidoc diff --git a/docs/reference/snapshot-restore/apis/delete-repo-api.asciidoc b/docs/reference/snapshot-restore/apis/delete-repo-api.asciidoc new file mode 100644 index 000000000000..92ee014b64be --- /dev/null +++ b/docs/reference/snapshot-restore/apis/delete-repo-api.asciidoc @@ -0,0 +1,52 @@ +[[delete-snapshot-repo-api]] +=== Delete snapshot repository API +++++ +Delete snapshot repository +++++ + +Deletes one or more <>. + +//// +[source,console] +---- +PUT /_snapshot/my_repository +{ + "type": "fs", + "settings": { + "location": "my_backup_location" + } +} +---- +//// + +[source,console] +---- +DELETE /_snapshot/my_repository +---- +// TEST[continued] + +[[delete-snapshot-repo-api-request]] +==== {api-request-title} + +`DELETE /_snapshot/` + +[[delete-snapshot-repo-api-path-params]] +==== {api-path-parms-title} + +``:: +(Required, string) +Name of the snapshot repository to delete. Wildcard (`*`) patterns are +supported. + +[[delete-snapshot-repo-api-query-params]] +==== {api-query-parms-title} + +`master_timeout`:: +(Optional, <>) Specifies the period of time to wait for +a connection to the master node. If no response is received before the timeout +expires, the request fails and returns an error. Defaults to `30s`. + +`timeout`:: +(Optional, <>) Specifies the period of time to wait for +a response. If no response is received before the timeout expires, the request +fails and returns an error. Defaults to `30s`. diff --git a/docs/reference/snapshot-restore/apis/snapshot-restore-apis.asciidoc b/docs/reference/snapshot-restore/apis/snapshot-restore-apis.asciidoc index 14bfc454bad7..25eae2d4946e 100644 --- a/docs/reference/snapshot-restore/apis/snapshot-restore-apis.asciidoc +++ b/docs/reference/snapshot-restore/apis/snapshot-restore-apis.asciidoc @@ -17,8 +17,10 @@ content may not be included yet. === Snapshot repository management APIs * <> +* <> * <> include::clean-up-repo-api.asciidoc[] +include::delete-repo-api.asciidoc[] include::put-repo-api.asciidoc[] \ No newline at end of file diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.delete_repository.json b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.delete_repository.json index b94c5f39b4f2..aa100b3cc66a 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.delete_repository.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.delete_repository.json @@ -15,7 +15,7 @@ "parts":{ "repository":{ "type":"list", - "description":"A comma-separated list of repository names" + "description":"Name of the snapshot repository to delete. Wildcard (`*`) patterns are supported." } } } From ef2385518e26c754d5205d25e553bf75b74d5014 Mon Sep 17 00:00:00 2001 From: James Rodewig Date: Thu, 21 May 2020 10:41:46 -0400 Subject: [PATCH 2/3] relocate delete repo ex. sync wording. --- .../snapshot-restore/apis/delete-repo-api.asciidoc | 8 ++++++-- .../snapshot-restore/register-repository.asciidoc | 12 ++++++++++++ .../snapshot-restore/take-snapshot.asciidoc | 13 ------------- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/docs/reference/snapshot-restore/apis/delete-repo-api.asciidoc b/docs/reference/snapshot-restore/apis/delete-repo-api.asciidoc index 92ee014b64be..5b518db7e82b 100644 --- a/docs/reference/snapshot-restore/apis/delete-repo-api.asciidoc +++ b/docs/reference/snapshot-restore/apis/delete-repo-api.asciidoc @@ -4,7 +4,11 @@ Delete snapshot repository ++++ -Deletes one or more <>. +Unregisters one or more <>. + +When a repository is unregistered, {es} only removes the reference to the +location where the repository is storing the snapshots. The snapshots themselves +are left untouched and in place. //// [source,console] @@ -35,7 +39,7 @@ DELETE /_snapshot/my_repository ``:: (Required, string) -Name of the snapshot repository to delete. Wildcard (`*`) patterns are +Name of the snapshot repository to unregister. Wildcard (`*`) patterns are supported. [[delete-snapshot-repo-api-query-params]] diff --git a/docs/reference/snapshot-restore/register-repository.asciidoc b/docs/reference/snapshot-restore/register-repository.asciidoc index 85f1c40ebeb5..bd3f6f1630d2 100644 --- a/docs/reference/snapshot-restore/register-repository.asciidoc +++ b/docs/reference/snapshot-restore/register-repository.asciidoc @@ -79,6 +79,18 @@ or GET /_snapshot/_all ----------------------------------- +You can unregister a repository using the <>: + +[source,console] +----------------------------------- +DELETE /_snapshot/my_backup +----------------------------------- + +When a repository is unregistered, {es} only removes the reference to the +location where the repository is storing the snapshots. The snapshots themselves +are left untouched and in place. + [float] [[snapshots-filesystem-repository]] === Shared file system repository diff --git a/docs/reference/snapshot-restore/take-snapshot.asciidoc b/docs/reference/snapshot-restore/take-snapshot.asciidoc index aeeb18ecfc2d..8c8324273098 100644 --- a/docs/reference/snapshot-restore/take-snapshot.asciidoc +++ b/docs/reference/snapshot-restore/take-snapshot.asciidoc @@ -201,16 +201,3 @@ DELETE /_snapshot/my_backup/my_backup,my_fs_backup DELETE /_snapshot/my_backup/snap* ----------------------------------- // TEST[skip:no my_fs_backup] - -A repository can be unregistered using the following command: - -[source,console] ------------------------------------ -DELETE /_snapshot/my_backup ------------------------------------ -// TEST[continued] - -When a repository is unregistered, Elasticsearch only removes the reference to the location where the repository is storing -the snapshots. The snapshots themselves are left untouched and in place. - - From 81038e8b36c477e64b45b34adb15000cfdb399ac Mon Sep 17 00:00:00 2001 From: James Rodewig Date: Thu, 21 May 2020 10:42:49 -0400 Subject: [PATCH 3/3] update json spec --- .../resources/rest-api-spec/api/snapshot.delete_repository.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.delete_repository.json b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.delete_repository.json index aa100b3cc66a..b60aeba83a32 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.delete_repository.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.delete_repository.json @@ -15,7 +15,7 @@ "parts":{ "repository":{ "type":"list", - "description":"Name of the snapshot repository to delete. Wildcard (`*`) patterns are supported." + "description":"Name of the snapshot repository to unregister. Wildcard (`*`) patterns are supported." } } }