From dc56df2d0756401cc7592e84ccc1c91f2d2f5e33 Mon Sep 17 00:00:00 2001 From: Chapuis Bertil Date: Wed, 16 Sep 2015 16:34:29 +0200 Subject: [PATCH] simplified REST documentation --- doc/REST_backend.md | 42 +++++++++++++++++++----------------------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/doc/REST_backend.md b/doc/REST_backend.md index 68e1af638..4bb6785fb 100644 --- a/doc/REST_backend.md +++ b/doc/REST_backend.md @@ -5,51 +5,47 @@ Restic can interact with HTTP Backend that respects the following REST API. ## HEAD /config -Returns "200 OK" if the repository has already been initialized, -"404 repository not found" otherwise. +Returns "200 OK" if the repository has a configuration, +an HTTP error otherwise. ## GET /config -Returns the configuration if the repository has already been initialized, -"404 repository not found" otherwise. +Returns the content of the configuration file if the repository has a configuration, +an HTTP error otherwise. Response format: binary/octet-stream ## POST /config -Saves the configuration transmitted in the request body. -Returns "200 OK" if the configuration has been saved, -"409 repository already initialized" if the repository has already been initialized. - -Response format: text +Returns "200 OK" if the configuration of the request body has been saved, +an HTTP error otherwise. ## GET /{type}/ -Returns a JSON array containing the IDs of all the blobs stored for a given type. +Returns a JSON array containing the names of all the blobs stored for a given type. Response format: JSON -## HEAD /{type}/{blobID} +## HEAD /{type}/{name} -Returns "200 OK" if the repository contains a blob with the given ID and type, -"404 blob not found" otherwise. +Returns "200 OK" if the blob with the given name and type is stored in the repository, +"404 not found" otherwise. -## GET /{type}/{blobID} +## GET /{type}/{name} -Returns the content of the blob with the given ID and type, -"404 blob not found" otherwise. +Returns the content of the blob with the given name and type if it is stored in the repository, +"404 not found" otherwise. Response format: binary/octet-stream -## POST /{type}/{blobID} +## POST /{type}/{name} -Saves the content of the request body in a blob with the given ID and type, -"409 blob already exists" if a blob has already been saved. +Saves the content of the request body as a blob with the given name and type, +an HTTP error otherwise. Request format: binary/octet-stream -## DELETE /{type}/{blobID} +## DELETE /{type}/{name} -Deletes the blob with the given ID and type. -Returns "200 OK" if the given blob exists and has been deleted, -"404 blob not found" otherwise. +Returns "200 OK" if the blob with the given name and type has been deleted from the repository, +an HTTP error otherwise.