Queries the specific tasks of an update batch.
Limits
Each Alibaba Cloud account can run a maximum of 10 queries per second (QPS).
Debugging
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. After you call the CreateOTAVerifyJob, CreateOTAStaticUpgradeJob, or CreateOTADynamicUpgradeJob operation, you can obtain the JobId parameter. 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. This parameter is not required for public instances. However, the parameter is required for the instances that you have purchased. |
PageSize | Integer | No | 10 |
The number of entries returned per page. Maximum value: 100. |
TaskStatus | String | No | FAILED |
If you specify this parameter, only the update tasks that are in the specified status are queried.
If you do not specify 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. |
DeviceNames.N | RepeatList | No | device1 |
The list of device names that you want to query. Note
|
In addition to the preceding operation-specific request parameters, you must specify common request parameters when you call this API 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, see Error codes. |
CurrentPage | Integer | 1 |
The page 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 firmware version after the update. |
DeviceName | String | testDevice2 |
The name of the device. |
FirmwareId | String | q3j9OYBjUAZMv1hlMgdo03**** |
The ID of the firmware. |
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.
|
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 globally unique identifier that Alibaba Cloud generated for the request. |
Success | Boolean | true |
Indicates whether the call was successful.
|
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>
<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>
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
}
Error codes
For a list of error codes, visit the API Error Center.