|
Server : LiteSpeed System : Linux srv104790275 5.15.0-161-generic #171-Ubuntu SMP Sat Oct 11 08:17:01 UTC 2025 x86_64 User : dewac4139 ( 1077) PHP Version : 8.0.30 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /usr/share/doc/restic/html/ |
Upload File : |
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>REST Backend — restic 0.12.1
documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/restic.css" type="text/css" />
<link rel="shortcut icon" href="_static/favicon.ico"/>
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="index.html" class="icon icon-home"> restic
<img src="_static/logo.png" class="logo" alt="Logo"/>
</a>
<div class="version">
0.12.1
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<ul>
<li class="toctree-l1"><a class="reference internal" href="010_introduction.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="020_installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="030_preparing_a_new_repo.html">Preparing a new repository</a></li>
<li class="toctree-l1"><a class="reference internal" href="040_backup.html">Backing up</a></li>
<li class="toctree-l1"><a class="reference internal" href="045_working_with_repos.html">Working with repositories</a></li>
<li class="toctree-l1"><a class="reference internal" href="050_restore.html">Restoring from backup</a></li>
<li class="toctree-l1"><a class="reference internal" href="060_forget.html">Removing backup snapshots</a></li>
<li class="toctree-l1"><a class="reference internal" href="070_encryption.html">Encryption</a></li>
<li class="toctree-l1"><a class="reference internal" href="075_scripting.html">Scripting</a></li>
<li class="toctree-l1"><a class="reference internal" href="080_examples.html">Examples</a></li>
<li class="toctree-l1"><a class="reference internal" href="090_participating.html">Participating</a></li>
<li class="toctree-l1"><a class="reference internal" href="100_references.html">References</a></li>
<li class="toctree-l1"><a class="reference internal" href="110_talks.html">Talks</a></li>
<li class="toctree-l1"><a class="reference internal" href="faq.html">FAQ</a></li>
<li class="toctree-l1"><a class="reference internal" href="manual_rest.html">Manual</a></li>
<li class="toctree-l1"><a class="reference internal" href="developer_information.html">Developer Information</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">restic</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html" class="icon icon-home"></a> »</li>
<li>REST Backend</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/REST_backend.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="rest-backend">
<h1>REST Backend<a class="headerlink" href="#rest-backend" title="Permalink to this headline">¶</a></h1>
<p>Restic can interact with HTTP Backend that respects the following REST
API.</p>
<p>The following values are valid for <code class="docutils literal notranslate"><span class="pre">{type}</span></code>:</p>
<blockquote>
<div><ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">data</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">keys</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">locks</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">snapshots</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">index</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">config</span></code></p></li>
</ul>
</div></blockquote>
<p>The API version is selected via the <code class="docutils literal notranslate"><span class="pre">Accept</span></code> HTTP header in the request. The
following values are defined:</p>
<blockquote>
<div><ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">application/vnd.x.restic.rest.v1</span></code> or empty: Select API version 1</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">application/vnd.x.restic.rest.v2</span></code>: Select API version 2</p></li>
</ul>
</div></blockquote>
<p>The server will respond with the value of the highest version it supports in
the <code class="docutils literal notranslate"><span class="pre">Content-Type</span></code> HTTP response header for the HTTP requests which should
return JSON. Any different value for this header means API version 1.</p>
<p>The placeholder <code class="docutils literal notranslate"><span class="pre">{path}</span></code> in this document is a path to the repository, so
that multiple different repositories can be accessed. The default path is
<code class="docutils literal notranslate"><span class="pre">/</span></code>. The path must end with a slash.</p>
<section id="post-path-create-true">
<h2>POST {path}?create=true<a class="headerlink" href="#post-path-create-true" title="Permalink to this headline">¶</a></h2>
<p>This request is used to initially create a new repository. The server
responds with “200 OK” if the repository structure was created
successfully or already exists, otherwise an error is returned.</p>
</section>
<section id="delete-path">
<h2>DELETE {path}<a class="headerlink" href="#delete-path" title="Permalink to this headline">¶</a></h2>
<p>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”.</p>
</section>
<section id="head-path-config">
<h2>HEAD {path}/config<a class="headerlink" href="#head-path-config" title="Permalink to this headline">¶</a></h2>
<p>Returns “200 OK” if the repository has a configuration, an HTTP error
otherwise.</p>
</section>
<section id="get-path-config">
<h2>GET {path}/config<a class="headerlink" href="#get-path-config" title="Permalink to this headline">¶</a></h2>
<p>Returns the content of the configuration file if the repository has a
configuration, an HTTP error otherwise.</p>
<p>Response format: binary/octet-stream</p>
</section>
<section id="post-path-config">
<h2>POST {path}/config<a class="headerlink" href="#post-path-config" title="Permalink to this headline">¶</a></h2>
<p>Returns “200 OK” if the configuration of the request body has been
saved, an HTTP error otherwise.</p>
</section>
<section id="get-path-type">
<h2>GET {path}/{type}/<a class="headerlink" href="#get-path-type" title="Permalink to this headline">¶</a></h2>
<section id="api-version-1">
<h3>API version 1<a class="headerlink" href="#api-version-1" title="Permalink to this headline">¶</a></h3>
<p>Returns a JSON array containing the names of all the blobs stored for a given
type, example:</p>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">[</span><span class="w"></span>
<span class="w"> </span><span class="s2">"245bc4c430d393f74fbe7b13325e30dbde9fb0745e50caad57c446c93d20096b"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="s2">"85b420239efa1132c41cea0065452a40ebc20c6f8e0b132a5b2f5848360973ec"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="s2">"8e2006bb5931a520f3c7009fe278d1ebb87eb72c3ff92a50c30e90f1b8cf3e60"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="s2">"e75c8c407ea31ba399ab4109f28dd18c4c68303d8d86cc275432820c42ce3649"</span><span class="w"></span>
<span class="p">]</span><span class="w"></span>
</pre></div>
</div>
</section>
<section id="api-version-2">
<h3>API version 2<a class="headerlink" href="#api-version-2" title="Permalink to this headline">¶</a></h3>
<p>Returns a JSON array containing an object for each file of the given type. The
objects have two keys: <code class="docutils literal notranslate"><span class="pre">name</span></code> for the file name, and <code class="docutils literal notranslate"><span class="pre">size</span></code> for the size in
bytes.</p>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">[</span><span class="w"></span>
<span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w"> </span><span class="nt">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"245bc4c430d393f74fbe7b13325e30dbde9fb0745e50caad57c446c93d20096b"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"size"</span><span class="p">:</span><span class="w"> </span><span class="mi">2341058</span><span class="w"></span>
<span class="w"> </span><span class="p">},</span><span class="w"></span>
<span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w"> </span><span class="nt">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"85b420239efa1132c41cea0065452a40ebc20c6f8e0b132a5b2f5848360973ec"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"size"</span><span class="p">:</span><span class="w"> </span><span class="mi">2908900</span><span class="w"></span>
<span class="w"> </span><span class="p">},</span><span class="w"></span>
<span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w"> </span><span class="nt">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"8e2006bb5931a520f3c7009fe278d1ebb87eb72c3ff92a50c30e90f1b8cf3e60"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"size"</span><span class="p">:</span><span class="w"> </span><span class="mi">3030712</span><span class="w"></span>
<span class="w"> </span><span class="p">},</span><span class="w"></span>
<span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w"> </span><span class="nt">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"e75c8c407ea31ba399ab4109f28dd18c4c68303d8d86cc275432820c42ce3649"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"size"</span><span class="p">:</span><span class="w"> </span><span class="mi">2804</span><span class="w"></span>
<span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="p">]</span><span class="w"></span>
</pre></div>
</div>
</section>
</section>
<section id="head-path-type-name">
<h2>HEAD {path}/{type}/{name}<a class="headerlink" href="#head-path-type-name" title="Permalink to this headline">¶</a></h2>
<p>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 <code class="docutils literal notranslate"><span class="pre">Content-Length</span></code> is set to the file size.</p>
</section>
<section id="get-path-type-name">
<h2>GET {path}/{type}/{name}<a class="headerlink" href="#get-path-type-name" title="Permalink to this headline">¶</a></h2>
<p>Returns the content of the blob with the given name and type if it is
stored in the repository, “404 not found” otherwise.</p>
<p>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.</p>
<p>Response format: binary/octet-stream</p>
</section>
<section id="post-path-type-name">
<h2>POST {path}/{type}/{name}<a class="headerlink" href="#post-path-type-name" title="Permalink to this headline">¶</a></h2>
<p>Saves the content of the request body as a blob with the given name and
type, an HTTP error otherwise.</p>
<p>Request format: binary/octet-stream</p>
</section>
<section id="delete-path-type-name">
<h2>DELETE {path}/{type}/{name}<a class="headerlink" href="#delete-path-type-name" title="Permalink to this headline">¶</a></h2>
<p>Returns “200 OK” if the blob with the given name and type has been
deleted from the repository, an HTTP error otherwise.</p>
</section>
</section>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>© Copyright 2024, restic authors.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>