Debian Codegraph @

upstream/mageia-cauldron/man5/org.freedesktop.import1.5

raw
1 '\" t
2 .TH "ORG\&.FREEDESKTOP\&.IMPORT1" "5" "" "systemd 258.7" "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 \fBzstd\fR(1),
192 \fBbzip2\fR(1), or
193 \fBxz\fR(1)\&.
194 \fBsystemd\-importd\fR
195 will detect the used compression scheme (if any) automatically\&. When
196 \fBImportRaw()\fR/\fBImportRawEx()\fR
197 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, zstd, 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
198 /var/lib/machines/\&. A tar import is placed as a directory tree or a
199 \fBbtrfs\fR(8)
200 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
201 \&.raw
202 suffix appended\&. In case of
203 \fBImportTar()\fR/\fBImportRaw()\fR, if the
204 \fBforce\fR
205 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
206 \fBread_only\fR
207 argument controls whether to create a writable or read\-only image\&. In case of
208 \fBImportTarEx()\fR/\fBImportRawEx()\fR
209 these boolean flags are provided via a 64bit flags parameter instead, with bit 0 mapping to the
210 \fBforce\fR
211 parameter, and bit 1 mapping to
212 \fBread_only\fR\&. The
213 \fBclass\fR
214 parameter specifies the image class, and takes one of
215 "machine",
216 "portable",
217 "sysext",
218 "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
219 org\&.freedesktop\&.import1\&.Transfer
220 object, see below\&. Listen for a
221 \fBTransferRemoved()\fR
222 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\&.
223 .PP
224 \fBExportTar()\fR/\fBExportTarEx()\fR
225 and
226 \fBExportRaw()\fR/\fBExportRaw()\fR
227 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
228 "uncompressed",
229 "xz",
230 "bzip2",
231 "gzip"
232 or
233 "zstd", depending on which compression scheme is required\&. The image written to the specified file descriptor will be a tar file in case of
234 \fBExportTar()\fR/\fBExportTarEx()\fR
235 or a raw disk image in case of
236 \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
237 \fBImportTar()\fR/\fBImportTarEx()\fR
238 or
239 \fBImportRaw()\fR/\fBImportRawEx()\fR
240 as described above\&.
241 \fBExportTarEx()\fR/\fBExportRawEx()\fR
242 expect the image class as additional parameter, as well as a 64bit flags parameter that currently must be specified as zero\&.
243 .PP
244 \fBPullTar()\fR/\fBPullTarEx()\fR
245 and
246 \fBPullRaw()\fR/\fBPullRawEx()\fR
247 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
248 "http://"
249 or
250 "https://"
251 protocols, possibly compressed with xz, bzip2, gzip or zstd\&. The second argument is a local name for the image\&. It should be suitable as a hostname, similarly to the matching argument of the
252 \fBImportTar()\fR/\fBImportTarEx()\fR
253 and
254 \fBImportRaw()\fR/\fBImportRawEx()\fR
255 methods above\&. The third argument indicates the verification mode for the image\&. It may be one of
256 "no",
257 "checksum",
258 "signature"\&.
259 "no"
260 turns off any kind of verification of the image;
261 "checksum"
262 looks for a
263 SHA256SUM
264 file next to the downloaded image and verifies any SHA256 hash value in that file against the image;
265 "signature"
266 does the same but also tries to authenticate the
267 SHA256SUM
268 file via
269 \fBgpg\fR(8)
270 first\&. In case of
271 \fBPullTar()\fR/\fBPullRaw()\fR
272 the last argument indicates whether to replace a possibly pre\-existing image with the same local name (if
273 "true"), or whether to fail (if
274 "false")\&. In case of
275 \fBPullTarEx()\fR/\fBPullRawEx()\fR
276 the last argument is a 64bit flags parameter, where bit 0 controls the
277 "force"
278 flag, bit 1 is a
279 "read_only"
280 flag that controls whether the created image shall be marked read\-only, and bit 2 is a
281 "keep_download"
282 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
283 \fB\&..._Ex()\fR
284 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\&.
285 .PP
286 \fBImportFileSystem()\fR/\fBImportFileSystemEx()\fR
287 are similar to
288 \fBImportTar()\fR/\fBImportTarEx()\fR
289 but import a directory tree\&. The first argument must refer to a directory file descriptor for the source hierarchy to import\&.
290 .PP
291 \fBListTransfers()\fR/\fBListTransfersEx()\fR
292 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
293 "import\-tar",
294 "import\-raw",
295 "export\-tar",
296 "export\-raw",
297 "pull\-tar"
298 or
299 "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
300 \fBListTransfersEx()\fR; one of
301 "machine",
302 "portable",
303 "sysext",
304 "confext"), a progress value between 0\&.0 (for 0%) and 1\&.0 (for 100%), as well as the transfer object path\&.
305 .PP
306 \fBCancelTransfer()\fR
307 may be used to cancel an ongoing import, export or download operation\&. Simply specify the transfer identifier to cancel the ongoing operation\&.
308 .PP
309 \fBListImages()\fR
310 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)\&.
311 .SS "Signals"
312 .PP
313 The
314 \fBTransferNew()\fR
315 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\&.
316 .PP
317 The
318 \fBTransferRemoved()\fR
319 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
320 "done"
321 (on success),
322 "canceled"
323 or
324 "failed"\&.
325 .SH "THE TRANSFER OBJECT"
326 .sp
327 .if n \{\
328 .RS 4
329 .\}
330 .nf
331 node /org/freedesktop/import1/transfer/_1 {
332 interface org\&.freedesktop\&.import1\&.Transfer {
333 methods:
334 Cancel();
335 signals:
336 LogMessage(u priority,
337 s line);
338 ProgressUpdate(d progress);
339 properties:
340 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const")
341 readonly u Id = \&.\&.\&.;
342 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const")
343 readonly s Local = \*(Aq\&.\&.\&.\*(Aq;
344 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const")
345 readonly s Remote = \*(Aq\&.\&.\&.\*(Aq;
346 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const")
347 readonly s Type = \*(Aq\&.\&.\&.\*(Aq;
348 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const")
349 readonly s Verify = \*(Aq\&.\&.\&.\*(Aq;
350 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("false")
351 readonly d Progress = \&.\&.\&.;
352 };
353 interface org\&.freedesktop\&.DBus\&.Peer { \&.\&.\&. };
354 interface org\&.freedesktop\&.DBus\&.Introspectable { \&.\&.\&. };
355 interface org\&.freedesktop\&.DBus\&.Properties { \&.\&.\&. };
356 };
357 .fi
358 .if n \{\
359 .RE
360 .\}
361
362
363
364
365
366
367
368
369
370
371 .SS "Methods"
372 .PP
373 The
374 \fBCancel()\fR
375 method may be used to cancel the transfer\&. It takes no parameters\&. This method is pretty much equivalent to the
376 \fBCancelTransfer()\fR
377 method on the
378 Manager
379 interface (see above), but is exposed on the
380 Transfer
381 object itself instead of taking a transfer ID\&.
382 .SS "Properties"
383 .PP
384 The
385 \fIId\fR
386 property exposes the numeric transfer ID of the transfer object\&.
387 .PP
388 The
389 \fILocal\fR,
390 \fIRemote\fR
391 and
392 \fIType\fR
393 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
394 \fBListTransfer()\fR
395 method above for an explanation of the possible values)\&.
396 .PP
397 The
398 \fIVerify\fR
399 property exposes the selected verification setting and is only defined for download operations (see above)\&.
400 .PP
401 The
402 \fIProgress\fR
403 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\&.
404 .SS "Signals"
405 .PP
406 The
407 \fBLogMessage()\fR
408 signal is emitted for log messages generated by a transfer\&. It carries a pair of syslog log level integer and log string\&.
409 .PP
410 The
411 \fBProgressUpdate()\fR
412 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\&.
413 .SH "EXAMPLES"
414 .PP
415 \fBExample\ \&1.\ \&Introspect org\&.freedesktop\&.import1\&.Manager on the bus\fR
416 .sp
417 .if n \{\
418 .RS 4
419 .\}
420 .nf
421 $ gdbus introspect \-\-system \e
422 \-\-dest org\&.freedesktop\&.import1 \e
423 \-\-object\-path /org/freedesktop/import1
424 .fi
425 .if n \{\
426 .RE
427 .\}
428 .PP
429 \fBExample\ \&2.\ \&Introspect org\&.freedesktop\&.import1\&.Transfer on the bus\fR
430 .sp
431 .if n \{\
432 .RS 4
433 .\}
434 .nf
435 $ gdbus introspect \-\-system \e
436 \-\-dest org\&.freedesktop\&.import1 \e
437 \-\-object\-path /org/freedesktop/import1/transfer/_1
438 .fi
439 .if n \{\
440 .RE
441 .\}
442 .SH "VERSIONING"
443 .PP
444 These D\-Bus interfaces follow
445 \m[blue]\fBthe usual interface versioning guidelines\fR\m[]\&\s-2\u[1]\d\s+2\&.
446 .SH "HISTORY"
447 .SS "The Manager Object"
448 .PP
449 \fBImportTarEx()\fR,
450 \fBImportRawEx()\fR,
451 \fBImportFileSystemEx()\fR,
452 \fBExportTarEx()\fR,
453 \fBExportRawEx()\fR,
454 \fBPullTarEx()\fR,
455 \fBPullRawEx()\fR,
456 \fBListTransfersEx()\fR,
457 \fBListImages()\fR
458 were added in version 256\&.
459 .SS "Transfer Objects"
460 .PP
461 \fBProgressUpdate()\fR
462 was added in version 256\&.
463 .SH "SEE ALSO"
464 .PP
465 \fBsystemd\fR(1), \fBsystemd-importd.service\fR(8), \fBimportctl\fR(1)
466 .SH "NOTES"
467 .IP " 1." 4
468 the usual interface versioning guidelines
469 .RS 4
470 \%https://0pointer.de/blog/projects/versioning-dbus.html
471 .RE