OTAClient QML Type

Main interface to the OTA functionality. More...

Import Statement: import QtOTAUpdate 1.0
Instantiates: QOTAClient

Properties

Signals

Methods

Detailed Description

OTAClient provides an API to execute OTA tasks. Offline operations include querying the booted and rollback system version details and atomically performing the rollbacks. Online operations include fetching a new system version from a remote server and atomically performing system updates.

Using this API is safe and won't leave the system in an inconsistent state, even if the power fails half-way through.

Note: Remote Configuration

A remote needs to be configured for a device to be able to locate a server that is hosting an OTA update. A Tech Preview release does not provide Qt API to configure remotes. To configure a remote, it is necessary to use the ostree command line tool. Examples for remote configurations:

No Security:

ostree remote add --no-gpg-verify qt-os http://${SERVER_ADDRESS}:${PORT}/ostree-repo linux/qt

Using GPG Signing:

ostree remote add --set=gpg-verify=true qt-os http://${SERVER_ADDRESS}:${PORT}/ostree-repo linux/qt

Using TLS Authentication:

ostree remote add \
--tls-client-cert-path /path/client.crt \
--tls-client-key-path /path/client.key \
--tls-ca-path /trusted/server.crt qt-os https://${SERVER_ADDRESS}:${PORT}/ostree-repo linux/qt

${SERVER_ADDRESS} - the server where you have exported the OSTree repository.

${PORT} - port number.

Property Documentation

[read-only] clientDescription : string

This is a convenience property that holds a string containing the booted system's description.

See also clientInfo.


[read-only] clientInfo : string

This property holds a JSON-formatted string containing the booted system's OTA metadata. Metadata is bundled with each system's version.


[read-only] clientRevision : string

This property holds a string containing the booted system's revision (a checksum in the OSTree repository).


[read-only] clientVersion : string

This is a convenience property that holds a string containing the booted system's version.

See also clientInfo.


[read-only] error : string

This property holds a string containing the last error occurred.


[read-only] initialized : bool

This property holds whether the object has completed the initialization.

When an object of this class is created, it asynchronously (from a non-GUI thread) pre-populates the internal state and sets this property accordingly, and signals initializationFinished().

Initialization is fast if there are no other processes locking access to the OSTree repository on a device. This could happen if there is some other process currently writing to the OSTree repository, for example, a daemon calling fetchServerInfo().

See also initializationFinished().


[read-only] otaEnabled : bool

This property holds whether a device supports OTA updates.


[read-only] restartRequired : bool

Holds a bool indicating whether reboot is required. Reboot is required after update() and rollback() to boot into the new default system.


[read-only] rollbackDescription : string

This is a convenience property that holds a string containing the rollback system's description.

See also rollbackInfo.


[read-only] rollbackInfo : string

This property holds a JSON-formatted string containing the rollback system's OTA metadata. Metadata is bundled with each system's version.

See also rollback().


[read-only] rollbackRevision : string

This property holds a string containing the rollback system's revision (a checksum in the OSTree repository).


[read-only] rollbackVersion : string

This is a convenience property that holds a string containing the rollback system's version.

See also rollbackInfo.


[read-only] serverDescription : string

This is a convenience property that holds a string containing the system's description on a server.

See also serverInfo.


[read-only] serverInfo : string

This property holds a JSON-formatted string containing OTA metadata for the system on a server. Metadata is bundled with each system's version.


[read-only] serverRevision : string

This property holds a string containing the system's revision on a server (a checksum in the OSTree repository).


[read-only] serverVersion : string

This is a convenience property that holds a string containing the system's version on a server.

See also serverInfo.


[read-only] updateAvailable : bool

Holds a bool indicating the availability of a system update. This information is cached - to update the local cache, call fetchServerInfo().

See also update().


Signal Documentation

errorOccurred(string error)

This signal is emitted when an error occurs. The error argument holds the error message.


fetchServerInfoFinished(bool success)

This is a notifier signal for fetchServerInfo(). The success argument indicates whether the operation was successful.


initializationFinished()

This signal is emitted when the object has finished initialization. Only after this signal has arrived, the object is ready for use.


restartRequiredChanged(bool required)

This signal is emitted when the value of restartRequired changes. The required argument holds whether reboot is required.


rollbackFinished(bool success)

This is a notifier signal for rollback(). The success argument indicates whether the operation was successful.


rollbackInfoChanged()

This signal is emitted when rollback info changes. Rollback info changes when calling rollback().


serverInfoChanged()

Server info can change when calling fetchServerInfo(). If OTA metadata on the server is different from the local cache, the local cache is updated and this signal is emitted.


updateAvailableChanged(bool available)

This signal is emitted when the value of updateAvailable changes. The available argument holds whether a system update is available for default system.


updateFinished(bool success)

This is a notifier signal for update(). The success argument indicates whether the operation was successful.


Method Documentation

bool fetchServerInfo()

Fetch OTA metadata from a server and update the local cache. This metadata contains information on what system version is available on a server. The cache is persistent as it is stored on the disk.

This method is asynchronous and returns immediately. The return value holds whether the operation was started successfully.

See also fetchServerInfoFinished(), updateAvailable, and serverInfo.


bool rollback()

Rollback to the previous system version.

This method is asynchronous and returns immediately. The return value holds whether the operation was started successfully.

See also rollbackFinished() and restartRequired.


bool update()

Fetch an OTA update from a server and perform the system update.

This method is asynchronous and returns immediately. The return value holds whether the operation was started successfully.

See also updateFinished(), fetchServerInfo, and restartRequired.


© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.