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!!!

http header

NameFormatRequired or notDescription
Content-TypestringYesMust be application/json.
AuthorizationstringYesSecurity authentication information

http request parameter

NameFormatRequired or notDescription
dev_idlongYesDevice id
typeintYes1:fota task, 2:sota task
cdnbooleanNotrue|false, whether to return pull upgrade package ip

Return Parameters

NameFormatDescription
errnointCall error code, where 0 means success.
error stringError description, where “succ” means success.
data jsonDevice-related information returned after interface is successfully called. See the Data Description Table.

Data Description Table

NameFormatDescription
targetstringTarget version of upgrade task
tokenstringFile address: ip:port/ota/download/{token}
sizeintFile size
signalintThe task is performed under the signal greater than this.
powerintThe task is performed with the power larger than the value.
retryintTimes of retry
intervalintRetry interval
md5stringMd5 code of upgrade file
ipPort stringIp address pulling the upgrade package
typeint1: complete package; 2: differential package

Error Code Description

Error CodesDescription
0Valid
2Type parameter error.
4Valid token not found, may be since there is no upgrade task, or the token of the upgrade task is expired.
7OneNET internal error.
12Token is expired and device upgrade process flow is ended.

Request Parameter Example

{
    "dev_id":6523,  //device id
    "type":1,       //1:fota task, 2:sota task
    "cdn": true     //whether to return pull upgrade package ip, optional
}

Return Example

{
    "errno": 0,
    "error":"succ",
    "data":
    {
        "target":"1.2", // target version of upgrade task.
        "token":"ota_5hc95SFeo5xJEnaNrste",//file address ip: ip:port/ota/download/{token}
           "size":123,//file size
           "signal":12,//the task is performed under the signal larger than this one 
           "power":90,//the task is performed with the power larger than the value 
           "retry":10,//number of times of retry
           "interval":90,//retry interval 
           "md5":"dfkdajkfd",//md5 of upgrade file.
           "ipPort":"172.19.3.3:8002", //ip of pull upgrade package
           "type":1 // 1: complete package, 2: differential package.
    }
}

个搜索结果,搜索内容 “

    0 个搜索结果,搜索内容 “