Create an OTA job for batch verification or upgrading.
Request Parameters (Body)
The structure of the request parameter will vary according to whether you are creating a firmware verification task or a firmware upgrade task.
Upgrade Task
Name |
Mandatory/Optional |
Data Type |
Description |
name |
Optional |
StringI18n |
The job name. For more details on the structure and locales supported, see Internationalized name struct>> |
type |
Mandatory |
String |
The job type. Available options are as per the below.
|
upgradeScope |
Mandatory |
UpgradeScope Struct |
The scope of the upgrade. For more details, see UpgradeScope Struct>> |
upgradePolicy |
Mandatory |
String |
The upgrade policy. Available options are as per the below.
|
enableUpgradeRequest |
Mandatory |
Boolean |
true : Device can request for upgrade.
false : Device cannot request for upgrade.
|
upgradeTimeout |
Optional |
Long |
The timeout for the upgrade, which starts when the OTA task enters the “upgrading” state. The available range is between 300 to 172,800 seconds, with the default as 7,200. You can use the Search OTA Task API to search for the status of the OTA task. |
retryPolicy |
Optional |
RetryPolicy Struct |
The policy for retrying failed OTA tasks. Default is no retry. For more details, see RetryPolicy Struct>> |
schedulePolicy |
Optional |
SchedulePolicy Struct |
The schedule policy for the OTA task. By default, the task starts immediately and repeats daily from 00:00:00 to 23:59:59. For more details, see SchedulePolicy Struct>> |
maximumConcurrency |
Optional |
Integer |
The maximum number of concurrent upgrade tasks. The default value is 300. |
Firmware Verification Task
Name |
Mandatory/Optional |
Data Type |
Description |
name |
Optional |
StringI18n |
The job name. For more details on the structure and locales supported, see Internationalized name struct>> |
type |
Mandatory |
String |
The job type. Available options are as per the below.
|
upgradeScope |
Mandatory |
UpgradeScope Struct |
The scope of the upgrade. For more details, see UpgradeScope Struct>>. For firmware verification tasks, the value of the type parameter in this struct must be partial . |
upgradeTimeout |
Optional |
Long |
The timeout for the verification, which starts when the OTA task enters the “upgrading” state. The available range is between 300 to 172,800 seconds, with the default as 7,200. You can use the Search OTA Task API to search for the status of the OTA task. |
UpgradeScope Struct
Name |
Mandatory/Optional |
Data Type |
Description |
type |
Mandatory |
String |
The scope of the devices to be upgraded. Available options are as per the below.
total : Upgrade all devices whose firmware version number matches what is specified in versionNumbers .
partial : Out of all the devices whose firmware version number matches what is specified in versionNumbers , only upgrade/verify some of them. Specify which devices for firmware upgrade or verification by using the deviceKeys , attributes , tags , or assetTrees parameters in this struct.
|
versionNumbers |
Mandatory |
String Array |
The list of firmware version numbers. |
deviceKeys |
Optional |
String Array |
Specify the devices for firmware upgrade or verification via device keys. Only one of the parameters deviceKeys , attributes , tags , or assetTrees can be used to specify the device. |
attributes |
Optional |
Map (Key is of String type, and Value is of Object Array) |
Specify the devices for firmware upgrade or verification via the attributes and their corresponding values. Only one of the parameters deviceKeys , attributes , tags , or assetTrees can be used to specify the device. |
tags |
Optional |
Map (Key is of String type, and Value is of String Array) |
Specify the devices for firmware upgrade or verification via the device tags and their corresponding values. Only one of the parameters deviceKeys , attributes , tags , or assetTrees can be used to specify the device. |
assetTrees |
Optional |
AssetTreeScope Struct |
Specify the devices for firmware upgrade or verification via asset tree. Only one of the parameters deviceKeys , attributes , tags , or assetTrees can be used to specify the device. For more details, see AssetTreeScope Struct>> |
AssetTreeScope Struct
Name |
Mandatory/Optional |
Data Type |
Description |
treeId |
Mandatory |
String |
The asset tree ID. |
includedNotes |
Optional |
String Array |
The nodes in the asset tree. Specifying one node means all sub-nodes are included as well. Leave this blank to select the entire tree. |
RetryPolicy Struct
Name |
Mandatory/Optional |
Data Type |
Description |
enableRetry |
Optional |
Boolean |
true : Able to retry task if task fails.
false : Not able to retry task if task fails. Default is false.
|
retryInterval |
Mandatory if enableRetry is true |
Integer |
The retry interval after failure. |
retryCount |
Mandatory if enableRetry is true |
Integer |
The maximum number of retries. |
SchedulePolicy Struct
Name |
Mandatory/Optional |
Data Type |
Description |
isRepeatDaily |
Optional |
Boolean |
true : The task will repeat daily.
false : The task will not repeat daily. Default is false.
|
startTimestamp |
Mandatory |
Long |
The timestamp of the schedule start time. |
endTimestamp |
Mandatory |
Long |
The timestamp of the schedule end time. If isRepeatDaily is true ,the end time needs to be on the same day as startTimeStamp . |