From 1a538509d0232f1a532266e07da509875fe9e0d6 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sat, 28 Jan 2017 10:31:44 +0100 Subject: [PATCH 1/3] Document creating a new repo via REST Closes #736 --- doc/REST_backend.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/REST_backend.md b/doc/REST_backend.md index 78a3fd4eb..095926a5a 100644 --- a/doc/REST_backend.md +++ b/doc/REST_backend.md @@ -6,6 +6,13 @@ following values are valid for `{type}`: `data`, `keys`, `locks`, `snapshots`, `index`, `config`. `{path}` is a path to the repository, so that multiple different repositories can be accessed. The default path is `/`. +## POST {path}?create=true + +This request is used to initially create a new repository. The server responds +with "200 OK" if the repository structure was created successfully, otherwise +an error is returned. If the repo already exists, the HTTP error "409 Conflict" +is returned. + ## HEAD {path}/config Returns "200 OK" if the repository has a configuration, From f806d8818d7c37ef1bc9d232e47044d0727f5326 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sun, 29 Jan 2017 10:55:47 +0100 Subject: [PATCH 2/3] Add DELETE --- doc/REST_backend.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/REST_backend.md b/doc/REST_backend.md index 095926a5a..3a65dded3 100644 --- a/doc/REST_backend.md +++ b/doc/REST_backend.md @@ -13,6 +13,13 @@ with "200 OK" if the repository structure was created successfully, otherwise an error is returned. If the repo already exists, the HTTP error "409 Conflict" is returned. +## DELETE {path} + +Deletes the repository on the server side. The server responds with "200 OK" if +the repository was successfully removed. If this function is not implemented +the server returns "501 Not Implemented", if this it is denied by the server it +returns "403 Forbidden". + ## HEAD {path}/config Returns "200 OK" if the repository has a configuration, From 7e9bfa51e9fab142515eb2051024cc4f90c8774c Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Mon, 30 Jan 2017 19:33:17 +0100 Subject: [PATCH 3/3] REST: Make create repository idempotent --- doc/REST_backend.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/REST_backend.md b/doc/REST_backend.md index 3a65dded3..6423d95b0 100644 --- a/doc/REST_backend.md +++ b/doc/REST_backend.md @@ -9,9 +9,8 @@ different repositories can be accessed. The default path is `/`. ## POST {path}?create=true This request is used to initially create a new repository. The server responds -with "200 OK" if the repository structure was created successfully, otherwise -an error is returned. If the repo already exists, the HTTP error "409 Conflict" -is returned. +with "200 OK" if the repository structure was created successfully or already +exists, otherwise an error is returned. ## DELETE {path}