Cancels the device update tasks that are in the Pending Confirmation, To Be Pushed, Pushed, or In upgrade state of an over-the-air (OTA) update package.
Usage notes
You can call the CancelOTATaskByDevice operation to cancel only device update tasks that are in the Pending Confirmation, To Be Pushed, Pushed, or In upgrade state.
QPS limits
You can call this API operation up to 10 times per second per account.
The RAM users of an Alibaba Cloud account share the quota of the account.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
Action | String | Yes | CancelOTATaskByDevice | The operation that you want to perform. Set the value to CancelOTATaskByDevice. |
ProductKey | String | Yes | a1V4kde**** | The ProductKey of the product to which the device belongs. |
FirmwareId | String | Yes | T0F5b5tpFnHQrgfk****030100 | The unique ID of the OTA update package. After you call the CreateOTAFirmware operation to create an update package, an update package ID is returned. You can call the ListOTAFirmware operation and view the update package ID in the response. |
DeviceName.N | RepeatList | Yes | device1 | The list of device names that you want to query. Each device name in the list must be unique. You can specify up to 200 DeviceNames. |
JobId | String | No | wahVIzGkCMuAUE2gDERM02**** | The ID of the update batch. If you configure this parameter, only the device update tasks in the specified update batch are canceled. After you call the CreateOTAVerifyJob, CreateOTAStaticUpgradeJob, or CreateOTADynamicUpgradeJob operation to create a device update task, you can obtain the value of the JobId parameter. You can also view the batch ID on the Update Package Details page in the IoT Platform console. |
IotInstanceId | String | No | iot_instc_pu****_c*-v64******** | The ID of the instance. You can view the ID of the instance on the Overview page in the IoT Platform console. Important
For more information, see Overview. |
In addition to the preceding operation-specific request parameters, you must configure common request parameters when you call this operation. For more information about common request parameters, see Common request parameters.
Response parameters
Parameter | Type | Example | Description |
Code | String | iot.system.SystemException | The error code returned if the call fails. For more information about error codes, see Error codes. |
ErrorMessage | String | A system exception occurred. | The error message returned if the call fails. |
RequestId | String | A01829CE-75A1-4920-B775-921146A1AB79 | The ID of the request. |
Success | Boolean | true | Indicates whether the call was successful. Valid values:
|
Examples
Sample requests
https://iot.cn-shanghai.aliyuncs.com/?Action=CancelOTATaskByDevice
&FirmwareId=T0F5b5tpFnHQrgfk****030100
&ProductKey=a1V4kde****
&DeviceName.1=deviceName1
&DeviceName.2=deviceName2
&<Common request parameters>
Sample success responses
XML
format
<CancelOTATaskByDeviceResponse>
<RequestId>A01829CE-75A1-4920-B775-921146A1AB79</RequestId>
<Success>true</Success>
</CancelOTATaskByDeviceResponse>
JSON
format
{
"RequestId": "A01829CE-75A1-4920-B775-921146A1AB79",
"Success": true
}
Error codes
For a list of error codes, see Service error codes.