This is the multi-page printable view of this section. Click here to print.
Update Manager
1 - Update Manager API
Apply
Applies a desired state to the device.
Request
Hono Command: command//<name>:<namespace>/req//apply
Ditto Message:
Name Value Description topic <name>/<namespace>/things/live/messages/apply
Information about the affected Thing and the type of operation path /features/UpdateManager/inbox/messages/apply
A path to the UpdateManager
Feature, it’s message channel, andapply
commandHeaders Additional headers response-required true/false If response is required content-type application/json
The content type correlation-id container UUID Used for correlating protocol messages, the same correlation-id as the sent back response message Value activityId The activity id of the new desired state desiredState The desired state to be applied on a device baselines An array of domain or cross-domain dependencies between components title The title of the dependency description The description of the dependency preconditions The preconditions of the dependency components An array of the components of the dependency domains An array of desired state for a single domain id The id of this domain config An array of key/value string pair key The key string value The value of the key string components An array of desired state component with additional key-value configuration pairs id The id of the component version The version of the component key The key string value The value of the key string
Example : Apply a desired state to the device.
Topic: command//edge:device/req//apply
{
"topic":"edge/device/things/live/messages/apply",
"headers":{
"response-required":true,
"content-type":"application/json",
"correlation-id":"<UUID>"
},
"path":"/features/UpdateManager/inbox/messages/apply",
"value":{
"activityId": "d91ad6fe-9b0c-4549-bf31-17d0a71b61de",
"desiredState": {
"baselines": [
{
"title": "simple-baseline",
"description": "",
"precondition": "",
"components": [
"domain:component1",
"domain:component2"
]
}
],
"domains": [
{
"id": "containers",
"config": [
{
"key": "source",
"value": "value"
}
],
"components": [
{
"id": "containers:influxdb",
"version": "2.7.1",
"config": [
{
"key": "image",
"value": "docker.io/library/influxdb:$influxdb_version"
}
]
}
]
}
]
}
}
}
Response
Hono Command : command//<name>:<namespace>/res//apply
Ditto Message:
Name Value Description topic <name>/<namespace>/things/live/messages/apply
Information about the affected Thing and the type of operation path /features/UpdateManager/outbox/messages/apply
A path to the UpdateManager
Feature, it’s message channel, andapply
commandHeaders Additional headers content-type application/json
The content type correlation-id <UUID> The same correlation id as the request message Status Status of the operation apply
Example : Successful response of an apply
desired state operation.
Topic: command//edge:device/res//apply
{
"topic": "edge/device/things/live/messages/apply",
"headers": {
"content-type": "application/json",
"correlation-id": "<UUID>"
},
"path": "/features/UpdateManager/outbox/messages/apply",
"status": 204
}
Refresh
Reads the current state from the device and updates the status of the UpdateManager
feature.
Request
Hono Command: command//<name>:<namespace>/req//refresh
Ditto Message:
Name Value Description topic <name>/<namespace>/things/live/messages/refresh
Information about the affected Thing and the type of operation path /features/UpdateManager/inbox/messages/refresh
A path to the UpdateManager
Feature, it’s message channel, andrefresh
commandHeaders Additional headers response-required true/false If response is required content-type application/json
The content type correlation-id container UUID The container UUID Value activityId The activity id of the refresh
operation
Example : Update the status of the UpdateManager
feature.
Topic: command//edge:device/req//refresh
{
"topic": "edge/device/things/live/messages/refresh",
"headers": {
"response-required": true,
"content-type":" application/json",
"correlation-id": "<UUID>"
},
"path": "/features/UpdateManager/inbox/messages/refresh",
"value": {
"activityId": "e08b071c-c19e-41de-8da0-e2843113161f"
}
}
Response
Hono Command : command//<name>:<namespace>/res//refresh
Ditto Message:
Name Value Description topic <name>/<namespace>/things/live/messages/refresh
Information about the affected Thing and the type of operation path /features/UpdateManager/outbox/messages/refresh
A path to the UpdateManager
Feature, it’s message channel, andrefresh
commandHeaders Additional headers content-type application/json
The content type correlation-id <UUID> The same correlation id as the request message Status Status of the refresh
operation
Example : Successful response of a refresh
operation.
Topic: command//edge:device/res//refresh
{
"topic": "edge/device/things/live/messages/refresh",
"headers": {
"content-type": "application/json",
"correlation-id": "<UUID>"
},
"path": "/features/UpdateManager/outbox/messages/refresh",
"status": 204
}
2 - Update manager configuration
Properties
To control all aspects of the update manager.
Property | Type | Default | Description |
---|---|---|---|
General | |||
domain | string | device | The domain of the update manager, used as MQTT topic prefix |
domains | string | containers | A comma-separated list of domains handled by the update manager. This configuration option is available only as a flag, but not inside the JSON config file. In JSON config file, the keys inside the Domain agents structure serve as domain names. |
phaseTimeout | string | 10m | Timeout as duration string for completing an Update Orchestration phase |
rebootAfter | string | 30s | Time period as duration string to wait before a reboot process is initiated after successful update operation |
rebootEnabled | bool | true | Enable the reboot process after successful update operation |
reportFeedbackInterval | string | 1m | Time interval as duration string for reporting intermediate desired state feedback messages during an active update operation |
currentStateDelay | string | 30s | Time interval as duration string for reporting current state messages |
thingsEnabled | bool | true | Enable the Update Manager to behave as a thing’s feature |
ownerConsentCommands | []string | List of commands for which an owner consent should be granted. Possible values are: ‘DOWNLOAD’, ‘UPDATE’, ‘ACTIVATE’ | |
ownerConsentTimeout | string | 30m | Timeout as duration string to wait for owner consent" |
Domain agents | Holds a map structure (agents) with update agent configurations where each map key is treated as domain name | ||
readTimeout | string | 1m | Timeout as duration string for reading the current state for the domain |
rebootRequired | bool | false | Require a reboot for the domain after successful update |
Local connectivity | |||
broker | string | tcp://localhost:1883 | Address of the MQTT server/broker that the container manager will connect for the local communication, the format is: scheme://host:port |
keepAlive | string | 20s | Keep alive duration for the MQTT requests as duration string |
disconnectTimeout | string | 250ms | Disconnect timeout for the MQTT server/broker as duration string |
username | string | Username that is a part of the credentials | |
password | string | Password that is a part of the credentials | |
acknowledgeTimeout | string | 15s | Acknowledge timeout for the MQTT requests as duration string |
connectTimeout | string | 30s | Connect timeout for the MQTT server/broker as duration string |
subscribeTimeout | string | 15s | Subscribe timeout for the MQTT requests as duration string |
unsubscribeTimeout | string | 5s | Unsubscribe timeout for the MQTT requests as duration string |
Logging | |||
logFile | string | Path to the file where the update manager’s log messages are written | |
logLevel | string | INFO | All log messages at this or a higher level will be logged, the log levels in descending order are: ERROR, WARN, INFO, DEBUG and TRACE |
logFileCount | int | 5 | Log file maximum rotations count |
logFileMaxAge | int | 28 | Log file rotations maximum age in days, use 0 to not remove old log files |
logFileSize | int | 2 | Log file size in MB before it gets rotated |
Example
An example for configuring the update manager with two domains - containers
and custom-domain
, report feedback interval at 30 seconds, and log, written to custom log file update-manager.log
with
log level DEBUG
.
{
"log": {
"logFile": "update-manager.log",
"logLevel": "DEBUG"
},
"agents": {
"containers": {
"readTimeout": "30s"
},
"custom-domain": {
"rebootRequired": true
}
},
"reportFeedbackInterval": "30s"
}
Template
The configuration can be further adjusted according to the use case. The following template illustrates all possible properties with their default values.
{
"domain": "device",
"agents": {
"containers": {
"rebootRequired": false,
"readTimeout": "1m"
}
},
"log": {
"logFile": "",
"logLevel": "INFO",
"logFileCount": 5,
"logFileMaxAge": 28,
"logFileSize": 2
},
"connection": {
"broker": "tcp://localhost:1883",
"keepAlive": "20s",
"acknowledgeTimeout": "15s",
"username": "",
"password": "",
"connectTimeout": "30a",
"disconnectTimeout": "250ms",
"subscribeTimeout": "15s",
"unsubscribeTimeout": "5s"
},
"phaseTimeout": "10m",
"rebootAfter": "30s",
"rebootEnabled": true,
"reportFeedbackInterval": "1m",
"currentStateDelay": "30s",
"thingsEnabled": true,
"ownerConsentCommands": ["DOWNLOAD"]
}