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 |
QueryUpgradeTaskOutDTO queryUpgradeTask(String operationId, String accessToken) throws NorthApiException
|
Parameter Description
Parameter |
Mandatory or Optional |
Type |
Location |
Description |
---|---|---|---|---|
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. |
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. |
Response Parameters
QueryUpgradeTaskOutDTO structure
Parameter |
Type |
Description |
---|---|---|
operationId |
String |
Identifies the operation task. |
createTime |
String |
Indicates the time when the operation task was created. |
startTime |
String |
Indicates the time when the operation task was started. |
stopTime |
String |
Indicates the time when the operation task was stopped. |
operateType |
String |
Indicates the operation type.
|
targets |
OperateDevices |
Indicates the target devices on which the operation task is performed. For details, see OperateDevices structure. |
policy |
OperatePolicy |
Indicates the execution policy of the operation task. For details, see OperatePolicy structure. |
status |
String |
Indicates the status of the operation task.
|
staResult |
OperationStaResult |
Indicates operation result statistics. For details, see OperationStaResult structure. |
extendPara |
JsonString |
Indicates an extended parameter of the operation task. For details, see extendPara request parameter. |
Parameter |
Type |
Description |
---|---|---|
deviceGroups |
List<String> |
Indicates the device group name list. A maximum of 256 device groups are supported. Either this parameter or devices must be specified. |
deviceType |
String |
Indicates the device type. This parameter must be specified when a device group is specified. |
model |
String |
Indicates the device model. This parameter must be specified when a device group is specified. |
manufacturerName |
String |
Indicates the manufacturer name. This parameter must be specified when a device group is specified. |
devices |
List<String> |
Indicates the device ID list. A maximum of 256 devices are supported. Either this parameter or deviceGroups must be specified. |
Parameter |
Type |
Description |
---|---|---|
executeType |
String |
Indicates the execution type. The default value is now.
|
startTime |
String |
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 |
String |
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 |
Boolean |
Indicates whether the platform retries the task upon an execution failure. The default value is false.
|
retryTimes |
Integer |
Indicates the number of retries. The value ranges from 1 to 5. This parameter must be specified when retryType is set to true. |
Parameter |
Type |
Description |
---|---|---|
total |
Integer(64) |
Indicates the number of operated devices. |
wait |
Integer(64) |
Indicates the number of devices waiting to be operated. |
processing |
Integer(64) |
Indicates the number of devices that are being operated. |
success |
Integer(64) |
Indicates the number of devices that are operated successfully. |
fail |
Integer(64) |
Indicates the number of devices that fail to be operated. |
stop |
Integer(64) |
Indicates the number of devices that stop being operated. |
timeout |
Integer(64) |
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 |
Type |
Description |
---|---|---|
fileVersion |
String |
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. |
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. |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot