| 1 |
<?xml version='1.0'?> |
| 2 |
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" |
| 3 |
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" > |
| 4 |
<!-- SPDX-License-Identifier: LGPL-2.1-or-later --> |
| 5 |
|
| 6 |
<refentry id="org.freedesktop.sysupdate1" conditional='ENABLE_SYSUPDATED' |
| 7 |
xmlns:xi="http://www.w3.org/2001/XInclude"> |
| 8 |
<refentryinfo> |
| 9 |
<title>org.freedesktop.sysupdate1</title> |
| 10 |
<productname>systemd</productname> |
| 11 |
</refentryinfo> |
| 12 |
|
| 13 |
<refmeta> |
| 14 |
<refentrytitle>org.freedesktop.sysupdate1</refentrytitle> |
| 15 |
<manvolnum>5</manvolnum> |
| 16 |
</refmeta> |
| 17 |
|
| 18 |
<refnamediv> |
| 19 |
<refname>org.freedesktop.sysupdate1</refname> |
| 20 |
<refpurpose>The D-Bus interface of systemd-sysupdated</refpurpose> |
| 21 |
</refnamediv> |
| 22 |
|
| 23 |
<refsect1> |
| 24 |
<title>Introduction</title> |
| 25 |
|
| 26 |
<para> |
| 27 |
<citerefentry><refentrytitle>systemd-sysupdated.service</refentrytitle><manvolnum>8</manvolnum></citerefentry> |
| 28 |
is a system service that allows unprivileged clients to update the system. This page describes the D-Bus |
| 29 |
interface.</para> |
| 30 |
|
| 31 |
<para><emphasis>WARNING!</emphasis> This API is currently <emphasis>unstable</emphasis> and is thus subject |
| 32 |
to breaking changes between versions of systemd.</para> |
| 33 |
</refsect1> |
| 34 |
|
| 35 |
<refsect1> |
| 36 |
<title>The Manager Object</title> |
| 37 |
|
| 38 |
<para>The service exposes the following interfaces on the Manager object on the bus:</para> |
| 39 |
|
| 40 |
<programlisting executable="systemd-sysupdated" node="/org/freedesktop/sysupdate1" interface="org.freedesktop.sysupdate1.Manager"> |
| 41 |
node /org/freedesktop/sysupdate1 { |
| 42 |
interface org.freedesktop.sysupdate1.Manager { |
| 43 |
methods: |
| 44 |
ListTargets(out a(sso) targets); |
| 45 |
ListJobs(out a(tsuo) jobs); |
| 46 |
ListAppStream(out as urls); |
| 47 |
signals: |
| 48 |
JobRemoved(t id, |
| 49 |
o path, |
| 50 |
i status); |
| 51 |
}; |
| 52 |
interface org.freedesktop.DBus.Peer { ... }; |
| 53 |
interface org.freedesktop.DBus.Introspectable { ... }; |
| 54 |
interface org.freedesktop.DBus.Properties { ... }; |
| 55 |
}; |
| 56 |
</programlisting> |
| 57 |
|
| 58 |
<!--Autogenerated cross-references for systemd.directives, do not edit--> |
| 59 |
|
| 60 |
<variablelist class="dbus-interface" generated="True" extra-ref="org.freedesktop.sysupdate1.Manager"/> |
| 61 |
|
| 62 |
<variablelist class="dbus-interface" generated="True" extra-ref="org.freedesktop.sysupdate1.Manager"/> |
| 63 |
|
| 64 |
<variablelist class="dbus-method" generated="True" extra-ref="ListTargets()"/> |
| 65 |
|
| 66 |
<variablelist class="dbus-method" generated="True" extra-ref="ListJobs()"/> |
| 67 |
|
| 68 |
<variablelist class="dbus-method" generated="True" extra-ref="ListAppStream()"/> |
| 69 |
|
| 70 |
<variablelist class="dbus-signal" generated="True" extra-ref="JobRemoved()"/> |
| 71 |
|
| 72 |
<!--End of Autogenerated section--> |
| 73 |
|
| 74 |
<refsect2> |
| 75 |
<title>Methods</title> |
| 76 |
|
| 77 |
<para><function>ListTargets()</function> returns a list all known update targets. It returns |
| 78 |
an array of structures which consist of a string indicating the target's class (see Target's |
| 79 |
<varname>Class</varname> property below for an explanation of the possible values), a string |
| 80 |
with the name of the target, and the target object path.</para> |
| 81 |
|
| 82 |
<para><function>ListJobs()</function> returns a list all ongoing jobs. It returns |
| 83 |
an array of structures which consist of a numeric job ID, a string indicating the job type (see Job's |
| 84 |
<varname>Type</varname> property below for an explanation of the possible values), the job's progress, |
| 85 |
and the job's object path.</para> |
| 86 |
|
| 87 |
<para><function>ListAppStream()</function> returns an array of all the appstream catalog URLs that this |
| 88 |
service knows about. See Target's <varname>GetAppStream()</varname> method below for more |
| 89 |
details.</para> |
| 90 |
</refsect2> |
| 91 |
|
| 92 |
<refsect2> |
| 93 |
<title>Signals</title> |
| 94 |
|
| 95 |
<para>The <function>JobRemoved()</function> signal is sent each time a job finishes, |
| 96 |
is canceled or fails. It also carries the job ID and object path, followed by a numeric status |
| 97 |
code. If the status is zero, the job has succeed. A positive status should be treated as an |
| 98 |
exit code (i.e. <literal>EXIT_FAILURE</literal>), and a negative status should be treated as a |
| 99 |
negative errno-style error code (i.e. <literal>-EINVAL</literal>).</para> |
| 100 |
</refsect2> |
| 101 |
</refsect1> |
| 102 |
|
| 103 |
<refsect1> |
| 104 |
<title>The Target Object</title> |
| 105 |
|
| 106 |
<para>A target is a component of the system (i.e. the host itself, a sysext, a confext, etc.) that |
| 107 |
can be updated by |
| 108 |
<citerefentry><refentrytitle>systemd-sysupdate</refentrytitle><manvolnum>8</manvolnum></citerefentry>. |
| 109 |
</para> |
| 110 |
|
| 111 |
<para>The service exposes the following interfaces on Target objects on the bus:</para> |
| 112 |
|
| 113 |
<programlisting executable="systemd-sysupdated" node="/org/freedesktop/sysupdate1/target/host" interface="org.freedesktop.sysupdate1.Target"> |
| 114 |
node /org/freedesktop/sysupdate1/target/host { |
| 115 |
interface org.freedesktop.sysupdate1.Target { |
| 116 |
methods: |
| 117 |
List(in t flags, |
| 118 |
out as versions); |
| 119 |
Describe(in s version, |
| 120 |
in t flags, |
| 121 |
out s json); |
| 122 |
CheckNew(out s new_version); |
| 123 |
Acquire(in s new_version, |
| 124 |
in t flags, |
| 125 |
out s new_version, |
| 126 |
out t job_id, |
| 127 |
out o job_path); |
| 128 |
Install(in s new_version, |
| 129 |
in t flags, |
| 130 |
out s new_version, |
| 131 |
out t job_id, |
| 132 |
out o job_path); |
| 133 |
Vacuum(out u instances, |
| 134 |
out u disabled_transfers); |
| 135 |
GetAppStream(out as appstream); |
| 136 |
GetVersion(out s version); |
| 137 |
ListFeatures(in t flags, |
| 138 |
out as features); |
| 139 |
DescribeFeature(in s feature, |
| 140 |
in t flags, |
| 141 |
out s json); |
| 142 |
SetFeatureEnabled(in s feature, |
| 143 |
in i enabled, |
| 144 |
in t flags); |
| 145 |
properties: |
| 146 |
@org.freedesktop.DBus.Property.EmitsChangedSignal("const") |
| 147 |
readonly s Class = '...'; |
| 148 |
@org.freedesktop.DBus.Property.EmitsChangedSignal("const") |
| 149 |
readonly s Name = '...'; |
| 150 |
@org.freedesktop.DBus.Property.EmitsChangedSignal("const") |
| 151 |
readonly s Path = '...'; |
| 152 |
}; |
| 153 |
interface org.freedesktop.DBus.Peer { ... }; |
| 154 |
interface org.freedesktop.DBus.Introspectable { ... }; |
| 155 |
interface org.freedesktop.DBus.Properties { ... }; |
| 156 |
}; |
| 157 |
</programlisting> |
| 158 |
|
| 159 |
<!--Autogenerated cross-references for systemd.directives, do not edit--> |
| 160 |
|
| 161 |
<variablelist class="dbus-interface" generated="True" extra-ref="org.freedesktop.sysupdate1.Target"/> |
| 162 |
|
| 163 |
<variablelist class="dbus-interface" generated="True" extra-ref="org.freedesktop.sysupdate1.Target"/> |
| 164 |
|
| 165 |
<variablelist class="dbus-method" generated="True" extra-ref="List()"/> |
| 166 |
|
| 167 |
<variablelist class="dbus-method" generated="True" extra-ref="Describe()"/> |
| 168 |
|
| 169 |
<variablelist class="dbus-method" generated="True" extra-ref="CheckNew()"/> |
| 170 |
|
| 171 |
<variablelist class="dbus-method" generated="True" extra-ref="Acquire()"/> |
| 172 |
|
| 173 |
<variablelist class="dbus-method" generated="True" extra-ref="Install()"/> |
| 174 |
|
| 175 |
<variablelist class="dbus-method" generated="True" extra-ref="Vacuum()"/> |
| 176 |
|
| 177 |
<variablelist class="dbus-method" generated="True" extra-ref="GetAppStream()"/> |
| 178 |
|
| 179 |
<variablelist class="dbus-method" generated="True" extra-ref="GetVersion()"/> |
| 180 |
|
| 181 |
<variablelist class="dbus-method" generated="True" extra-ref="ListFeatures()"/> |
| 182 |
|
| 183 |
<variablelist class="dbus-method" generated="True" extra-ref="DescribeFeature()"/> |
| 184 |
|
| 185 |
<variablelist class="dbus-method" generated="True" extra-ref="SetFeatureEnabled()"/> |
| 186 |
|
| 187 |
<variablelist class="dbus-property" generated="True" extra-ref="Class"/> |
| 188 |
|
| 189 |
<variablelist class="dbus-property" generated="True" extra-ref="Name"/> |
| 190 |
|
| 191 |
<variablelist class="dbus-property" generated="True" extra-ref="Path"/> |
| 192 |
|
| 193 |
<!--End of Autogenerated section--> |
| 194 |
|
| 195 |
<refsect2> |
| 196 |
<title>Methods</title> |
| 197 |
|
| 198 |
<para><function>List()</function> returns a list of versions available for this target. Additional |
| 199 |
options may be passed through the <varname>flags</varname> argument. Valid flags are defined as follows: |
| 200 |
</para> |
| 201 |
|
| 202 |
<programlisting> |
| 203 |
#define SD_SYSUPDATE_OFFLINE (UINT64_C(1) << 0) |
| 204 |
</programlisting> |
| 205 |
|
| 206 |
<para>When <constant>SD_SYSUPDATE_OFFLINE</constant> is set, this method returns only the versions |
| 207 |
installed locally. Otherwise, this method pulls metadata from the network and returns all versions |
| 208 |
available for this target. Use <function>Describe()</function> to query more information about each |
| 209 |
version returned by this method.</para> |
| 210 |
|
| 211 |
<para><function>Describe()</function> returns all known information about a given version as a JSON |
| 212 |
object. The <varname>version</varname> argument is used to pass the version to be described. Additional |
| 213 |
options may be passed through the <varname>flags</varname> argument. This method supports the same flags |
| 214 |
as <function>List()</function>. The returned JSON object contains several known keys. More keys may be |
| 215 |
added in the future. The currently known keys are as follows:</para> |
| 216 |
|
| 217 |
<variablelist> |
| 218 |
<varlistentry> |
| 219 |
<term><literal>version</literal></term> |
| 220 |
<listitem><para>A string containing the version number.</para></listitem> |
| 221 |
</varlistentry> |
| 222 |
|
| 223 |
<varlistentry> |
| 224 |
<term><literal>newest</literal></term> |
| 225 |
<listitem><para>A boolean indicating whether this version is the latest available for the target.</para></listitem> |
| 226 |
</varlistentry> |
| 227 |
|
| 228 |
<varlistentry> |
| 229 |
<term><literal>available</literal></term> |
| 230 |
<listitem><para>A boolean indicating whether this version is available for download.</para></listitem> |
| 231 |
</varlistentry> |
| 232 |
|
| 233 |
<varlistentry> |
| 234 |
<term><literal>installed</literal></term> |
| 235 |
<listitem><para>A boolean indicating whether this version is installed locally.</para></listitem> |
| 236 |
</varlistentry> |
| 237 |
|
| 238 |
<varlistentry> |
| 239 |
<term><literal>obsolete</literal></term> |
| 240 |
<listitem><para>A boolean indicating whether this version is considered obsolete by the service, |
| 241 |
and is therefore disallowed from being installed.</para></listitem> |
| 242 |
</varlistentry> |
| 243 |
|
| 244 |
<varlistentry> |
| 245 |
<term><literal>protected</literal></term> |
| 246 |
<listitem><para>A boolean indicating whether this version is exempt from deletion by a |
| 247 |
<function>Vacuum()</function> operation.</para></listitem> |
| 248 |
</varlistentry> |
| 249 |
|
| 250 |
<varlistentry> |
| 251 |
<term><literal>incomplete</literal></term> |
| 252 |
<listitem><para>A boolean indicating whether this version is incomplete, which means that it is |
| 253 |
missing some file. Note that only installed incomplete versions will be offered by the service; |
| 254 |
versions that are incomplete on the server-side are completely ignored. Incomplete versions can |
| 255 |
be repaired in-place by calling <function>Acquire()</function> and <function>Install()</function> |
| 256 |
on that version.</para></listitem> |
| 257 |
</varlistentry> |
| 258 |
|
| 259 |
<varlistentry> |
| 260 |
<term><literal>changelogUrls</literal></term> |
| 261 |
<listitem><para>A list of strings that contain user-presentable URLs to change logs associated with |
| 262 |
this version.</para></listitem> |
| 263 |
</varlistentry> |
| 264 |
</variablelist> |
| 265 |
|
| 266 |
<para><function>CheckNew()</function> checks if a newer version is available for this target. This |
| 267 |
method pulls metadata from the network. If a newer version is found, this method returns the |
| 268 |
version number. If no newer version is found, this method returns an empty string. Use |
| 269 |
<function>Describe()</function> to query more information about the version returned by this method. |
| 270 |
</para> |
| 271 |
|
| 272 |
<para><function>Acquire()</function> downloads an update for this target, if one is available. If a |
| 273 |
<varname>new_version</varname> is specified, that is the version that gets downloaded. Otherwise, the |
| 274 |
latest version is downloaded. Call <function>Install()</function> to install the acquired update. |
| 275 |
The <varname>flags</varname> argument is added for future extensibility. No flags are currently |
| 276 |
defined, and the argument is required to be set to <literal>0</literal>. This method pulls both |
| 277 |
metadata and payload data from the network.</para> |
| 278 |
|
| 279 |
<para><function>Install()</function> installs an already-acquired update for this target. If a |
| 280 |
<varname>new_version</varname> is specified, that is the version that gets installed, assuming it has |
| 281 |
already been acquired. Otherwise, the latest acquired version is installed. The |
| 282 |
<varname>flags</varname> argument is added for future extensibility. No flags are currently defined, |
| 283 |
and the argument is required to be set to <literal>0</literal>.</para> |
| 284 |
|
| 285 |
<para>Unlike all the other methods in this interface, <function>Acquire()</function> and |
| 286 |
<function>Install()</function> do not wait for their jobs to complete. Instead, they return the job's |
| 287 |
numeric ID and object path as soon as the job begins, so that the caller can listen for progress |
| 288 |
updates or cancel the operation. These methods also return the version the target will be updated to, |
| 289 |
for cases where no version was specified by the caller. Listen for the Manager's |
| 290 |
<function>JobRemoved()</function> signal to detect when the job is complete.</para> |
| 291 |
|
| 292 |
<para><function>Vacuum()</function> deletes old installed versions of this target to free up space. |
| 293 |
It returns the number of instances that have been deleted.</para> |
| 294 |
|
| 295 |
<para><function>GetAppStream()</function> returns a list of HTTP/HTTPS URLs to this target's |
| 296 |
<ulink url="https://wwww.freedesktop.org/software/appstream/docs/chap-CatalogData.html">appstream catalog</ulink> |
| 297 |
XML files. If this target has no appstream catalogs, the method will return an empty list. These |
| 298 |
catalog files can be used by software centers (such as GNOME Software or KDE Discover) to present rich |
| 299 |
metadata about the target, including a display name, changelog, icon, and more. The returned catalogs |
| 300 |
will include <ulink url="https://systemd.io/APPSTREAM_BUNDLE">special metadata</ulink> to allow the |
| 301 |
software center to correctly associate the catalogs with this target.</para> |
| 302 |
|
| 303 |
<para><function>GetVersion()</function> returns the current version of this target, if any. The current |
| 304 |
version is the newest version that is installed. Note that this is not necessarily the same thing as the |
| 305 |
booted or currently-in-use version of the target. For example, on the host system the booted version |
| 306 |
is the current version most of the time, but if an update is installed and pending a reboot it will |
| 307 |
become the current version instead. You can query the booted version of the host system via |
| 308 |
<varname>IMAGE_VERSION</varname> in <filename>/etc/os-release</filename>. If the target has no current |
| 309 |
version, the function will return an empty string.</para> |
| 310 |
|
| 311 |
<para><function>ListFeatures()</function> returns a list of this target's optional features, by ID. |
| 312 |
The <varname>flags</varname> argument is added for future extensibility, and must be set to 0. |
| 313 |
If the target has no optional features, the method returns an empty array.</para> |
| 314 |
|
| 315 |
<para><function>DescribeFeature()</function> returns all known information about a given optional feature. |
| 316 |
The <varname>feature</varname> argument is used to pass the ID of the feature to be described. |
| 317 |
The <varname>flags</varname> argument is added for future extensibility, and must be set to 0. |
| 318 |
The returned JSON object contains several known keys. More keys may be added in the future. |
| 319 |
The currently known keys are as follows:</para> |
| 320 |
|
| 321 |
<variablelist> |
| 322 |
<varlistentry> |
| 323 |
<term><literal>name</literal></term> |
| 324 |
<listitem><para>A string containing the feature's name.</para></listitem> |
| 325 |
</varlistentry> |
| 326 |
|
| 327 |
<varlistentry> |
| 328 |
<term><literal>description</literal></term> |
| 329 |
<listitem><para>An optional string that contains a user-presentable description that identifies |
| 330 |
this feature</para></listitem> |
| 331 |
</varlistentry> |
| 332 |
|
| 333 |
<varlistentry> |
| 334 |
<term><literal>enabled</literal></term> |
| 335 |
<listitem><para>A boolean indicating whether this feature is enabled.</para></listitem> |
| 336 |
</varlistentry> |
| 337 |
|
| 338 |
<varlistentry> |
| 339 |
<term><literal>documentationUrl</literal></term> |
| 340 |
<listitem><para>An optional string that contains a user-presentable HTTP/HTTPS URL to documentation |
| 341 |
about this feature.</para></listitem> |
| 342 |
</varlistentry> |
| 343 |
|
| 344 |
<varlistentry> |
| 345 |
<term><literal>appstreamUrl</literal></term> |
| 346 |
<listitem><para>An optional string that contains an HTTP/HTTPS URL to an |
| 347 |
<ulink url="https://wwww.freedesktop.org/software/appstream/docs/chap-CatalogData.html">appstream |
| 348 |
catalog</ulink> XML file containing metadata about this feature.</para></listitem> |
| 349 |
</varlistentry> |
| 350 |
|
| 351 |
<varlistentry> |
| 352 |
<term><literal>transfers</literal></term> |
| 353 |
<listitem><para>An optional array of strings that list which transfer definitions belong to this |
| 354 |
feature.</para></listitem> |
| 355 |
</varlistentry> |
| 356 |
</variablelist> |
| 357 |
|
| 358 |
<para><function>SetFeatureEnabled()</function> writes an appropriate drop-in file to enable or disable |
| 359 |
the specified optional feature. |
| 360 |
If <varname>enable</varname> is zero, the feature is disabled. When greater than zero, the feature is |
| 361 |
enabled. When less than zero, the feature is reset to the distribution's default. |
| 362 |
The <varname>flags</varname> argument is added for future extensibility, and must be set to 0. |
| 363 |
The feature does not have to exist; this allows for graceful handling of masked features, and for |
| 364 |
preemptive decisions to be made about features that are planned to appear in future releases of the OS. |
| 365 |
The drop-in will have a filename of <literal>50-systemd-sysupdate-enabled.conf</literal>. |
| 366 |
This method only changes configuration files; to actually apply the changes, clients will need to |
| 367 |
call <function>Acquire()</function> and <function>Install()</function>. |
| 368 |
Depending on the exact needs of the client, it can choose to update the system to the latest available |
| 369 |
version, or it can extend the newest existing installation in-place (by passing in the version returned |
| 370 |
by <varname>GetVersion()</varname>). |
| 371 |
For now, this method only works with the <literal>host</literal> target.</para> |
| 372 |
|
| 373 |
</refsect2> |
| 374 |
|
| 375 |
<refsect2> |
| 376 |
<title>Properties</title> |
| 377 |
|
| 378 |
<para>The <varname>Class</varname> property exposes the class of this target, which describes |
| 379 |
where it was enumerated. Possible values include: <literal>machine</literal> for containers and |
| 380 |
virtual machines managed by |
| 381 |
<citerefentry><refentrytitle>systemd-machined.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, |
| 382 |
<literal>portable</literal> for <ulink url="https://systemd.io/PORTABLE_SERVICES">portable services</ulink>, |
| 383 |
<literal>sysext</literal> for system extensions managed by |
| 384 |
<citerefentry><refentrytitle>systemd-sysext</refentrytitle><manvolnum>8</manvolnum></citerefentry>, |
| 385 |
<literal>confext</literal> for configuration extensions managed by |
| 386 |
<citerefentry><refentrytitle>systemd-confext</refentrytitle><manvolnum>8</manvolnum></citerefentry>, |
| 387 |
<literal>component</literal> for components accepted by the <option>--component=</option> option of |
| 388 |
<citerefentry><refentrytitle>systemd-sysupdate</refentrytitle><manvolnum>8</manvolnum></citerefentry>, |
| 389 |
and <literal>host</literal> for the host system itself. At most one target will have a class of |
| 390 |
<literal>host</literal>.</para> |
| 391 |
|
| 392 |
<para>The <varname>Path</varname> property exposes more detail about where this target was found. |
| 393 |
For <literal>machine</literal>, <literal>portable</literal>, <literal>extension</literal>, and |
| 394 |
<literal>confext</literal> targets, this is the file path to the image. For <literal>component</literal> |
| 395 |
and <literal>host</literal> targets, this is the name of a |
| 396 |
<citerefentry><refentrytitle>sysupdate.d</refentrytitle><manvolnum>5</manvolnum></citerefentry> |
| 397 |
directory.</para> |
| 398 |
|
| 399 |
<para>The <varname>Name</varname> property exposes the name of this target. Note that the name is |
| 400 |
unique within a class but is not necessarily unique between classes. For instance, it is possible |
| 401 |
to have both a <literal>portable</literal> target named <literal>foobar</literal> and an |
| 402 |
<literal>extension</literal> target named <literal>foobar</literal>, but it is not possible to have |
| 403 |
two <literal>portable</literal> targets named <literal>foobar</literal>.</para> |
| 404 |
|
| 405 |
</refsect2> |
| 406 |
|
| 407 |
<refsect2> |
| 408 |
<title>Security</title> |
| 409 |
|
| 410 |
<para>Method calls on this service are authenticated via |
| 411 |
<ulink url="https://www.freedesktop.org/software/polkit/docs/latest/">polkit</ulink>.</para> |
| 412 |
|
| 413 |
<para><function>List()</function>, <function>Describe()</function>, and <function>CheckNew()</function> |
| 414 |
use the polkit action <interfacename>org.freedesktop.sysupdate1.check</interfacename>. |
| 415 |
By default, this action is permitted without administrator authentication. Cancellation of these |
| 416 |
methods uses the polkit action <interfacename>org.freedesktop.sysupdate1.cancel-check</interfacename>. |
| 417 |
By default, this cancellation action is permitted without administrator authentication.</para> |
| 418 |
|
| 419 |
<para><function>Acquire()</function> and <function>Install()</function> |
| 420 |
use the polkit action |
| 421 |
<interfacename>org.freedesktop.sysupdate1.update</interfacename> when no version is specified. |
| 422 |
By default, this action is permitted without administrator authentication. When a version is |
| 423 |
specified, <interfacename>org.freedesktop.sysupdate1.update-to-version</interfacename> is |
| 424 |
used instead. By default, this alternate action requires administrator authentication. Cancellation of |
| 425 |
these methods uses the polkit actions |
| 426 |
<interfacename>org.freedesktop.sysupdate1.cancel-update</interfacename> and |
| 427 |
<interfacename>org.freedesktop.sysupdate1.cancel-update-to-version</interfacename>. |
| 428 |
By default, these cancellation actions are permitted without administrator authentication.</para> |
| 429 |
|
| 430 |
<para><function>Vacuum()</function> uses the polkit action |
| 431 |
<interfacename>org.freedesktop.sysupdate1.vacuum</interfacename>. By default, this action requires |
| 432 |
administrator authentication. Cancellation of this method uses the polkit action |
| 433 |
<interfacename>org.freedesktop.sysupdate1.cancel-vacuum</interfacename>. |
| 434 |
By default, this cancellation action is permitted without administrator authentication.</para> |
| 435 |
|
| 436 |
<para><function>SetFeatureEnabled()</function> uses the polkit action |
| 437 |
<interfacename>org.freedesktop.sysupdate1.manage-features</interfacename>. By default, this action |
| 438 |
requires administrator authentication. Cancellation is not supported for this method.</para> |
| 439 |
|
| 440 |
<para><function>GetAppStream()</function>, <function>GetVersion()</function>, |
| 441 |
<function>ListFeatures()</function>, and <function>DescribeFeature()</function> |
| 442 |
are unauthenticated and may be called by anybody. Cancellation is not supported for these methods, or |
| 443 |
is always allowed without administrator authentication.</para> |
| 444 |
|
| 445 |
<para>All methods called on this interface expose additional variables to the polkit rules. |
| 446 |
<literal>class</literal> contains the class of the Target being acted upon, and <literal>name</literal> |
| 447 |
contains the name of the same Target. Additionally, each method exposes its arguments to the |
| 448 |
rule. Flags are mapped as follows:</para> |
| 449 |
|
| 450 |
<itemizedlist> |
| 451 |
<listitem><para><constant>SD_SYSUPDATE_OFFLINE</constant> → <literal>update</literal></para></listitem> |
| 452 |
</itemizedlist> |
| 453 |
|
| 454 |
</refsect2> |
| 455 |
</refsect1> |
| 456 |
|
| 457 |
<refsect1> |
| 458 |
<title>The Job Object</title> |
| 459 |
|
| 460 |
<para>A job is an ongoing operation, started by one of the methods on a Target object.</para> |
| 461 |
|
| 462 |
<para>The service exposes the following interfaces on Job objects on the bus:</para> |
| 463 |
|
| 464 |
<programlisting executable="systemd-sysupdated" node="/org/freedesktop/sysupdate1/job/_1" interface="org.freedesktop.sysupdate1.Job"> |
| 465 |
node /org/freedesktop/sysupdate1/job/_1 { |
| 466 |
interface org.freedesktop.sysupdate1.Job { |
| 467 |
methods: |
| 468 |
Cancel(); |
| 469 |
properties: |
| 470 |
@org.freedesktop.DBus.Property.EmitsChangedSignal("const") |
| 471 |
readonly t Id = ...; |
| 472 |
@org.freedesktop.DBus.Property.EmitsChangedSignal("const") |
| 473 |
readonly s Type = '...'; |
| 474 |
@org.freedesktop.DBus.Property.EmitsChangedSignal("const") |
| 475 |
readonly b Offline = ...; |
| 476 |
readonly u Progress = ...; |
| 477 |
}; |
| 478 |
interface org.freedesktop.DBus.Peer { ... }; |
| 479 |
interface org.freedesktop.DBus.Introspectable { ... }; |
| 480 |
interface org.freedesktop.DBus.Properties { ... }; |
| 481 |
}; |
| 482 |
</programlisting> |
| 483 |
|
| 484 |
|
| 485 |
<!--Autogenerated cross-references for systemd.directives, do not edit--> |
| 486 |
|
| 487 |
|
| 488 |
<variablelist class="dbus-interface" generated="True" extra-ref="org.freedesktop.sysupdate1.Job"/> |
| 489 |
|
| 490 |
|
| 491 |
<variablelist class="dbus-interface" generated="True" extra-ref="org.freedesktop.sysupdate1.Job"/> |
| 492 |
|
| 493 |
|
| 494 |
<variablelist class="dbus-method" generated="True" extra-ref="Cancel()"/> |
| 495 |
|
| 496 |
|
| 497 |
<variablelist class="dbus-property" generated="True" extra-ref="Id"/> |
| 498 |
|
| 499 |
|
| 500 |
<variablelist class="dbus-property" generated="True" extra-ref="Type"/> |
| 501 |
|
| 502 |
|
| 503 |
<variablelist class="dbus-property" generated="True" extra-ref="Offline"/> |
| 504 |
|
| 505 |
|
| 506 |
<variablelist class="dbus-property" generated="True" extra-ref="Progress"/> |
| 507 |
|
| 508 |
|
| 509 |
<!--End of Autogenerated section--> |
| 510 |
|
| 511 |
|
| 512 |
<refsect2> |
| 513 |
<title>Methods</title> |
| 514 |
|
| 515 |
<para>The <function>Cancel()</function> method may be used to cancel the job. It takes no |
| 516 |
parameters.</para> |
| 517 |
</refsect2> |
| 518 |
|
| 519 |
<refsect2> |
| 520 |
<title>Properties</title> |
| 521 |
|
| 522 |
<para>The <varname>Id</varname> property exposes the numeric job ID of the job object.</para> |
| 523 |
|
| 524 |
<para>The <varname>Type</varname> property exposes the type of operation (one of: |
| 525 |
<literal>list</literal>, <literal>describe</literal>, <literal>check-new</literal>, |
| 526 |
<literal>acquire</literal>, <literal>install</literal>, <literal>vacuum</literal>, or |
| 527 |
<literal>describe-feature</literal>).</para> |
| 528 |
|
| 529 |
<para>The <varname>Offline</varname> property exposes whether the job is permitted to access |
| 530 |
the network or not.</para> |
| 531 |
|
| 532 |
<para>The <varname>Progress</varname> property exposes the current progress of the job as a value |
| 533 |
between 0 and 100. It is only available for <literal>acquire</literal> and <literal>install</literal> |
| 534 |
jobs; for all other jobs it is always 0.</para> |
| 535 |
</refsect2> |
| 536 |
|
| 537 |
<refsect2> |
| 538 |
<title>Security</title> |
| 539 |
|
| 540 |
<para><function>Cancel()</function> uses the polkit action that corresponds to the method |
| 541 |
that started this job. For instance, trying to cancel a <literal>list</literal> job will |
| 542 |
require polkit to permit the <interfacename>org.freedesktop.sysupdate1.check</interfacename> |
| 543 |
action.</para> |
| 544 |
</refsect2> |
| 545 |
</refsect1> |
| 546 |
|
| 547 |
<refsect1> |
| 548 |
<title>Examples</title> |
| 549 |
|
| 550 |
<example> |
| 551 |
<title>Introspect <interfacename>org.freedesktop.sysupdate1.Manager</interfacename> on the bus</title> |
| 552 |
|
| 553 |
<programlisting>$ gdbus introspect --system \ |
| 554 |
--dest org.freedesktop.sysupdate1 \ |
| 555 |
--object-path /org/freedesktop/sysupdate1 |
| 556 |
</programlisting> |
| 557 |
</example> |
| 558 |
|
| 559 |
<example> |
| 560 |
<title>Introspect <interfacename>org.freedesktop.sysupdate1.Target</interfacename> on the bus</title> |
| 561 |
|
| 562 |
<programlisting>$ gdbus introspect --system \ |
| 563 |
--dest org.freedesktop.sysupdate1 \ |
| 564 |
--object-path /org/freedesktop/sysupdate1/target/host |
| 565 |
</programlisting> |
| 566 |
</example> |
| 567 |
|
| 568 |
<example> |
| 569 |
<title>Introspect <interfacename>org.freedesktop.sysupdate1.Job</interfacename> on the bus</title> |
| 570 |
|
| 571 |
<programlisting>$ gdbus introspect --system \ |
| 572 |
--dest org.freedesktop.sysupdate1 \ |
| 573 |
--object-path /org/freedesktop/sysupdate1/job/_1 |
| 574 |
</programlisting> |
| 575 |
</example> |
| 576 |
</refsect1> |
| 577 |
|
| 578 |
<xi:include href="org.freedesktop.locale1.xml" xpointer="versioning"/> |
| 579 |
<refsect1> |
| 580 |
<title>History</title> |
| 581 |
<refsect2> |
| 582 |
<title>The Manager Object</title> |
| 583 |
<para><function>ListTargets()</function>, |
| 584 |
<function>ListJobs()</function>, |
| 585 |
<function>ListAppStream()</function>, and |
| 586 |
<function>JobRemoved()</function> were added in version 257.</para> |
| 587 |
</refsect2> |
| 588 |
<refsect2> |
| 589 |
<title>The Target Object</title> |
| 590 |
<para><function>List()</function>, |
| 591 |
<function>Describe()</function>, |
| 592 |
<function>CheckNew()</function>, |
| 593 |
<function>Acquire()</function>, |
| 594 |
<function>Install()</function>, |
| 595 |
<function>Vacuum()</function>, |
| 596 |
<function>GetAppStream()</function>, |
| 597 |
<function>GetVersion()</function>, |
| 598 |
<function>ListFeatures()</function>, |
| 599 |
<function>DescribeFeature()</function>, |
| 600 |
<function>SetFeatureEnabled()</function>, |
| 601 |
<varname>Class</varname>, |
| 602 |
<varname>Name</varname>, and |
| 603 |
<varname>Path</varname> were added in version 257.</para> |
| 604 |
</refsect2> |
| 605 |
<refsect2> |
| 606 |
<title>The Job Object</title> |
| 607 |
<para><function>Cancel()</function>, |
| 608 |
<varname>Id</varname>, |
| 609 |
<varname>Type</varname>, |
| 610 |
<varname>Offline</varname>, and |
| 611 |
<varname>Progress</varname> were added in version 257.</para> |
| 612 |
</refsect2> |
| 613 |
</refsect1> |
| 614 |
|
| 615 |
<refsect1> |
| 616 |
<title>See Also</title> |
| 617 |
<para><simplelist type="inline"> |
| 618 |
<member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member> |
| 619 |
<member><citerefentry><refentrytitle>systemd-sysupdated.service</refentrytitle><manvolnum>8</manvolnum></citerefentry></member> |
| 620 |
<member><citerefentry><refentrytitle>updatectl</refentrytitle><manvolnum>1</manvolnum></citerefentry></member> |
| 621 |
</simplelist></para> |
| 622 |
</refsect1> |
| 623 |
</refentry> |