V2.1 Get Firmware File¶
Get the file of the specified firmware.
This API is available in EnOS 2.2.0 and above.
If you need to invoke this API after performing bulk updates to relevant files using other APIs, it is recommended to wait for about 2 seconds to avoid obtaining unupdated data.
Operation Permissions¶
Before invoking this API, ensure that the service account has been authorized the policy that includes the following service(s) and action permission(s). For how to authorize the service account, see Managing Service Accounts.
Required Service |
Required Operation Permission |
---|---|
Firmware |
Read |
Request Format¶
GET https://{apigw-address}/connect-service/v2.1/ota-firmwares?action=get
Request Parameters (URI)¶
Name |
Location(Path/Query) |
Mandatory/Optional |
Data Type |
Description |
---|---|---|---|---|
orgId |
Query |
Mandatory |
String |
The organization ID which the asset belongs to. How to get orgId>> |
firmwareId |
Query |
Mandatory |
String |
The firmware ID. |
Response Parameters¶
Name |
Data Type |
Description |
---|---|---|
data |
FirmwareInfo Struct |
The returned results of the firmware information. For details, see FirmwareInfo Struct. |
FirmwareInfo Struct ¶
Name |
Data Type |
Description |
---|---|---|
orgId |
String |
The organization ID. |
firmwareId |
String |
The firmware ID. |
productKey |
String |
The product key. |
name |
StringI18n |
The firmware name. |
version |
String |
The firmware version. |
desc |
String |
The firmware description. |
signMethod |
String |
The signature algorithm for the firmware file. |
sign |
String |
The fimware file signature. |
fileUrl |
String |
The firmware file identifier. |
fileSize |
String |
The size of the firmware file. |
enableVerification |
Boolean |
|
isVerified |
Boolean |
|
createTime |
Long |
The time when the firmware is created. |
firmwareTags |
Map (Key and Value are of String type) |
The firmware tags. |
maxAllowedForVerification |
Integer |
The maximum number of devices to be used to verify the firmware. |
minSuccessForVerified |
Integer |
The minimum number of successfully verified devices to pass the firmware verfication job. |
Error Codes¶
Code |
Message |
Description |
---|---|---|
24404 |
Firmware not found |
The firmware cannot be found. |
Samples¶
Request Sample¶
url: https://{apigw-address}/connect-service/v2.1/ota-firmwares?action=get&orgId=yourOrgId&firmwareId=yourFirmwareId
method: GET
Return Sample¶
{
"code":0,
"msg":"OK",
"requestId":"28da9093-400f-4eb1-8cdc-83e4ec77070d",
"data":{
"orgId":"yourOrgId",
"firmwareId":"yourFirmwareId",
"productKey":"BXwU4kMk",
"name":{
"defaultValue":"HC_TEST",
"i18nValue":{
}
},
"version":"2.0",
"desc":null,
"signMethod":"md5",
"sign":"fileSig",
"fileUrl":"enos-connect://file.zip",
"fileSize":1767,
"isVerified":false,
"enableVerification":false,
"createTime":1590746442378,
"firmwareTags": {
"tagKey":"tagValue"
},
"maxAllowedForVerification":5,
"minSuccessForVerified":2
}
}
SDK Samples¶
You can access the SDK samples for Connection Service on GitHub: