Querying Details of Subtasks of an Upgrade Task
Typical Scenario
After a device software or firmware upgrade task is created, the upgrade of each device involved in the task is a subtask (the number of subtasks is the same as that of the devices involved in the task). An application can call this API to query details about subtasks of the upgrade task to check their execution status.
API Function
This API is used by an application to query upgrade status of each device involved in a software or firmware upgrade task.
API Description
1 | QueryUpgradeSubTaskOutDTO queryUpgradeSubTask(QueryUpgradeSubTaskInDTO qustInDTO, String operationId, String accessToken) throws NorthApiException
|
Parameter Description
| Parameter | Mandatory or Optional | Type | Location | Description |
|---|---|---|---|---|
| qustInDTO | Mandatory | QueryUpgradeSubTaskInDTO structure | query | For details, see QueryUpgradeSubTaskInDTO structure. |
| operationId | Mandatory | String | path | Identifies an operation task. The value of this parameter is returned by the platform after the operation task is created. |
| accessToken | Mandatory | String | header | If the Periodically Refreshing a Token API is called, set this parameter to null. Otherwise, set this parameter to the accessToken obtained by the Authentication API. |
QueryUpgradeSubTaskInDTO structure
| Parameter | Mandatory or Optional | Type | Location | Description |
|---|---|---|---|---|
| subOperationStatus | Optional | String | query | Indicates subtask status. If this parameter is not specified, execution details of all subtasks under the operation task are queried.
|
| pageNo | Optional | Integer | query | Indicates the page number. Default value: 0
|
| pageSize | Optional | Integer | query | Indicates the number of records on each page. The value ranges from 1 to 100. The default value is 10. |
Response Parameters
QueryUpgradeSubTaskOutDTO structure
| Parameter | Type | Description |
|---|---|---|
| data | list<SubOperationInfo> | Indicates the subtask list. For details, see SubOperationInfo structure. |
| pageNo | long | Indicates the page number. |
| pageSize | long | Indicates the number of records to be displayed on each page. |
| totalCount | long | Indicates the total number of query results. |
| Parameter | Type | Description |
|---|---|---|
| subOperationId | String | Identifies a subtask. |
| createTime | String | Indicates the time when the subtask was created. |
| startTime | String | Indicates the time when the subtask was started. |
| stopTime | String | Indicates the time when the subtask was stopped. |
| operateType | String | Indicates the operation type.
|
| deviceId | String | Identifies a device on which the subtask is performed. |
| status | String | Indicates the subtask status.
|
| detailInfo | String | Indicates detailed description of the subtask status. In case of a failure, the value of this parameter is the failure cause. |
| extendInfo | JsonString | Indicates extended information of the subtask. The value of this parameter varies depending on the operation type. |
Error Codes
| HTTP Status Code | Error Code | Error Description | Remarks |
|---|---|---|---|
| 400 | 120015 | Bad request error. | A request error occurs. Recommended handling: Check whether the format of fileId carried in the API request is correct. |
| 400 | 123029 | The value of pageNo or pageSize exceeds the upper limit. | The value of pageNo or pageSize exceeds the upper limit. Recommended handling: Change the value of pageNo or pageSize to a valid value. |
| 403 | 1010009 | The application calls the API at a frequency that exceeds the flow control threshold. | The application calls the API at a frequency that exceeds the flow control threshold (100 calls per minute by default). Recommended handling: Contact IoT platform maintenance personnel to adjust the flow control threshold or control the API call frequency. |
| 403 | 1010005 | Invalid access token or application ID. | The access token is invalid. Recommended handling: Check whether accessToken carried in the API request is correct. |
| 404 | 123009 | The queried task does not exist. | The queried task does not exist. Recommended handling: Check whether operationId carried in the API request is correct. |
Last Article: Querying the Result of an Upgrade Task
Next Article: Querying the Upgrade Task List
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.