File: gdbus-org.freedesktop.UDisks2.Job.html

package info (click to toggle)
udisks2 2.11.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 23,612 kB
  • sloc: ansic: 49,035; python: 8,537; sh: 5,574; xml: 1,490; makefile: 1,232; sed: 85
file content (452 lines) | stat: -rw-r--r-- 18,336 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>org.freedesktop.UDisks2.Job: UDisks Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="UDisks Reference Manual">
<link rel="up" href="ch03.html" title="D-Bus Interfaces">
<link rel="prev" href="gdbus-org.freedesktop.UDisks2.Loop.html" title="org.freedesktop.UDisks2.Loop">
<link rel="next" href="gdbus-org.freedesktop.UDisks2.NVMe.Controller.html" title="org.freedesktop.UDisks2.NVMe.Controller">
<meta name="generator" content="GTK-Doc V1.35.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#gdbus-org.freedesktop.UDisks2.Job.description" class="shortcut">Description</a></span><span id="nav_properties">  <span class="dim">|</span> 
                  <a href="#gdbus-org.freedesktop.UDisks2.Job.properties" class="shortcut">Properties</a></span><span id="nav_signals">  <span class="dim">|</span> 
                  <a href="#gdbus-org.freedesktop.UDisks2.Job.signals" class="shortcut">Signals</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="ch03.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="gdbus-org.freedesktop.UDisks2.Loop.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="gdbus-org.freedesktop.UDisks2.NVMe.Controller.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="gdbus-org.freedesktop.UDisks2.Job"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gdbus-interface-org-freedesktop-UDisks2-Job.top_of_page"></a>org.freedesktop.UDisks2.Job</span></h2>
<p>org.freedesktop.UDisks2.Job — Long-running tasks</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Methods</h2>
<pre class="synopsis">
<a class="link" href="gdbus-org.freedesktop.UDisks2.Job.html#gdbus-method-org-freedesktop-UDisks2-Job.Cancel" title="The Cancel() method">Cancel</a> (IN  a{sv} options);
</pre>
</div>
<div class="refsect1">
<a name="id-1.3.3.13.4"></a><h2>Signals</h2>
<pre class="synopsis">
<a class="link" href="gdbus-org.freedesktop.UDisks2.Job.html#gdbus-signal-org-freedesktop-UDisks2-Job.Completed" title='The "Completed" signal'>Completed</a> (b success,
           s message);
</pre>
</div>
<div class="refsect1">
<a name="id-1.3.3.13.5"></a><h2>Properties</h2>
<pre class="synopsis">
<a class="link" href="gdbus-org.freedesktop.UDisks2.Job.html#gdbus-property-org-freedesktop-UDisks2-Job.Operation" title='The "Operation" property'>Operation</a>        readable   s
<a class="link" href="gdbus-org.freedesktop.UDisks2.Job.html#gdbus-property-org-freedesktop-UDisks2-Job.Progress" title='The "Progress" property'>Progress</a>         readable   d
<a class="link" href="gdbus-org.freedesktop.UDisks2.Job.html#gdbus-property-org-freedesktop-UDisks2-Job.ProgressValid" title='The "ProgressValid" property'>ProgressValid</a>    readable   b
<a class="link" href="gdbus-org.freedesktop.UDisks2.Job.html#gdbus-property-org-freedesktop-UDisks2-Job.Bytes" title='The "Bytes" property'>Bytes</a>            readable   t
<a class="link" href="gdbus-org.freedesktop.UDisks2.Job.html#gdbus-property-org-freedesktop-UDisks2-Job.Rate" title='The "Rate" property'>Rate</a>             readable   t
<a class="link" href="gdbus-org.freedesktop.UDisks2.Job.html#gdbus-property-org-freedesktop-UDisks2-Job.StartTime" title='The "StartTime" property'>StartTime</a>        readable   t
<a class="link" href="gdbus-org.freedesktop.UDisks2.Job.html#gdbus-property-org-freedesktop-UDisks2-Job.ExpectedEndTime" title='The "ExpectedEndTime" property'>ExpectedEndTime</a>  readable   t
<a class="link" href="gdbus-org.freedesktop.UDisks2.Job.html#gdbus-property-org-freedesktop-UDisks2-Job.Objects" title='The "Objects" property'>Objects</a>          readable   ao
<a class="link" href="gdbus-org.freedesktop.UDisks2.Job.html#gdbus-property-org-freedesktop-UDisks2-Job.StartedByUID" title='The "StartedByUID" property'>StartedByUID</a>     readable   u
<a class="link" href="gdbus-org.freedesktop.UDisks2.Job.html#gdbus-property-org-freedesktop-UDisks2-Job.Cancelable" title='The "Cancelable" property'>Cancelable</a>       readable   b
</pre>
</div>
<div class="refsect1">
<a name="gdbus-interface-org-freedesktop-UDisks2-Job"></a><h2>Description</h2>
<p>
Some operations may take a long time (hours) to complete, that
is, to actually send the D-Bus reply message back. One example
of such an operation is the
<a class="link" href="gdbus-org.freedesktop.UDisks2.Block.html#gdbus-method-org-freedesktop-UDisks2-Block.Format" title="The Format() method">Format()</a> method that is used to
format a block device.
</p>
<p>
When such operations are initiated, a job object implementing
this interface may be created so the progress can be tracked by
the caller (and also other observers).
</p>
<p>
The object(s) that a job affects (such as block devices or
drives) can be determined by looking at the
<a class="link" href="gdbus-org.freedesktop.UDisks2.Job.html#gdbus-property-org-freedesktop-UDisks2-Job.Objects" title='The "Objects" property'>"Objects"</a> property. Among other
things, this can be used to draw a spinner in the user interface
next to e.g. an icon for the drive or device in question.
</p>
<p>
The <a class="link" href="gdbus-org.freedesktop.UDisks2.Job.html#gdbus-property-org-freedesktop-UDisks2-Job.Operation" title='The "Operation" property'>"Operation"</a> property is used to
convey the type of job currently in progress.
</p>
<p>
The user id of the user who started the job is set in the
<a class="link" href="gdbus-org.freedesktop.UDisks2.Job.html#gdbus-property-org-freedesktop-UDisks2-Job.StartedByUID" title='The "StartedByUID" property'>"StartedByUID"</a> property.
</p>
<p>
A job <span class="emphasis"><em>may</em></span> convey how much progress has been
made, see the <a class="link" href="gdbus-org.freedesktop.UDisks2.Job.html#gdbus-property-org-freedesktop-UDisks2-Job.Progress" title='The "Progress" property'>"Progress"</a> and
<a class="link" href="gdbus-org.freedesktop.UDisks2.Job.html#gdbus-property-org-freedesktop-UDisks2-Job.ProgressValid" title='The "ProgressValid" property'>"ProgressValid"</a> properties.
</p>
<p>
When a job completes, the <a class="link" href="gdbus-org.freedesktop.UDisks2.Job.html#gdbus-signal-org-freedesktop-UDisks2-Job.Completed" title='The "Completed" signal'>"Completed"</a> signal
is emitted.
</p>
<p>
A job may or may not be cancelable, see the
<a class="link" href="gdbus-org.freedesktop.UDisks2.Job.html#gdbus-property-org-freedesktop-UDisks2-Job.Cancelable" title='The "Cancelable" property'>"Cancelable"</a> property. To cancel a
job use the <a class="link" href="gdbus-org.freedesktop.UDisks2.Job.html#gdbus-method-org-freedesktop-UDisks2-Job.Cancel" title="The Cancel() method">Cancel()</a> method. This
will cause the job to complete (with <em class="parameter"><code>success</code></em> set to <code class="constant">FALSE</code>) and
the D-Bus method used to initiate the operation to return,
usually returning the
<code class="literal">org.freedesktop.UDisks2.Error.Cancelled</code>
error. Once cancellation is requested it may take some time before
the job is actually completed as there might be ongoing I/O.
</p>
</div>
<div class="refsect1">
<a name="gdbus-methods-org.freedesktop.UDisks2.Job"></a><h2>Method Details</h2>
<div class="refsect2">
<a name="gdbus-method-org-freedesktop-UDisks2-Job.Cancel"></a><h3>The Cancel() method</h3>
<pre class="programlisting">
Cancel (IN  a{sv} options);
</pre>
<p>
Cancels the job. Fails with the
<code class="literal">org.freedesktop.UDisks2.Error.Failed</code> error
if <a class="link" href="gdbus-org.freedesktop.UDisks2.Job.html#gdbus-property-org-freedesktop-UDisks2-Job.Cancelable" title='The "Cancelable" property'>"Cancelable"</a> is <code class="constant">FALSE</code>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="literal">IN a{sv} <em class="parameter"><code>options</code></em></code>:</span></p></td>
<td><p>
Options (currently unused except for <a class="link" href="udisks-std-options.html" title="The options parameter">standard options</a>).
</p></td>
</tr></tbody>
</table></div>
</div>
</div>
<div class="refsect1">
<a name="gdbus-signals-org.freedesktop.UDisks2.Job"></a><h2>Signal Details</h2>
<div class="refsect2">
<a name="gdbus-signal-org-freedesktop-UDisks2-Job.Completed"></a><h3>The "Completed" signal</h3>
<pre class="programlisting">
Completed (b success,
           s message);
</pre>
<p>
Emitted when a job completes.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="literal">b <em class="parameter"><code>success</code></em></code>:</span></p></td>
<td><p>
If <code class="constant">TRUE</code>, the job completed successfully.
</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="literal">s <em class="parameter"><code>message</code></em></code>:</span></p></td>
<td><p>
A message describing the completion of the job, e.g. an error message.
</p></td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1">
<a name="gdbus-properties-org.freedesktop.UDisks2.Job"></a><h2>Property Details</h2>
<div class="refsect2">
<a name="gdbus-property-org-freedesktop-UDisks2-Job.Operation"></a><h3>The "Operation" property</h3>
<pre class="programlisting">
Operation  readable   s
</pre>
<p>
</p>
<p>
The type of the operation that the job represents.
</p>
<p>
Known job operation types include:
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">ata-smart-selftest</span></p></td>
<td><p>SMART self-test operation.</p></td>
</tr>
<tr>
<td><p><span class="term">drive-eject</span></p></td>
<td><p>Ejecting the medium from a drive.</p></td>
</tr>
<tr>
<td><p><span class="term">encrypted-unlock</span></p></td>
<td><p>Unlocking encrypted device.</p></td>
</tr>
<tr>
<td><p><span class="term">encrypted-lock</span></p></td>
<td><p>Locking encrypted device.</p></td>
</tr>
<tr>
<td><p><span class="term">encrypted-modify</span></p></td>
<td><p>Modifying encrypted device.</p></td>
</tr>
<tr>
<td><p><span class="term">encrypted-resize</span></p></td>
<td><p>Resizing encrypted device.</p></td>
</tr>
<tr>
<td><p><span class="term">encrypted-convert</span></p></td>
<td><p>Converting encrypted device.</p></td>
</tr>
<tr>
<td><p><span class="term">swapspace-start</span></p></td>
<td><p>Starting swapspace.</p></td>
</tr>
<tr>
<td><p><span class="term">swapspace-stop</span></p></td>
<td><p>Stopping swapspace.</p></td>
</tr>
<tr>
<td><p><span class="term">swapspace-modify</span></p></td>
<td><p>Modifying swapspace.</p></td>
</tr>
<tr>
<td><p><span class="term">filesystem-mount</span></p></td>
<td><p>Mounting a filesystem.</p></td>
</tr>
<tr>
<td><p><span class="term">filesystem-unmount</span></p></td>
<td><p>Unmounting a filesystem.</p></td>
</tr>
<tr>
<td><p><span class="term">filesystem-modify</span></p></td>
<td><p>Modifying a filesystem.</p></td>
</tr>
<tr>
<td><p><span class="term">filesystem-resize</span></p></td>
<td><p>Resizing a filesystem.</p></td>
</tr>
<tr>
<td><p><span class="term">format-erase</span></p></td>
<td><p>Erasing a device.</p></td>
</tr>
<tr>
<td><p><span class="term">format-mkfs</span></p></td>
<td><p>Creating a filesystem.</p></td>
</tr>
<tr>
<td><p><span class="term">loop-setup</span></p></td>
<td><p>Setting up a loop device.</p></td>
</tr>
<tr>
<td><p><span class="term">partition-modify</span></p></td>
<td><p>Modifying a partition.</p></td>
</tr>
<tr>
<td><p><span class="term">partition-delete</span></p></td>
<td><p>Deleting a partition.</p></td>
</tr>
<tr>
<td><p><span class="term">partition-create</span></p></td>
<td><p>Creating a partition.</p></td>
</tr>
<tr>
<td><p><span class="term">cleanup</span></p></td>
<td><p>Cleaning up devices that were removed without being properly unmounted or shut down.</p></td>
</tr>
<tr>
<td><p><span class="term">ata-secure-erase</span></p></td>
<td><p>ATA Secure Erase.</p></td>
</tr>
<tr>
<td><p><span class="term">ata-enhanced-secure-erase</span></p></td>
<td><p>ATA Enhanced Secure Erase.</p></td>
</tr>
<tr>
<td><p><span class="term">md-raid-stop</span></p></td>
<td><p>Stopping a RAID Array.</p></td>
</tr>
<tr>
<td><p><span class="term">md-raid-start</span></p></td>
<td><p>Starting a RAID Array.</p></td>
</tr>
<tr>
<td><p><span class="term">md-raid-fault-device</span></p></td>
<td><p>Marking device in RAID Array as faulty.</p></td>
</tr>
<tr>
<td><p><span class="term">md-raid-remove-device</span></p></td>
<td><p>Removing device from RAID Array.</p></td>
</tr>
<tr>
<td><p><span class="term">md-raid-create</span></p></td>
<td><p>Create a RAID Array.</p></td>
</tr>
<tr>
<td><p><span class="term">nvme-selftest</span></p></td>
<td><p>NVMe device self-test operation.</p></td>
</tr>
<tr>
<td><p><span class="term">nvme-sanitize</span></p></td>
<td><p>NVMe sanitize operation.</p></td>
</tr>
<tr>
<td><p><span class="term">nvme-format-ns</span></p></td>
<td><p>NVMe format namespace operation.</p></td>
</tr>
</tbody>
</table></div>
<p>
The
<a class="link" href="UDisksClient.html#udisks-client-get-job-description" title="udisks_client_get_job_description ()">udisks_client_get_job_description()</a>
function can be used to get a localized human readable description.
</p>
</div>
<hr>
<div class="refsect2">
<a name="gdbus-property-org-freedesktop-UDisks2-Job.Progress"></a><h3>The "Progress" property</h3>
<pre class="programlisting">
Progress  readable   d
</pre>
<p>
</p>
<p>
How much progress has been made. Values are in the range 0 to 1.
</p>
<p>
Do not use unless <a class="link" href="gdbus-org.freedesktop.UDisks2.Job.html#gdbus-property-org-freedesktop-UDisks2-Job.ProgressValid" title='The "ProgressValid" property'>"ProgressValid"</a> is <code class="constant">TRUE</code>.
</p>
</div>
<hr>
<div class="refsect2">
<a name="gdbus-property-org-freedesktop-UDisks2-Job.ProgressValid"></a><h3>The "ProgressValid" property</h3>
<pre class="programlisting">
ProgressValid  readable   b
</pre>
<p>
Set to <code class="constant">TRUE</code> if the <a class="link" href="gdbus-org.freedesktop.UDisks2.Job.html#gdbus-property-org-freedesktop-UDisks2-Job.Progress" title='The "Progress" property'>"Progress"</a> is valid.
</p>
</div>
<hr>
<div class="refsect2">
<a name="gdbus-property-org-freedesktop-UDisks2-Job.Bytes"></a><h3>The "Bytes" property</h3>
<pre class="programlisting">
Bytes  readable   t
</pre>
<p>
</p>
<p>
<em class="parameter"><code>since</code></em>: 2.0.0
If the job involves processing a known number of bytes (for
example, erasing a disk), this property contains the total
number of bytes to process. If not, the value of this
property is zero.
</p>
<p>
The intent of this property is for user interfaces to convey
information such as <span class="quote">“<span class="quote">123 GB of 1.0 TB completed</span>”</span>.
</p>
</div>
<hr>
<div class="refsect2">
<a name="gdbus-property-org-freedesktop-UDisks2-Job.Rate"></a><h3>The "Rate" property</h3>
<pre class="programlisting">
Rate  readable   t
</pre>
<p>
</p>
<p>
<em class="parameter"><code>since</code></em>: 2.0.0
If the job involves processing a number of bytes (for
example, erasing) and the rate at which the processing takes
place is known, this property contains the rate (measured in
bytes per second).  Otherwise the value of this property is
zero.
</p>
<p>
The intent of this property is for user interfaces to convey
information such as <span class="quote">“<span class="quote">110 MB/sec</span>”</span>.
</p>
</div>
<hr>
<div class="refsect2">
<a name="gdbus-property-org-freedesktop-UDisks2-Job.StartTime"></a><h3>The "StartTime" property</h3>
<pre class="programlisting">
StartTime  readable   t
</pre>
<p>
The point in time (micro-seconds since the <a class="ulink" href="http://en.wikipedia.org/wiki/Unix_epoch" target="_top">Unix
Epoch</a>) that the job was started.
</p>
</div>
<hr>
<div class="refsect2">
<a name="gdbus-property-org-freedesktop-UDisks2-Job.ExpectedEndTime"></a><h3>The "ExpectedEndTime" property</h3>
<pre class="programlisting">
ExpectedEndTime  readable   t
</pre>
<p>
The expected point in time (micro-seconds since the <a class="ulink" href="http://en.wikipedia.org/wiki/Unix_epoch" target="_top">Unix
Epoch</a>) that the job will complete or 0 if unknown.
</p>
</div>
<hr>
<div class="refsect2">
<a name="gdbus-property-org-freedesktop-UDisks2-Job.Objects"></a><h3>The "Objects" property</h3>
<pre class="programlisting">
Objects  readable   ao
</pre>
<p>
The objects that the job is related to, if any.
</p>
</div>
<hr>
<div class="refsect2">
<a name="gdbus-property-org-freedesktop-UDisks2-Job.StartedByUID"></a><h3>The "StartedByUID" property</h3>
<pre class="programlisting">
StartedByUID  readable   u
</pre>
<p>
</p>
<p>
The id of the user who started the job or 0 if started
by root or not through udisks.
</p>
</div>
<hr>
<div class="refsect2">
<a name="gdbus-property-org-freedesktop-UDisks2-Job.Cancelable"></a><h3>The "Cancelable" property</h3>
<pre class="programlisting">
Cancelable  readable   b
</pre>
<p>
Whether the job can be canceled.
</p>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.35.1</div>
</body>
</html>