Cancels update tasks of a specified job.

Limits

The maximum number of queries per second (QPS) for a single Alibaba Cloud account to call this operation is 5. The quota is shared between the Alibaba Cloud account and RAM users.

Request parameters

Parameter Type Required Description
Action String Yes The operation that you want to perform. Set the value to CancelOTATaskByJob.
JobId String Yes The ID of the update job.

JobId is a response parameter that is returned by the CreateOTAStaticUpgradeJob or CreateOTADynamicUpgradeJob operation. You can also obtain the ID on the Firmware Details page of the IoT Platform console.

CancelScheduledTask Boolean No Specifies whether to cancel update tasks of a scheduled job. Valid values:
  • true: cancel.
  • false: do not cancel.

Default value: false.

You can create a scheduled job by calling the CreateOTAStaticUpgradeJob operation and specify the ScheduleTime parameter.

CancelQueuedTask Boolean No Specifies whether to cancel all the QUEUED tasks. Valid values:
  • true: cancel.
  • false: do not cancel.

Default value: false.

CancelNotifiedTask Boolean No Specifies whether to cancel all update tasks that are in the NOTIFIED state. Valid values:
  • true: cancel.
  • false: do not cancel.

If you do not specify this parameter, the default value false is used.

CancelInProgressTask Boolean No Specifies whether to cancel all IN_PROGRESS tasks. Valid values:
  • true: cancel.
  • false: do not cancel.

If you do not specify this parameter, the default value false is used.

IotInstanceId String No The ID of your IoT Platform instance. This parameter is not required for public instances. However, the parameter is required for the instances that you have purchased.
Common request parameters N/A Yes For more information about common request parameters, see Common parameters.

Response parameters

Parameter Type Description
RequestId String The globally unique ID that is generated by Alibaba Cloud for the request.
Success Boolean Indicates whether the call is successful. true indicates that the call was successful. false indicates that the call failed.
ErrorMessage String The error message returned if the call fails.
Code String The error code returned if the call fails. For more information about error codes, see Error codes.

Examples

Sample requests

https://iot.cn-shanghai.aliyuncs.com/?Action=CancelOTATaskByJob
&JobId=7glPHmaDYLAYMD1HHutT02****
&CancelScheduledTask=false
&CancelQueuedTask=true
&CancelInProgressTask=false
&Common request parameters

Sample success responses

  • JSON format
    {
      "RequestId": "291438BA-6E10-4C4C-B761-243B9A0D324F",
      "Success": true
    }
  • XML format
    <? xml version="1.0" encoding="utf-8"? >
    <CancelOTATaskByJobResponse>
      <RequestId>A01829CE-75A1-4920-B775-921146A1AB79</RequestId>
      <Success>true</Success>
    </CancelOTATaskByJobResponse>