Get token for the device under upgrading (upgrading/downloading)
Request format:
GET
URL: http//ota.heclouds.com/ota/south/tasking
At present, “detect device upgrade task” can be used instead.
I only want to see examples!!!
Name | Format | Required or not | Description |
Content-Type | string | Yes | Must be application/json. |
Authorization | string | Yes | Security authentication information |
http request parameter
Name | Format | Required or not | Description |
dev_id | long | Yes | Device id |
type | int | Yes | 1:fota task, 2:sota task |
cdn | boolean | No | true|false, whether to return pull upgrade package ip |
Return Parameters
Name | Format | Description |
errno | int | Call error code, where 0 means success. |
error | string | Error description, where “succ” means success. |
data | json | Device-related information returned after interface is successfully called. See the Data Description Table. |
Data Description Table
Name | Format | Description |
target | string | Target version of upgrade task |
token | string | File address: ip:port/ota/download/{token} |
size | int | File size |
signal | int | The task is performed under the signal greater than this. |
power | int | The task is performed with the power larger than the value. |
retry | int | Times of retry |
interval | int | Retry interval |
md5 | string | Md5 code of upgrade file |
ipPort | string | Ip address pulling the upgrade package |
type | int | 1: complete package; 2: differential package |
Error Code Description
Error Codes | Description |
0 | Valid |
2 | Type parameter error. |
4 | Valid token not found, may be since there is no upgrade task, or the token of the upgrade task is expired. |
7 | OneNET internal error. |
12 | Token is expired and device upgrade process flow is ended. |
Request Parameter Example
{
"dev_id":6523,
"type":1,
"cdn": true
}
Return Example
{
"errno": 0,
"error":"succ",
"data":
{
"target":"1.2",
"token":"ota_5hc95SFeo5xJEnaNrste",
"size":123,
"signal":12,
"power":90,
"retry":10,
"interval":90,
"md5":"dfkdajkfd",
"ipPort":"172.19.3.3:8002",
"type":1
}
}