IoTIoT

Compute
Elastic Cloud Server
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
Domain Name Service
VPC Endpoint
Cloud Connect
Enterprise Switch
Security & Compliance
Anti-DDoS
Web Application Firewall
Host Security Service
Data Encryption Workshop
Database Security Service
Advanced Anti-DDoS
Data Security Center
Container Guard Service
Situation Awareness
Managed Threat Detection
Compass
Cloud Certificate Manager
Anti-DDoS Service
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GaussDB NoSQL
GaussDB(for MySQL)
Distributed Database Middleware
GaussDB(for openGauss)
Developer Services
ServiceStage
Distributed Cache Service
Simple Message Notification
Application Performance Management
Application Operations Management
Blockchain Service
API Gateway
Cloud Performance Test Service
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
DevCloud
ProjectMan
CodeHub
CloudRelease
CloudPipeline
CloudBuild
CloudDeploy
Cloud Communications
Message & SMS
Cloud Ecosystem
Marketplace
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP License Service
Support Plans
Customer Operation Capabilities
Partner Support Plans
Professional Services
enterprise-collaboration
Meeting
IoT
IoT
Intelligent EdgeFabric
DeveloperTools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Help Center> IoT> API Reference> Northbound API Reference> Device Upgrade> Querying Details About Subtasks of a Specified Task
Updated at: Feb 24, 2022 GMT+08:00

Querying Details About Subtasks of a Specified 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 Prototype

Method

GET

URL

https://server:port/iodm/northbound/v1.5.0/operations/{operationId}/subOperations?subOperationStatus={subOperationStatus}&pageNo={pageNo}&pageSize={pageSize}

Transport Protocol

HTTPS

Request Parameters

Parameter

Mandatory or Optional

Type

Location

Description

app_key

Mandatory

String

header

Identifies an application that can be accessed on the IoT platform. The value of this parameter is allocated by the IoT platform when the application is created on the platform.

Authorization

Mandatory

String

header

Indicates the authentication information for accessing the IoT platform. The value is Bearer {accessToken}, in which {accessToken} indicates the access token returned by the Authentication API.

operationId

Mandatory

String

path

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

subOperationStatus

Optional

String

query

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

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

pageNo

Optional

Integer(>=0)

query

Indicates the page number to be queried. The value is an integer greater than or equal to 0. The default value is 0, indicating that the first page is queried.

pageSize

Optional

Integer[1,100]

query

Indicates the number of records on each page. The value ranges from 1 to 100. The default value is 10.

Response Parameters

Status Code: 200 OK

Parameter

Type

Description

data

List<SubOperationInfo>

Indicates information about a subtask list.

pageNo

Integer(>=0)

Indicates the page number.

pageSize

Integer[1,100]

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

totalCount

Integer(>=0)

Indicates the total number of query results.

SubOperationInfo structure

Parameter

Type

Description

subOperationId

String

Identifies a subtask.

createTime

String

Indicates the time when the subtask is created. The time format is yyyyMMdd'T'HHmmss'Z'. An example value is 20151212T121212Z.

startTime

String

Indicates the time when the subtask is started. The time format is yyyyMMdd'T'HHmmss'Z'. An example value is 20151212T121212Z.

stopTime

String

Indicates the time when the subtask is stopped. The time format is yyyyMMdd'T'HHmmss'Z'. An example value is 20151212T121212Z.

operateType

String

Indicates the operation type.

  • firmware_upgrade
  • software_upgrade

deviceId

String

Uniquely identifies a device for which the subtasks are queried. The value of this parameter is allocated by the IoT platform during device registration.

status

String

Indicates the subtask status.

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

detailInfo

String

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

extendPara

Map<String, String>

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

Request Example

Method: GET
Request:
https://server:port/iodm/northbound/v1.5.0/operations/{operationId}/subOperations?subOperationStatus={subOperationStatus}&pageNo={pageNo}&pageSize={pageSize}
Header:
app_key: ******
Authorization: Bearer ******
Content-Type: application/json

Response Example

Response:
Status Code: 200 OK
Content-Type: application/json
Body:
{
  "totalCount": 1,
  "pageNo": 0,
  "pageSize": 1,
  "date": [
    {
      "subOperationId": "**********",
      "createTime": "20151212T121212Z",
      "startTime": "20151212T121212Z",
      "stopTime": null,
      "operateType": "software_upgrade",
      "deviceId": "**********",
      "status": "FAIL",
      "detailInfo": "The task failed to start, unable to find protocol service based on device information",
      "extendInfo": {
        "upgradeTime": null,
        "sourceVersion": null,
        "curVersion": "V1.1.10",
        "downloadTime": null,
        "targetVersion": null
      }
    }
  ]
}

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.

Did you find this page helpful?

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel