]> git.proxmox.com Git - proxmox-backup.git/blame - docs/backup-protocol.rst
tape: add namespaces/recursion depth to tape backup jobs
[proxmox-backup.git] / docs / backup-protocol.rst
CommitLineData
177db84b
DM
1Backup Protocol
2===============
3
2bc1250c
DW
4Proxmox Backup Server uses a REST-based API. While the management
5interface uses normal HTTP, the actual backup and restore interface uses
7eb9f484 6HTTP/2 for improved performance. Both HTTP and HTTP/2 are well known
2bc1250c 7standards, so the following section assumes that you are familiar with
7eb9f484 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
2bc1250c 16``proxmox-backup-protocol-v1`` as the protocol name::
7eb9f484
DM
17
18 GET /api2/json/backup HTTP/1.1
19 UPGRADE: proxmox-backup-protocol-v1
20
2bc1250c
DW
21The server replies with the ``HTTP 101 Switching Protocol`` status code,
22and you can then issue REST commands on the 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
2bc1250c 28- Fixed indexes (List of chunks with fixed size)
50066325 29
2bc1250c 30- Dynamic indexes (List of chunks with variable size)
50066325 31
2bc1250c 32The following section provides a short introduction on how to upload such
50066325 33files. Please use the `API Viewer <api-viewer/index.html>`_ for
2bc1250c 34details about the available REST commands.
50066325
DM
35
36
37Upload Blobs
38~~~~~~~~~~~~
39
2bc1250c
DW
40Blobs are uploaded using ``POST /blob``. The HTTP body contains the
41data encoded as :ref:`Data Blob <data-blob-format>`.
50066325 42
2bc1250c
DW
43The file name must end with ``.blob``, and is automatically added
44to the backup manifest, following the call to ``POST /finish``.
50066325
DM
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
2bc1250c 59Fixed indexes are used to store VM image data. The VM image is split
50066325 60into equally sized chunks, which are uploaded individually. The index
2bc1250c 61file simply contains a list of chunk digests.
50066325 62
2bc1250c 63You create a fixed index with ``POST /fixed_index``. Then, upload
50066325
DM
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
2bc1250c 69to the backup manifest, following the call to ``POST /finish``.
50066325
DM
70
71
72Upload Dynamic Indexes
73~~~~~~~~~~~~~~~~~~~~~~
74
2bc1250c 75Dynamic indexes are used to store file archive data. The archive data
50066325 76is split into dynamically sized chunks, which are uploaded
2bc1250c 77individually. The index file simply contains a list of chunk digests
50066325
DM
78and offsets.
79
2bc1250c 80You can create a dynamically sized index with ``POST /dynamic_index``. Then,
50066325
DM
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
2bc1250c
DW
85The filename needs to end with ``.didx``, and is automatically added
86to the backup manifest, following the call to ``POST /finish``.
87
50066325
DM
88
89Finish Backup
90~~~~~~~~~~~~~
91
2bc1250c
DW
92Once you have uploaded all data, you need to call ``POST /finish``. This
93commits all data and ends the backup protocol.
7eb9f484
DM
94
95
96Restore/Reader Protocol API
97---------------------------
98
99To start a new reader, the API call ``GET /api2/json/reader`` needs to
100be upgraded to a HTTP/2 connection using
101``proxmox-backup-reader-protocol-v1`` as protocol name::
102
103 GET /api2/json/reader HTTP/1.1
104 UPGRADE: proxmox-backup-reader-protocol-v1
105
2bc1250c 106The server replies with the ``HTTP 101 Switching Protocol`` status code,
50066325
DM
107and you can then issue REST commands on that updated HTTP/2 connection.
108
2bc1250c 109The reader protocol allows you to download three different kinds of files:
50066325
DM
110
111- Chunks and blobs (binary data)
112
2bc1250c 113- Fixed indexes (list of chunks with fixed size)
50066325 114
2bc1250c 115- Dynamic indexes (list of chunks with variable size)
7eb9f484 116
2bc1250c 117The following section provides a short introduction on how to download such
50066325 118files. Please use the `API Viewer <api-viewer/index.html>`_ for details about
2bc1250c 119the available REST commands.
50066325
DM
120
121
122Download Blobs
123~~~~~~~~~~~~~~
124
2bc1250c 125Blobs are downloaded using ``GET /download``. The HTTP body contains the
ec07a280 126data encoded as :ref:`Data Blob <data-blob-format>`.
50066325
DM
127
128
129Download Chunks
130~~~~~~~~~~~~~~~
131
2bc1250c
DW
132Chunks are downloaded using ``GET /chunk``. The HTTP body contains the
133data encoded as :ref:`Data Blob <data-blob-format>`.
50066325
DM
134
135
136Download Index Files
137~~~~~~~~~~~~~~~~~~~~
138
2bc1250c 139Index files are downloaded using ``GET /download``. The HTTP body
b488f850
DM
140contains the data encoded as :ref:`Fixed Index <fixed-index-format>`
141or :ref:`Dynamic Index <dynamic-index-format>`.