Queries the update tasks of a device by update batch.

QPS limits

Each Alibaba Cloud account can run up to 10 queries per second (QPS).

Note The RAM users of an Alibaba Cloud account share the quota of the Alibaba Cloud account.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ListOTATaskByJob

The operation that you want to perform. Set the value to ListOTATaskByJob.

JobId String Yes 7glPHmaDYLAYMD1HHutT02****

The ID of the update batch. This ID uniquely identifies the update batch. You can obtain the ID from the value of the JobId parameter that is returned after you call the CreateOTAVerifyJob, CreateOTAStaticUpgradeJob, or CreateOTADynamicUpgradeJob operation. You can also view the batch ID on the Firmware Details page of 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.

Notice
  • If your instance has an ID, you must specify the ID for this parameter. Otherwise, the call fails.
  • If no Overview page or ID is generated for your instance, you do not need to configure this parameter.

For more information, see Overview.

PageSize Integer No 10

The number of entries to return on each page. Maximum value: 100.

Notice The product of the value of the CurrentPage parameter and the value of the PageSize parameter must be less than or equal to 100,000.
TaskStatus String No FAILED

If you specify a value for this parameter, only the update tasks that are in the specified state are queried. Valid values:

  • CONFIRM: The update task is pending confirmation.
  • QUEUED: The update notification is to be pushed.
  • NOTIFIED: The update notification is pushed to the device.
  • IN_PROGRESS: The update task is in progress.
  • SUCCEEDED: The update is successful.
  • FAILED: The update failed.
  • CANCELED: The update batch is canceled.

If you do not specify a value for this parameter, all update tasks of the specified batch are queried.

CurrentPage Integer No 1

The number of the page to return. Pages start from page 1.

Notice The product of the value of the CurrentPage parameter and the value of the PageSize parameter must be less than or equal to 100,000.
DeviceNames.N RepeatList No device1

The names of the devices that you want to query.

Note
  • You can specify up to 50 device names.
  • If you specify a value for this parameter, you do not need to configure the PageSize or CurrentPage parameter. If you specify values for the DeviceNames. N, PageSize, and CurrentPage parameters at the same time, the value of the DeviceNames.N parameter is used.

In addition to the preceding operation-specific request parameters, you must configure common request parameters when you call this operation. For more information, 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, see Error codes.

CurrentPage Integer 1

The number of the returned page.

Data Array of SimpleOTATaskInfo

The update task information returned if the call is successful. For more information, see SimpleOTATaskInfo.

SimpleOTATaskInfo
DestVersion String 1.0.1

The version of the destination over-the-air (OTA) update package.

DeviceName String testDevice2

The name of the device.

FirmwareId String q3j9OYBjUAZMv1hlMgdo03****

The ID of the update package.

IotId String nadRdeffljdEndlfadgadfse****

The ID of the device.

JobId String 7glPHmaDYLAYMD1HHutT02****

The ID of the update batch.

ProductKey String a1GUfrM****

The ProductKey of the product to which the device belongs.

ProductName String MyProduct

The name of the product to which the device belongs.

Progress String 0.00

The current update progress.

SrcVersion String 1.0.0

The firmware version before the update.

TaskDesc String report version is not conform

The description of the update task. This parameter displays an error message if the device update times out or the update task is canceled.

TaskId String y3tOmCDNgpR8F9jnVEzC01****

The ID of the update task.

TaskStatus String FAILED

The update status of the device.

  • CONFIRM: The update task is pending confirmation.
  • QUEUED: The update notification is to be pushed.
  • NOTIFIED: The update notification is pushed to the device.
  • IN_PROGRESS: The update task is in progress.
  • SUCCEEDED: The update is successful.
  • FAILED: The update failed.
  • CANCELED: The update batch is canceled.
Timeout String 1440

The timeout period of the device update. Unit: minutes.

Note If no timeout period is specified for the update batch, the return value is null.
UtcCreate String 2019-11-04T03:38:22.000Z

The time when the update task was created. The time is displayed in UTC.

UtcModified String 2019-11-04T03:38:22.000Z

The time when the update task was last modified. The time is displayed in UTC.

ErrorMessage String A system exception occurred.

The error message returned if the call fails.

PageCount Integer 1

The total number of pages returned.

PageSize Integer 10

The number of entries returned per page.

RequestId String A59D3BE1-E9A3-43F3-9B50-B7C8DE165D9B

The ID of the request.

Success Boolean true

Indicates whether the call was successful.

  • true: The call was successful.
  • false: The call failed.
Total Integer 2

The total number of update tasks.

Examples

Sample requests

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

Sample success responses

XML format

<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>
              <Timeout>1440</Timeout>
              <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>
              <Timeout>1000</Timeout>
              <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>A59D3BE1-E9A3-43F3-9B50-B7C8DE165D9B</RequestId>
  <CurrentPage>1</CurrentPage>
  <Success>true</Success>
  <Total>2</Total>
</ListOTATaskByJobResponse>

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",
      "Timeout":"1440",
      "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",
      "Timeout":"1000",
      "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
}