Bosch IoT Rollouts

Create an update

This workflow covers the following steps:

  • create a software module

  • upload an artifact

  • create a distribution set

  • assign a software module to a distribution set


Table of contents:

Introduction

After the device has been registered with Bosch IoT Rollouts, you can create the update you want to install on the device by using either the Management UIs or the Management API.

Via Management UI

When using the Management UI (part of the common Bosch IoT Suite UI), follow these steps:

Create a software module

Open the Software modules UI feature by selecting it from the left navigation and create your first software module by clicking the + icon on the top right.

Select OS type and fill in the other required information. Once created, the software module will appear on the list.

Upload an artifact

As a next step, select the newly created software module to open its details and artifacts views.

Click the + icon in the Artifacts view to upload one or multiples files (a.k.a. Artifacts) into your module.

For a detailed guide refer to Create a software module and Manage artifacts.

Create a distribution set

Now, a distribution set is required to package your software module(s).

To create one, go to the Distribution sets UI feature on the left navigation. Then, click on the + icon at the top right of the view.

Choose the same type as the type of your software module, i.e. OS only.

The type of the distribution set has to be the same as the type of the software module. Otherwise, the software module will not appear in the list, and you will not be able to assign it to the distribution set.

Assign the software module to the distribution set

As a final step, you have to assign your software module to your distribution set by clicking the Assign software modules icon images/confluence/download/thumbnails/1680491195/link.png and selecting the software module from the list.

images/confluence/download/attachments/1680491195/ro-getStarted-createUpdate-newUI.gif

Via Management UI (Classic)

Start creating an update by switching to the Upload view in the navigation and create your first software module of type OS by clicking on the plus icon images/confluence/download/thumbnails/1680491195/plus.png .

In a next step, you can upload one or multiples files (a.k.a. Artifacts) into your module. Now, a distribution set is required to package your module.

Therefore, go to the Distributions view in the navigation, click on the plus icon images/confluence/download/thumbnails/1680491195/plus.png and choose type OS ONLY.

In a final step, you have to assign your software module to your distribution set by dragging and dropping the former on the latter.

images/confluence/download/attachments/1680491195/creating_an_update.gif

Via Management API

Creating an update via the Management API requires four calls:

1: Create a software module

You start by creating a software module.

The respective replacement tokens are listed at Getting started > API Replacement Token.

$ curl 'https://<HOST>/rest/v1/softwaremodules' -u "<TENANT_ID>\<USERNAME>:<PASSWORD>" -i -X POST -H 'Content-Type: application/json;charset=UTF-8' -d'[{
"vendor" : "Example Ltd.",
"name" : "myOs",
"description" : "First version of MyOS.",
"type" : "os",
"version" : "1.0"
}]'
[
{
"createdBy": "CLD:83717175-0650-400a-b6f2-9a4a398fc07a",
"createdAt": 1530539254263,
"lastModifiedBy": "CLD:83717175-0650-400a-b6f2-9a4a398fc07a",
"lastModifiedAt": 1530539254263,
"name": "myOs",
"description": "First version of MyOS.",
"version": "1.0",
"type": "os",
"vendor": "Example Ltd.",
"deleted": false,
"_links": {
"self": {
"href": "https://<HOST>/rest/v1/softwaremodules/1500"
}
},
"id": 1500
}
]

2: Upload an artifact

Now you can upload files to your newly created software module (SM_ID=1500).

You can take any file you want or create a demo file by running the following command in your terminal

echo "This is a test update file." > example.file.

$ curl 'https://<HOST>/rest/v1/softwaremodules/<SM_ID>/artifacts' -u "<TENANT_ID>\<USERNAME>:<PASSWORD>" -i -X POST -H 'Content-Type: multipart/form-data' -F 'file=@example.file'
 
{
"createdBy": "CLD:83717175-0650-400a-b6f2-9a4a398fc07a",
"createdAt": 1530539803637,
"lastModifiedBy": "CLD:83717175-0650-400a-b6f2-9a4a398fc07a",
"lastModifiedAt": 1530539803637,
"hashes": {
"sha1": "d2e7291c2c52b87b2ee00983217e1bcc0909251f",
"md5": "b14f29fe8cea6b25e62a8e5c48b5a3a1"
},
"providedFilename": "example.file",
"size": 28,
"_links": {
"self": {
"href": "https://<HOST>/rest/v1/softwaremodules/1500/artifacts/335"
},
"download": {
"href": "https://api.eu1.bosch-iot-rollouts.com/rest/v1/softwaremodules/1500/artifacts/335/download"
}
},
"id": 335
}

3: Create a distribution set

In a third step, you have to create a distribution set which can be rolled out to a device.

$ curl 'https://<HOST>/rest/v1/distributionsets' -u "<TENANT_ID>\<USERNAME>:<PASSWORD>" -i -X POST -H 'Content-Type: application/json;charset=UTF-8' -d'[{
"requiredMigrationStep": false,
"name": "myOs-ds",
"description": "MyOS initial update",
"type": "os",
"version": "1.0",
"modules": [
{
"id": 1500
}
]
}]'
 
[
{
"createdBy": "CLD:83717175-0650-400a-b6f2-9a4a398fc07a",
"createdAt": 1530540407559,
"lastModifiedBy": "CLD:83717175-0650-400a-b6f2-9a4a398fc07a",
"lastModifiedAt": 1530540407559,
"name": "myOs-ds",
"description": "MyOS initial update",
"version": "1.0",
"modules": [
{
"createdBy": "CLD:83717175-0650-400a-b6f2-9a4a398fc07a",
"createdAt": 1530539254263,
"lastModifiedBy": "CLD:83717175-0650-400a-b6f2-9a4a398fc07a",
"lastModifiedAt": 1530539803644,
"name": "myOs",
"description": "First version of MyOS.",
"version": "1.0",
"type": "os",
"vendor": "Example Ltd.",
"deleted": false,
"_links": {
"self": {
"href": "https://<HOST>/rest/v1/softwaremodules/1500"
}
},
"id": 1500
}
],
"requiredMigrationStep": false,
"type": "os",
"complete": true,
"deleted": false,
"_links": {
"self": {
"href": "https://<HOST>/rest/v1/distributionsets/2829"
}
},
"id": 2829
}
]

4: Assign the software module to the distribution set

Finally, you have to assign the software module (SM_ID=1500), containing our update, to the distribution set (DS_ID=2829).

$ curl 'https://<HOST>/rest/v1/distributionsets/<DS_ID>/assignedSM' -u "<TENANT_ID>\<USERNAME>:<PASSWORD>" -i -X POST -H 'Content-Type: application/json;charset=UTF-8' -d '[{
"id": <SM_ID>
}]'