]> git.proxmox.com Git - proxmox-backup.git/blame - docs/backup-protocol.rst
tests: move pxar test to its crate
[proxmox-backup.git] / docs / backup-protocol.rst
CommitLineData
177db84b
DM
1Backup Protocol
2===============
3
7eb9f484
DM
4Proxmox Backup Server uses a REST based API. While the management
5interface use normal HTTP, the actual backup and restore interface use
6HTTP/2 for improved performance. Both HTTP and HTTP/2 are well known
7standards, so the following section assumes that you are familiar on
8how to use them.
45cc157f 9
7eb9f484
DM
10
11Backup Protocol API
12-------------------
13
14To start a new backup, the API call ``GET /api2/json/backup`` needs to
15be upgraded to a HTTP/2 connection using
16``proxmox-backup-protocol-v1`` as protocol name::
17
18 GET /api2/json/backup HTTP/1.1
19 UPGRADE: proxmox-backup-protocol-v1
20
21The server replies with HTTP 101 Switching Protocol status code,
50066325 22and you can then issue REST commands on that updated HTTP/2 connection.
7eb9f484 23
50066325
DM
24The backup protocol allows you to upload three different kind of files:
25
26- Chunks and blobs (binary data)
27
28- Fixed Indexes (List of chunks with fixed size)
29
30- Dynamic Indexes (List of chunk with variable size)
31
32The following section gives a short introduction how to upload such
33files. Please use the `API Viewer <api-viewer/index.html>`_ for
34details about available REST commands.
35
36
37Upload Blobs
38~~~~~~~~~~~~
39
40Uploading blobs is done using ``POST /blob``. The HTTP body contains the
ec07a280 41data encoded as :ref:`Data Blob <data-blob-format>`).
50066325
DM
42
43The file name needs to end with ``.blob``, and is automatically added
44to the backup manifest.
45
46
47Upload Chunks
48~~~~~~~~~~~~~
49
50Chunks belong to an index, so you first need to open an index (see
51below). After that, you can upload chunks using ``POST /fixed_chunk``
52and ``POST /dynamic_chunk``. The HTTP body contains the chunk data
ec07a280 53encoded as :ref:`Data Blob <data-blob-format>`).
50066325
DM
54
55
56Upload Fixed Indexes
57~~~~~~~~~~~~~~~~~~~~
58
59Fixed indexes are use to store VM image data. The VM image is split
60into equally sized chunks, which are uploaded individually. The index
61file simply contains a list to chunk digests.
62
63You create a fixed index with ``POST /fixed_index``. Then upload
64chunks with ``POST /fixed_chunk``, and append them to the index with
65``PUT /fixed_index``. When finished, you need to close the index using
66``POST /fixed_close``.
67
68The file name needs to end with ``.fidx``, and is automatically added
69to the backup manifest.
70
71
72Upload Dynamic Indexes
73~~~~~~~~~~~~~~~~~~~~~~
74
75Dynamic indexes are use to store file archive data. The archive data
76is split into dynamically sized chunks, which are uploaded
77individually. The index file simply contains a list to chunk digests
78and offsets.
79
80You create a dynamic sized index with ``POST /dynamic_index``. Then
81upload chunks with ``POST /dynamic_chunk``, and append them to the index with
82``PUT /dynamic_index``. When finished, you need to close the index using
83``POST /dynamic_close``.
84
85The file name needs to end with ``.didx``, and is automatically added
86to the backup manifest.
87
88Finish Backup
89~~~~~~~~~~~~~
90
91Once you have uploaded all data, you need to call ``POST
92/finish``. This commits all data and ends the backup protocol.
7eb9f484
DM
93
94
95Restore/Reader Protocol API
96---------------------------
97
98To start a new reader, the API call ``GET /api2/json/reader`` needs to
99be upgraded to a HTTP/2 connection using
100``proxmox-backup-reader-protocol-v1`` as protocol name::
101
102 GET /api2/json/reader HTTP/1.1
103 UPGRADE: proxmox-backup-reader-protocol-v1
104
105The server replies with HTTP 101 Switching Protocol status code,
50066325
DM
106and you can then issue REST commands on that updated HTTP/2 connection.
107
108The reader protocol allows you to download three different kind of files:
109
110- Chunks and blobs (binary data)
111
112- Fixed Indexes (List of chunks with fixed size)
113
114- Dynamic Indexes (List of chunk with variable size)
7eb9f484 115
50066325
DM
116The following section gives a short introduction how to download such
117files. Please use the `API Viewer <api-viewer/index.html>`_ for details about
7eb9f484 118available REST commands.
50066325
DM
119
120
121Download Blobs
122~~~~~~~~~~~~~~
123
124Downloading blobs is done using ``GET /download``. The HTTP body contains the
ec07a280 125data encoded as :ref:`Data Blob <data-blob-format>`.
50066325
DM
126
127
128Download Chunks
129~~~~~~~~~~~~~~~
130
131Downloading chunks is done using ``GET /chunk``. The HTTP body contains the
ec07a280 132data encoded as :ref:`Data Blob <data-blob-format>`).
50066325
DM
133
134
135Download Index Files
136~~~~~~~~~~~~~~~~~~~~
137
138Downloading index files is done using ``GET /download``. The HTTP body
b488f850
DM
139contains the data encoded as :ref:`Fixed Index <fixed-index-format>`
140or :ref:`Dynamic Index <dynamic-index-format>`.