1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2025-03-16 00:00:05 +01:00

simplified REST documentation

This commit is contained in:
Chapuis Bertil 2015-09-16 16:34:29 +02:00
parent 8b4af583fd
commit dc56df2d07

View file

@ -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.