2016-02-20 21:05:48 +00:00
|
|
|
REST Backend
|
|
|
|
============
|
|
|
|
|
2016-02-21 15:51:27 +00:00
|
|
|
Restic can interact with HTTP Backend that respects the following REST API. The
|
|
|
|
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 `/`.
|
2016-02-20 21:05:48 +00:00
|
|
|
|
2017-01-28 09:31:44 +00:00
|
|
|
## POST {path}?create=true
|
|
|
|
|
|
|
|
This request is used to initially create a new repository. The server responds
|
2017-01-30 18:33:17 +00:00
|
|
|
with "200 OK" if the repository structure was created successfully or already
|
|
|
|
exists, otherwise an error is returned.
|
2017-01-28 09:31:44 +00:00
|
|
|
|
2017-01-29 09:55:47 +00:00
|
|
|
## 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".
|
|
|
|
|
2016-02-21 15:51:27 +00:00
|
|
|
## HEAD {path}/config
|
2016-02-20 21:05:48 +00:00
|
|
|
|
|
|
|
Returns "200 OK" if the repository has a configuration,
|
|
|
|
an HTTP error otherwise.
|
|
|
|
|
2016-02-21 15:51:27 +00:00
|
|
|
## GET {path}/config
|
2016-02-20 21:05:48 +00:00
|
|
|
|
|
|
|
Returns the content of the configuration file if the repository has a configuration,
|
|
|
|
an HTTP error otherwise.
|
|
|
|
|
|
|
|
Response format: binary/octet-stream
|
|
|
|
|
2016-02-21 15:51:27 +00:00
|
|
|
## POST {path}/config
|
2016-02-20 21:05:48 +00:00
|
|
|
|
|
|
|
Returns "200 OK" if the configuration of the request body has been saved,
|
|
|
|
an HTTP error otherwise.
|
|
|
|
|
2016-02-21 15:51:27 +00:00
|
|
|
## GET {path}/{type}/
|
2016-02-20 21:05:48 +00:00
|
|
|
|
|
|
|
Returns a JSON array containing the names of all the blobs stored for a given type.
|
|
|
|
|
|
|
|
Response format: JSON
|
|
|
|
|
2016-02-21 15:51:27 +00:00
|
|
|
## HEAD {path}/{type}/{name}
|
2016-02-20 21:05:48 +00:00
|
|
|
|
|
|
|
Returns "200 OK" if the blob with the given name and type is stored in the repository,
|
|
|
|
"404 not found" otherwise. If the blob exists, the HTTP header `Content-Length`
|
|
|
|
is set to the file size.
|
|
|
|
|
2016-02-21 15:51:27 +00:00
|
|
|
## GET {path}/{type}/{name}
|
2016-02-20 21:05:48 +00:00
|
|
|
|
|
|
|
Returns the content of the blob with the given name and type if it is stored in the repository,
|
|
|
|
"404 not found" otherwise.
|
|
|
|
|
|
|
|
If the request specifies a partial read with a Range header field,
|
|
|
|
then the status code of the response is 206 instead of 200
|
|
|
|
and the response only contains the specified range.
|
|
|
|
|
|
|
|
Response format: binary/octet-stream
|
|
|
|
|
2016-02-21 15:51:27 +00:00
|
|
|
## POST {path}/{type}/{name}
|
2016-02-20 21:05:48 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2016-02-21 15:51:27 +00:00
|
|
|
## DELETE {path}/{type}/{name}
|
2016-02-20 21:05:48 +00:00
|
|
|
|
|
|
|
Returns "200 OK" if the blob with the given name and type has been deleted from the repository,
|
|
|
|
an HTTP error otherwise.
|