Queries the 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 10. 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 ListOTATaskByJob.
JobId String Yes The unique identifier of the update job.
TaskStatus String No If this parameter is specified, only update tasks that are in the specified status are queried.
  • QUEUED: The update is being queued.
  • NOTIFIED: The device has notified the server for an update.
  • IN_PROGRESS: The update is in progress.
  • SUCCEEDED: The update is successful.
  • FAILED: The update failed.

If you do not specify this parameter, all device update tasks under the specified update job are queried.

PageSize Integer Yes The number of update jobs to return on each page. Maximum value: 100
CurrentPage Integer Yes The starting page number of the result to be displayed. The page number starts from 1.
IotInstanceId String No The ID of the 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 generated by IoT Platform for the request.
Success Boolean Indicates whether the call was 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 information about error codes, see Error codes.
CurrentPage Integer The number of the current page.
PageSize Integer The number of device update tasks displayed on each page.
PageCount Integer The total number of pages returned.
Total Long The total number of update tasks.
Data List<SimpleOTATaskInfo> The task information returned when a call is successful. For more information, see the SimpleOTATaskInfo table.
Table 1. SimpleOTATaskInfo
Parameter Type Description
TaskId String The update task ID.
JobId String The ID of the update job.
FirmwareId String The firmware ID.
TaskStatus String The update status of the device.
  • QUEUED: The update is being queued.
  • NOTIFIED: The device has notified the server for an update.
  • IN_PROGRESS: The update is in progress.
  • SUCCEEDED: The update is successful.
  • FAILED: The update failed.
ProductKey String The key of the product to which the device belongs.
ProductName String The name of the product to which the device belongs.
DeviceName String The name of the device.
IotId String The device ID.
SrcVersion String The original firmware version of the device.
DestVersion String The firmware version after the update.
UtcCreate String The time when the update task was created in UTC.
UtcModified String The time when the update task was last modified in UTC.
TaskDesc String The description of the update task. This parameter displays an error message when the device update times out or the update task is canceled.
Progress String The current update progress.

Examples

Sample requests

https://iot.cn-shanghai.aliyuncs.com/?Action=ListOTATaskByJob
&JobId=7glPHmaDYLAYMD1HHutT02****
&PageSize=10
&CurrentPage=1
&<Common request parameters>

Sample responses

  • JSON format
    {
      "PageCount": 1,
      "Data": {
        "SimpleOTATaskInfo": [{
          "SrcVersion": "1.0.0",
          "DeviceName": "testDevice1",
          "FirmwareId": "q3j9OYBjUAZMv1hlMgdo03****",
          "IotId": "SR8FiTu1R9tlUR2V1bmi00105****",
          "ProductKey": "a1GUfrM****",
          "JobId": "7glPHmaDYLAYMD1HHutT02****",
          "TaskDesc": "report version is not conform",
          "DestVersion": "1.0.1",
          "UtcCreate": "2019-11-04T03:38:15.000Z",
          "UtcModified": "2019-11-04T03:38:15.000Z",
          "TaskStatus": "FAILED",
          "ProductName": "MyProduct",
          "TaskId": "y3tOmCDNgpR8F9jnVEzC01****",
          "Progress": "0.00"
        }, {
          "SrcVersion": "1.0.0",
          "DeviceName": "testDevice2",
          "FirmwareId": "q3j9OYBjUAZMv1hlMgdo03****",
          "IotId": "nadRdeffljdEndlfadgadfse****",
          "ProductKey": "a1GUfrM****",
          "JobId": "7glPHmaDYLAYMD1HHutT02****",
          "TaskDesc": "",
          "DestVersion": "1.0.1",
          "UtcCreate": "2019-11-04T03:38:22.000Z",
          "UtcModified": "2019-11-04T03:38:22.000Z",
          "TaskStatus": "SUCCEEDED",
          "ProductName": "MyProduct",
          "TaskId": "ZS9sNBb1ahsu6khqr9II01****",
          "Progress": "100.00"
        }]
      },
      "PageSize": 10,
      "RequestId": "A59D3BE1-E9A3-43F3-9B50-B7C8DE165D9B",
      "CurrentPage": 1,
      "Success": true,
      "Total": 2
    }
  • XML format
    <? xml version="1.0" encoding="utf-8"? >
    <ListOTATaskByJobResponse>
      <PageCount>1</PageCount>
      <Data>
        <SimpleOTATaskInfo>
          <SrcVersion>1.0.0</SrcVersion>
          <DeviceName>testDevice1</DeviceName>
          <FirmwareId>q3j9OYBjUAZMv1hlMgdo03****</FirmwareId>
          <IotId>SR8FiTu1R9tlUR2V1bmi00105****</IotId>
          <ProductKey>a1GUfrM****</ProductKey>
          <JobId>7glPHmaDYLAYMD1HHutT02****</JobId>
          <TaskDesc>report version is not conform</TaskDesc>
          <DestVersion>1.0.1</DestVersion>
          <UtcCreate>2019-11-04T03:38:15.000Z</UtcCreate>
          <UtcModified>2019-11-04T03:38:15.000Z</UtcModified>
          <TaskStatus>FAILED</TaskStatus>
          <ProductName>MyProduct</ProductName>
          <TaskId>y3tOmCDNgpR8F9jnVEzC01****</TaskId>
          <Progress>0.00</Progress>
        </SimpleOTATaskInfo>
        <SimpleOTATaskInfo>
          <SrcVersion>1.0.0</SrcVersion>
          <DeviceName>testDevice2</DeviceName>
          <FirmwareId>q3j9OYBjUAZMv1hlMgdo03****</FirmwareId>
          <IotId>nadRdeffljdEndlfadgadfse****</IotId>
          <ProductKey>a1GUfrM****</ProductKey>
          <JobId>7glPHmaDYLAYMD1HHutT02****</JobId>
          <TaskDesc></TaskDesc>
          <DestVersion>1.0.1</DestVersion>
          <UtcCreate>2019-11-04T03:38:22.000Z</UtcCreate>
          <UtcModified>2019-11-04T03:38:22.000Z</UtcModified>
          <TaskStatus>SUCCEEDED</TaskStatus>
          <ProductName>MyProduct</ProductName>
          <TaskId>ZS9sNBb1ahsu6khqr9II01****</TaskId>
          <Progress>100.00</Progress>
        </SimpleOTATaskInfo>
      </Data>
      <PageSize>10</PageSize>
      <RequestId>A01829CE-75A1-4920-B775-921146A1AB79</RequestId>
      <Success>true</Success>
      <CurrentPage>1</CurrentPage>
      <Total>2</Total>
    </ListOTATaskByJobResponse>