Messages sent to Bosch IoT Rollouts
Note: The DMF protocol uses the term “thing” for a device or in Bosch IoT Rollouts speech “provisioning target”. The terms can be considered as synonyms.
Messages sent to Rollouts (Client -> Rollouts)
All messages have to be sent to the exchange dmf.exchange.
THING_CREATED
Message to register and update a provisioning target.
| Header | Description | Type | Mandatory |
|---|---|---|---|
| type | Type of the message | Fixed string “THING_CREATED” | true |
| thingId | The ID of the registered provisioning target | String | true |
| sender | Name of the message sender | String | false |
| tenant | The tenant this provisioning target belongs to | String | false |
| Message Properties | Description | Type | Mandatory |
|---|---|---|---|
| content_type | The content type of the payload | String | true |
| reply_to | Exchange to reply to. The default is sp.direct.exchange which is bound to the sp_direct_queue | String | false |
Example headers and payload:
| Header | MessageProperties |
|---|---|
| type=THING_CREATED tenant=tenant123 thingId=abc sender=device | content_type=application/json reply_to (optional) =sp.connector.replyTo |
Payload Template (optional):
{
"name": "String",
"attributeUpdate": {
"attributes": {
"exampleKey1" : "exampleValue1",
"exampleKey2" : "exampleValue2"
},
"mode": "String"
}
}The "name" property specifies the name of the thing, which by default is the thing ID. This property is optional.
The "attributeUpdate" property provides the attributes of the thing, for details see UPDATE_ATTRIBUTES message. This property is optional.
THING_REMOVED
Message to request the deletion of a provisioning target.
| Header | Description | Type | Mandatory |
|---|---|---|---|
| type | Type of the message | Fixed string “THING_REMOVED” | true |
| thingId | The ID of the registered provisioning target | String | true |
| tenant | The tenant this provisioning target belongs to | String | false |
| Message Properties | Description | Type | Mandatory |
|---|---|---|---|
| content_type | The content type of the payload | String | true |
Example headers
| Header | MessageProperties |
|---|---|
| type=THING_REMOVED tenant=tenant123 thingId=abc | content_type=application/json |
UPDATE_ATTRIBUTES
Message to update target attributes. This message can be send in response to a REQUEST_ATTRIBUTES_UPDATE event, sent by Bosch IoT Rollouts.
See Messages sent by Bosch IoT Rollouts > REQUEST_ATTRIBUTES_UPDATE
| Header | Description | Type | Mandatory |
|---|---|---|---|
| type | Type of the message | Fixed string “EVENT” | true |
| topic | Topic name identifying the event | Fixed string “UPDATE_ATTRIBUTES” | true |
| thingId | The ID of the registered thing | String | true |
| tenant | The tenant this thing belongs to | String | false |
| Message Properties | Description | Type | Mandatory |
|---|---|---|---|
| content_type | The content type of the payload | String | true |
Example headers and payload:
| Header | MessageProperties |
|---|---|
| type=EVENT tenant=tenant123 thingId=abc topic=UPDATE_ATTRIBUTES | content_type=application/json |
Payload Template:
{
"attributes": {
"exampleKey1" : "exampleValue1",
"exampleKey2" : "exampleValue2"
},
"mode": "String"
}The "mode" property specifies the update mode that should be applied. This property is optional. Possible mode values:
| Value | Description |
|---|---|
| MERGE | The target attributes specified in the payload are merged into the existing attributes. This is the default mode that is applied if no "mode" property is specified in the payload. |
| REPLACE | The existing attributes are replaced with the target attributes specified in the payload. |
| REMOVE | The target attributes specified in the payload are removed from the existing attributes. |
UPDATE_ACTION_STATUS
Message to send an action status event to Bosch IoT Rollouts.
| Header | Description | Type | Mandatory |
|---|---|---|---|
| type | Type of the message | Fixed string “EVENT” | true |
| topic | Topic name identifying the event | Fixed string “UPDATE_ACTION_STATUS” | true |
| tenant | The tenant this thing belongs to | String | false |
| Message Properties | Description | Type | Mandatory |
|---|---|---|---|
| content_type | The content type of the payload | String | true |
Payload Template (the Java representation is ActionUpdateStatus):
{
"actionId": long,
"softwareModuleId": long,
"actionStatus":"String",
"code": int,
"message":["String"],
"timestamp": long
}NOTE
When the user consent flow feature has been enabled prior to the start of the action, the "softwareModuleId" field will not be used when handling the message as the confirmation will be per actionId.
Possible actionStatus values:
| Value | Description |
|---|---|
| DOWNLOAD | Device is downloading |
| DOWNLOADED | Device completed download |
| RETRIEVED | Device has retrieved the artifact |
| RUNNING | Update is running |
| CONFIRMED | User consent for the update has been granted. Applicable only if the user consent flow feature has been enabled prior to the start of the action. |
| DENIED | User consent for the update has been denied. Applicable only if the user consent flow feature has been enabled prior to the start of the action. |
| FINISHED | Update process finished successfully |
| ERROR | Error during update process |
| WARNING | Warning during update process |
| CANCELED | Cancel update process successfully |
| CANCEL_REJECTED | Cancel update process has been rejected |
Example header and payload:
| Header | MessageProperties |
|---|---|
| type=EVENT tenant=tenant123 topic=UPDATE_ACTION_STATUS | content_type=application/json |
{
"actionId":137,
"softwareModuleId":17,
"actionStatus":"DOWNLOAD",
"message":["The download has started"],
"timestamp": 1704070800000
}PING
Bosch IoT Rollouts allows DMF clients to check the availability of the DMF service. For this scenario DMF specifies a PING message that can be sent by the client:
| Header | Description | Type | Mandatory |
|---|---|---|---|
| type | Type of the message | Fixed string “PING” | true |
| tenant | The tenant the PING belongs to | String | false |
| Message Properties | Description | Type | Mandatory |
|---|---|---|---|
| correlationId | CorrelationId that allows the client to map a PING request to PING_RESPONSE | String | true |
UPDATE_AUTO_CONFIRM
Message to activate or deactivate auto confirmation sent from the device to Bosch IoT Rollouts.
| Header | Description | Type | Mandatory |
|---|---|---|---|
| type | Type of the message | Fixed string “EVENT” | true |
| topic | Topic name identifying the event | Fixed string “UPDATE_AUTO_CONFIRM” | true |
| thingId | The ID of the registered thing | String | true |
| tenant | The tenant the thing belongs to | String | true |
| Message Properties | Description | Type | Mandatory |
|---|---|---|---|
| content_type | The content type of the payload | String | true |
Use the following payload template to activate auto confirmation:
{
"enabled" : "true",
"initiator" : "user@test.com", <- (optional) e.g. a username from the customer system and will be persisted on every confirmed action
"remark" : "Activated due to test device." <- (optional) if provided and will be persisted on every confirmed action
}To deactivate auto confirmation send:
{
"enabled" : "false"
}