Debian Codegraph @

upstream/debian-trixie/man5/org.freedesktop.import1.5

raw
1 '\" t
2 .TH "ORG\&.FREEDESKTOP\&.IMPORT1" "5" "" "systemd 257.13" "org.freedesktop.import1"
3 .\" -----------------------------------------------------------------
4 .\" * Define some portability stuff
5 .\" -----------------------------------------------------------------
6 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 .\" http://bugs.debian.org/507673
8 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10 .ie \n(.g .ds Aq \(aq
11 .el .ds Aq '
12 .\" -----------------------------------------------------------------
13 .\" * set default formatting
14 .\" -----------------------------------------------------------------
15 .\" disable hyphenation
16 .nh
17 .\" disable justification (adjust text to left margin only)
18 .ad l
19 .\" -----------------------------------------------------------------
20 .\" * MAIN CONTENT STARTS HERE *
21 .\" -----------------------------------------------------------------
22 .SH "NAME"
23 org.freedesktop.import1 \- The D\-Bus interface of systemd\-importd
24 .SH "INTRODUCTION"
25 .PP
26 \fBsystemd-importd.service\fR(8)
27 is a system service which may be used to import, export and download disk images\&. These images can be used by tools such as
28 \fBsystemd-nspawn\fR(1)
29 to run local containers\&. The service is used as the backend for
30 \fBimportctl pull\-raw\fR,
31 \fBimportctl pull\-tar\fR
32 and related commands\&. This page describes the D\-Bus interface\&.
33 .PP
34 Note that
35 \fBsystemd-importd.service\fR(8)
36 is mostly a small companion service for
37 \fBsystemd-machined.service\fR(8)\&. Many operations to manipulate local container and VM images are hence available via the
38 \fBsystemd\-machined\fR
39 D\-Bus API, c\&.f\&.
40 \fBorg.freedesktop.machine1\fR(5)\&.
41 .SH "THE MANAGER OBJECT"
42 .PP
43 The service exposes the following interfaces on the Manager object on the bus:
44 .sp
45 .if n \{\
46 .RS 4
47 .\}
48 .nf
49 node /org/freedesktop/import1 {
50 interface org\&.freedesktop\&.import1\&.Manager {
51 methods:
52 ImportTar(in h fd,
53 in s local_name,
54 in b force,
55 in b read_only,
56 out u transfer_id,
57 out o transfer_path);
58 ImportTarEx(in h fd,
59 in s local_name,
60 in s class,
61 in t flags,
62 out u transfer_id,
63 out o transfer_path);
64 ImportRaw(in h fd,
65 in s local_name,
66 in b force,
67 in b read_only,
68 out u transfer_id,
69 out o transfer_path);
70 ImportRawEx(in h fd,
71 in s local_name,
72 in s class,
73 in t flags,
74 out u transfer_id,
75 out o transfer_path);
76 ImportFileSystem(in h fd,
77 in s local_name,
78 in b force,
79 in b read_only,
80 out u transfer_id,
81 out o transfer_path);
82 ImportFileSystemEx(in h fd,
83 in s local_name,
84 in s class,
85 in t flags,
86 out u transfer_id,
87 out o transfer_path);
88 ExportTar(in s local_name,
89 in h fd,
90 in s format,
91 out u transfer_id,
92 out o transfer_path);
93 ExportTarEx(in s local_name,
94 in s class,
95 in h fd,
96 in s format,
97 in t flags,
98 out u transfer_id,
99 out o transfer_path);
100 ExportRaw(in s local_name,
101 in h fd,
102 in s format,
103 out u transfer_id,
104 out o transfer_path);
105 ExportRawEx(in s local_name,
106 in s class,
107 in h fd,
108 in s format,
109 in t flags,
110 out u transfer_id,
111 out o transfer_path);
112 PullTar(in s url,
113 in s local_name,
114 in s verify_mode,
115 in b force,
116 out u transfer_id,
117 out o transfer_path);
118 PullTarEx(in s url,
119 in s local_name,
120 in s class,
121 in s verify_mode,
122 in t flags,
123 out u transfer_id,
124 out o transfer_path);
125 PullRaw(in s url,
126 in s local_name,
127 in s verify_mode,
128 in b force,
129 out u transfer_id,
130 out o transfer_path);
131 PullRawEx(in s url,
132 in s local_name,
133 in s class,
134 in s verify_mode,
135 in t flags,
136 out u transfer_id,
137 out o transfer_path);
138 ListTransfers(out a(usssdo) transfers);
139 ListTransfersEx(in s class,
140 in t flags,
141 out a(ussssdo) transfers);
142 CancelTransfer(in u transfer_id);
143 ListImages(in s class,
144 in t flags,
145 out a(ssssbtttttt) images);
146 signals:
147 TransferNew(u transfer_id,
148 o transfer_path);
149 TransferRemoved(u transfer_id,
150 o transfer_path,
151 s result);
152 };
153 interface org\&.freedesktop\&.DBus\&.Peer { \&.\&.\&. };
154 interface org\&.freedesktop\&.DBus\&.Introspectable { \&.\&.\&. };
155 interface org\&.freedesktop\&.DBus\&.Properties { \&.\&.\&. };
156 };
157 .fi
158 .if n \{\
159 .RE
160 .\}
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182 .SS "Methods"
183 .PP
184 \fBImportTar()\fR/\fBImportTarEx()\fR
185 and
186 \fBImportRaw()\fR/\fBImportRawEx()\fR
187 import a disk image and place it into the image directory\&. The first argument should be a file descriptor (opened for reading) referring to the tar or raw file to import\&. It should reference a file on disk, a pipe or a socket\&. When
188 \fBImportTar()\fR/\fBImportTarEx()\fR
189 is used the file descriptor should refer to a tar file, optionally compressed with
190 \fBgzip\fR(1),
191 \fBbzip2\fR(1), or
192 \fBxz\fR(1)\&.
193 \fBsystemd\-importd\fR
194 will detect the used compression scheme (if any) automatically\&. When
195 \fBImportRaw()\fR/\fBImportRawEx()\fR
196 is used the file descriptor should refer to a raw or qcow2 disk image containing an MBR or GPT disk label, also optionally compressed with gzip, bzip2 or xz\&. In either case, if the file is specified as a file descriptor on disk, progress information is generated for the import operation (as in that case we know the total size on disk)\&. If a socket or pipe is specified, progress information is not available\&. The file descriptor argument is followed by a local name for the image\&. This should be a name suitable as a hostname and will be used to name the imported image below
197 /var/lib/machines/\&. A tar import is placed as a directory tree or a
198 \fBbtrfs\fR(8)
199 subvolume below the image directory under the specified name with no suffix appended\&. A raw import is placed as a file in the image directory with the
200 \&.raw
201 suffix appended\&. In case of
202 \fBImportTar()\fR/\fBImportRaw()\fR, if the
203 \fBforce\fR
204 argument is true, any pre\-existing image with the same name is removed before starting the operation\&. Otherwise, the operation fails if an image with the same name already exists\&. The
205 \fBread_only\fR
206 argument controls whether to create a writable or read\-only image\&. In case of
207 \fBImportTarEx()\fR/\fBImportRawEx()\fR
208 these boolean flags are provided via a 64bit flags parameter instead, with bit 0 mapping to the
209 \fBforce\fR
210 parameter, and bit 1 mapping to
211 \fBread_only\fR\&. The
212 \fBclass\fR
213 parameter specifies the image class, and takes one of
214 "machine",
215 "portable",
216 "sysext",
217 "confext"\&. All four methods return immediately after starting the import, with the import transfer ongoing\&. They return a pair of transfer identifier and object path, which may be used to retrieve progress information about the transfer or to cancel it\&. The transfer identifier is a simple numeric identifier, the object path references an
218 org\&.freedesktop\&.import1\&.Transfer
219 object, see below\&. Listen for a
220 \fBTransferRemoved()\fR
221 signal for the transfer ID in order to detect when a transfer is complete\&. The returned transfer object is useful to determine the current progress or log output of the ongoing import operation\&.
222 .PP
223 \fBExportTar()\fR/\fBExportTarEx()\fR
224 and
225 \fBExportRaw()\fR/\fBExportRaw()\fR
226 implement the reverse operation, and may be used to export a system image in order to place it in a tar or raw image\&. They take the machine name to export as their first parameter, followed by a file descriptor (opened for writing) where the tar or raw file will be written\&. It may either reference a file on disk or a pipe/socket\&. The third argument specifies in which compression format to write the image\&. It takes one of
227 "uncompressed",
228 "xz",
229 "bzip2"
230 or
231 "gzip", depending on which compression scheme is required\&. The image written to the specified file descriptor will be a tar file in case of
232 \fBExportTar()\fR/\fBExportTarEx()\fR
233 or a raw disk image in case of
234 \fBExportRaw()\fR/\fBExportRawEx()\fR\&. Note that currently raw disk images may not be exported as tar files, and vice versa\&. This restriction might be lifted eventually\&. The method returns a transfer identifier and object path for cancelling or tracking the export operation, similarly to
235 \fBImportTar()\fR/\fBImportTarEx()\fR
236 or
237 \fBImportRaw()\fR/\fBImportRawEx()\fR
238 as described above\&.
239 \fBExportTarEx()\fR/\fBExportRawEx()\fR
240 expect the image class as additional parameter, as well as a 64bit flags parameter that currently must be specified as zero\&.
241 .PP
242 \fBPullTar()\fR/\fBPullTarEx()\fR
243 and
244 \fBPullRaw()\fR/\fBPullRawEx()\fR
245 may be used to download, verify and import a system image from a URL\&. They take a URL argument which should point to a tar or raw file on the
246 "http://"
247 or
248 "https://"
249 protocols, possibly compressed with xz, bzip2 or gzip\&. The second argument is a local name for the image\&. It should be suitable as a hostname, similarly to the matching argument of the
250 \fBImportTar()\fR/\fBImportTarEx()\fR
251 and
252 \fBImportRaw()\fR/\fBImportRawEx()\fR
253 methods above\&. The third argument indicates the verification mode for the image\&. It may be one of
254 "no",
255 "checksum",
256 "signature"\&.
257 "no"
258 turns off any kind of verification of the image;
259 "checksum"
260 looks for a
261 SHA256SUM
262 file next to the downloaded image and verifies any SHA256 hash value in that file against the image;
263 "signature"
264 does the same but also tries to authenticate the
265 SHA256SUM
266 file via
267 \fBgpg\fR(8)
268 first\&. In case of
269 \fBPullTar()\fR/\fBPullRaw()\fR
270 the last argument indicates whether to replace a possibly pre\-existing image with the same local name (if
271 "true"), or whether to fail (if
272 "false")\&. In case of
273 \fBPullTarEx()\fR/\fBPullRawEx()\fR
274 the last argument is a 64bit flags parameter, where bit 0 controls the
275 "force"
276 flag, bit 1 is a
277 "read_only"
278 flag that controls whether the created image shall be marked read\-only, and bit 2 is a
279 "keep_download"
280 flag that indicates whether a pristine, read\-only copy of the downloaded image shell be kept, in addition for the local copy of the image\&. The
281 \fB\&..._Ex()\fR
282 variants also expect an image class string (as above)\&. Like the import and export calls above, these calls return a pair of transfer identifier and object path for the ongoing download\&.
283 .PP
284 \fBImportFileSystem()\fR/\fBImportFileSystemEx()\fR
285 are similar to
286 \fBImportTar()\fR/\fBImportTarEx()\fR
287 but import a directory tree\&. The first argument must refer to a directory file descriptor for the source hierarchy to import\&.
288 .PP
289 \fBListTransfers()\fR/\fBListTransfersEx()\fR
290 return a list of ongoing import, export or download operations as created with the six calls described above\&. They return an array of structures which consist of the numeric transfer identifier, a string indicating the operation (one of
291 "import\-tar",
292 "import\-raw",
293 "export\-tar",
294 "export\-raw",
295 "pull\-tar"
296 or
297 "pull\-raw"), a string describing the remote file (in case of download operations this is the source URL, in case of import/export operations this is a short string describing the file descriptor passed in), a string with the local machine image name, the image class (only in case of
298 \fBListTransfersEx()\fR; one of
299 "machine",
300 "portable",
301 "sysext",
302 "confext"), a progress value between 0\&.0 (for 0%) and 1\&.0 (for 100%), as well as the transfer object path\&.
303 .PP
304 \fBCancelTransfer()\fR
305 may be used to cancel an ongoing import, export or download operation\&. Simply specify the transfer identifier to cancel the ongoing operation\&.
306 .PP
307 \fBListImages()\fR
308 returns a list of currently installed images\&. It takes a image class string and a flags parameter\&. The image class is either the empty string or specifies one of the four image classes, by which it will then filter\&. The flags parameter must be zero at this time\&. It returns an array of items, each describing one image\&. The item fields are in order: the image class, the local image name, the image type, the image path, the read\-only flag, the creation and modification times (in microseconds since the UNIX epoch), as well as the current disk usage in bytes (both overall, and exclusive), as well as any size limit in bytes set on the image (both overall and exclusive)\&.
309 .SS "Signals"
310 .PP
311 The
312 \fBTransferNew()\fR
313 signal is generated each time a new transfer is started with the import, export or download calls described above\&. It carries the transfer ID and object path that have just been created\&.
314 .PP
315 The
316 \fBTransferRemoved()\fR
317 signal is sent each time a transfer finishes, is canceled or fails\&. It also carries the transfer ID and object path, followed by a string indicating the result of the operation, which is one of
318 "done"
319 (on success),
320 "canceled"
321 or
322 "failed"\&.
323 .SH "THE TRANSFER OBJECT"
324 .sp
325 .if n \{\
326 .RS 4
327 .\}
328 .nf
329 node /org/freedesktop/import1/transfer/_1 {
330 interface org\&.freedesktop\&.import1\&.Transfer {
331 methods:
332 Cancel();
333 signals:
334 LogMessage(u priority,
335 s line);
336 ProgressUpdate(d progress);
337 properties:
338 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const")
339 readonly u Id = \&.\&.\&.;
340 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const")
341 readonly s Local = \*(Aq\&.\&.\&.\*(Aq;
342 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const")
343 readonly s Remote = \*(Aq\&.\&.\&.\*(Aq;
344 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const")
345 readonly s Type = \*(Aq\&.\&.\&.\*(Aq;
346 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const")
347 readonly s Verify = \*(Aq\&.\&.\&.\*(Aq;
348 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
349 readonly d Progress = \&.\&.\&.;
350 };
351 interface org\&.freedesktop\&.DBus\&.Peer { \&.\&.\&. };
352 interface org\&.freedesktop\&.DBus\&.Introspectable { \&.\&.\&. };
353 interface org\&.freedesktop\&.DBus\&.Properties { \&.\&.\&. };
354 };
355 .fi
356 .if n \{\
357 .RE
358 .\}
359
360
361
362
363
364
365
366
367
368
369 .SS "Methods"
370 .PP
371 The
372 \fBCancel()\fR
373 method may be used to cancel the transfer\&. It takes no parameters\&. This method is pretty much equivalent to the
374 \fBCancelTransfer()\fR
375 method on the
376 Manager
377 interface (see above), but is exposed on the
378 Transfer
379 object itself instead of taking a transfer ID\&.
380 .SS "Properties"
381 .PP
382 The
383 \fIId\fR
384 property exposes the numeric transfer ID of the transfer object\&.
385 .PP
386 The
387 \fILocal\fR,
388 \fIRemote\fR
389 and
390 \fIType\fR
391 properties expose the local container name of this transfer, the remote source (in case of download: the URL, in case of import/export: a string describing the file descriptor passed in), and the type of operation (see the Manager\*(Aqs
392 \fBListTransfer()\fR
393 method above for an explanation of the possible values)\&.
394 .PP
395 The
396 \fIVerify\fR
397 property exposes the selected verification setting and is only defined for download operations (see above)\&.
398 .PP
399 The
400 \fIProgress\fR
401 property exposes the current progress of the transfer as a value between 0\&.0 and 1\&.0\&. To show a progress bar on screen we recommend to query this value in regular intervals, for example every 500\ \&ms or so\&.
402 .SS "Signals"
403 .PP
404 The
405 \fBLogMessage()\fR
406 signal is emitted for log messages generated by a transfer\&. It carries a pair of syslog log level integer and log string\&.
407 .PP
408 The
409 \fBProgressUpdate()\fR
410 signal is emitted in regular intervals when new download progress information is available for a transfer\&. It carries a double precision floating pointer number between 0\&.0 and 1\&.0 indicating the transfer progress\&.
411 .SH "EXAMPLES"
412 .PP
413 \fBExample\ \&1.\ \&Introspect org\&.freedesktop\&.import1\&.Manager on the bus\fR
414 .sp
415 .if n \{\
416 .RS 4
417 .\}
418 .nf
419 $ gdbus introspect \-\-system \e
420 \-\-dest org\&.freedesktop\&.import1 \e
421 \-\-object\-path /org/freedesktop/import1
422 .fi
423 .if n \{\
424 .RE
425 .\}
426 .PP
427 \fBExample\ \&2.\ \&Introspect org\&.freedesktop\&.import1\&.Transfer on the bus\fR
428 .sp
429 .if n \{\
430 .RS 4
431 .\}
432 .nf
433 $ gdbus introspect \-\-system \e
434 \-\-dest org\&.freedesktop\&.import1 \e
435 \-\-object\-path /org/freedesktop/import1/transfer/_1
436 .fi
437 .if n \{\
438 .RE
439 .\}
440 .SH "VERSIONING"
441 .PP
442 These D\-Bus interfaces follow
443 \m[blue]\fBthe usual interface versioning guidelines\fR\m[]\&\s-2\u[1]\d\s+2\&.
444 .SH "HISTORY"
445 .SS "The Manager Object"
446 .PP
447 \fBImportTarEx()\fR,
448 \fBImportRawEx()\fR,
449 \fBImportFileSystemEx()\fR,
450 \fBExportTarEx()\fR,
451 \fBExportRawEx()\fR,
452 \fBPullTarEx()\fR,
453 \fBPullRawEx()\fR,
454 \fBListTransfersEx()\fR,
455 \fBListImages()\fR
456 were added in version 256\&.
457 .SS "Transfer Objects"
458 .PP
459 \fBProgressUpdate()\fR
460 was added in version 256\&.
461 .SH "SEE ALSO"
462 .PP
463 \fBsystemd\fR(1), \fBsystemd-importd.service\fR(8), \fBimportctl\fR(1)
464 .SH "NOTES"
465 .IP " 1." 4
466 the usual interface versioning guidelines
467 .RS 4
468 \%https://0pointer.de/blog/projects/versioning-dbus.html
469 .RE