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 PHP SDK API Reference> Service API List> Device Upgrade> Querying the Result of a Specified Upgrade Task
Updated at: Feb 24, 2022 GMT+08:00

Querying the Result of a Specified Upgrade Task

Typical Scenario

After a device software or firmware upgrade task is created, an NA can call this API to query details about the upgrade task, including the configuration and execution status.

API Function

This API is used by an NA to query details about a software or firmware upgrade task, including the configuration and execution status.

API Description

1
public function queryUpgradeTask($operationId, $accessToken)

Parameter Description

Parameter

Mandatory or Optional

Location

Description

$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.

Response Parameters

QueryUpgradeTaskOutDTO

Parameter

Description

$operationId

Identifies an operation task.

$createTime

Indicates the time when the operation task was created.

$startTime

Indicates the time when the operation task was started.

$stopTime

Indicates the time when the operation task was stopped.

$operateType

Indicates the operation type.

  • firmware_upgrade
  • software_upgrade

$targets

Indicates the target devices on which the operation task is performed. For details, see OperateDevices structure.

$policy

Indicates the execution policy of the operation task. For details, see OperatePolicy structure.

$status

Indicates the status of the operation task.

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

$staResult

Indicates operation result statistics. For details, see OperationStaResult structure.

$extendPara

Indicates an extended parameter of the operation task. For details, see extendPara request parameter.

OperateDevices structure

Parameter

Description

$deviceGroups

Indicates the device group name list. A maximum of 256 device groups are supported.

Either this parameter or devices must be specified.

$deviceType

Indicates the device type.

This parameter must be specified when a device group is specified.

$model

Indicates the device model.

This parameter must be specified when a device group is specified.

$manufacturerName

Indicates the manufacturer name.

This parameter must be specified when a device group is specified.

$devices

Indicates the device ID list. A maximum of 256 devices are supported.

Either this parameter or deviceGroups must be specified.

OperatePolicy structure

Parameter

Description

$executeType

Indicates the execution type. The default value is now.

  • now: The upgrade task is executed now.
  • device_online: The upgrade task is executed when a device goes online.
  • custom: The execution type is customized.

$startTime

Indicates the start time of the operation task. This parameter must be specified when executeType is set to custom. The value is in the format of yyyyMMdd'T'HHmmss'Z'. An example value is 20151212T121212Z.

$endTime

Indicates the end time of the operation task. This parameter must be specified when executeType is set to custom. The value is in the format of yyyyMMdd'T'HHmmss'Z'. An example value is 20151212T121212Z.

$retryType

Indicates whether the platform retries the task upon an execution failure. The default value is false.

  • true: Retry is performed.
  • false: The platform does not retry the task.

$retryTimes

Indicates the number of retries. The value ranges from 1 to 5. This parameter must be specified when retryType is set to true.

OperationStaResult structure

Parameter

Description

$total

Indicates the number of operated devices.

$wait

Indicates the number of devices waiting to be operated.

$processing

Indicates the number of devices that are being operated.

$success

Indicates the number of devices that are operated successfully.

$fail

Indicates the number of devices that fail to be operated.

$stop

Indicates the number of devices that stop being operated.

$timeout

Indicates the number of devices that fail to be operated due to a timeout.

extendPara request parameter when operateType is set to softwareUpgrade or firmwareUpgrade

Parameter

Description

$fileVersion

Identifies the target version.

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