Help Center> IoT> API Reference> Northbound PHP SDK API Reference> Service API List> Device Upgrade> Querying Details About Subtasks of a Specified Upgrade Task
Updated at: 2022-02-24 GMT+08:00

Querying Details About Subtasks of a Specified 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 NA 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 NA to query upgrade status of each device involved in a software or firmware upgrade task.

API Description

1
public function queryUpgradeSubTask($qustInDTO, $operationId, $accessToken)

Parameter Description

Parameter

Mandatory or Optional

Location

Description

$qustInDTO

Mandatory

query

For details, see QueryUpgradeSubTaskInDTO structure.

$operationId

Mandatory

path

Identifies an operation task. The value of this parameter is returned by the IoT platform after the operation task is created.

$accessToken

Mandatory

header

This parameter is set to the value of the access token obtained by calling the Authentication API.

QueryUpgradeSubTaskInDTO

Parameter

Mandatory or Optional

Location

Description

$subOperationStatus

Optional

query

Indicates subtask status. If this parameter is not specified, execution details of all subtasks under the operation task are queried.

  • wait: The operation task is waiting to be executed.
  • processing: The operation task is being executed.
  • fail: The subtask fails to be executed.
  • success: The operation task is successfully executed.
  • stop: The operation task stops being executed.

$pageNo

Optional

query

Indicates the page number. Default value: 0

  • If the value is null, pagination query is not performed.
  • If the value is an integer greater than or equal to 0, pagination query is performed.
  • If the value is 0, the first page is queried.

$pageSize

Optional

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

Description

$data

Indicates the subtask list information. For details, see SubOperationInfo.

$pageNo

Indicates the page number.

$pageSize

Indicates the number of records to be displayed on each page.

$totalCount

Indicates the total number of query results.

SubOperationInfo structure

Parameter

Description

$subOperationId

Identifies a subtask.

$createTime

Indicates the time when the subtask was created.

$startTime

Indicates the time when the subtask was started.

$stopTime

Indicates the time when the subtask was stopped.

$operateType

Indicates the operation type.

  • firmware_upgrade
  • software_upgrade

$deviceId

Identifies a device on which the subtask is performed.

$status

Indicates the subtask status.

  • wait: The operation task is waiting to be executed.
  • processing: The operation task is being executed.
  • fail: The subtask fails to be executed.
  • success: The operation task is successfully executed.
  • stop: The operation task stops being executed.

$detailInfo

Indicates detailed description of the subtask status. In case of a failure, the value of this parameter is the failure cause.

$extendInfo

Indicates extended information of the subtask. The value of this parameter varies depending on the operation type.

Error Code

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

pageNo or pageSize beyond the 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

app throttle exceed.

The NA 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

App_key or access_token is invalid.

The access token is invalid.

Recommended handling: Check whether accessToken carried in the API request is correct.

404

123009

The requested task does not exist.

The queried task does not exist.

Recommended handling: Check whether operationId carried in the API request is correct.

close