V2.1 Cancel OTA Task¶
Cancel OTA tasks under the specified OTA job.
This API is available in EnOS 2.2.0 and above.
Operation Permissions¶
Before invoking this API, ensure that the service account has been authorized the policy that includes the following service(s) and action permission(s). For how to authorize the service account, see Managing Service Accounts.
Required Service |
Required Operation Permission |
---|---|
Firmware |
Control OTA |
Request Format¶
POST https://{apigw-address}/connect-service/v2.1/ota-jobs?action=cancelTask
Request Parameters (URI)¶
Name |
Location (Path/Query) |
Mandatory/Optional |
Data Type |
Description |
---|---|---|---|---|
orgId |
Query |
Mandatory |
String |
The organization ID which the asset belongs to. How to get orgId>> |
jobId |
Query |
Mandatory |
String |
The job ID. |
Request Parameters (Body)¶
Name |
Mandatory/Optional |
Data Type |
Description |
---|---|---|---|
deviceKeys |
Mandatory |
String Array |
The list of device keys for canceling the OTA task. |
Error Codes¶
Code |
Message |
Description |
---|---|---|
24404 |
Job not found |
The job cannot be found. |
24617 |
Job not running |
The task cannot be canceled as it is not running. |
24620 |
Only init or published tasks can be canceled |
Only init or published tasks can be canceled. |
Samples¶
Request Sample¶
url: https://{apigw-address}/connect-service/v2.1/ota-jobs?action=cancelTask&orgId=yourOrgId&jobId=yourJobId
method: POST
requestBody: {"deviceKeys":["deviceKey1","deviceKey2"]}
Return Sample¶
{
"code":0,
"msg":"OK",
"requestId":"3bdf31b4-e357-4d4c-8cf9-a40dc129a407",
"data":null
}
SDK Samples¶
You can access the SDK samples for Connection Service on GitHub: