V2.1 Search Firmware File¶
Search for firmware files under an OU based on the search criteria.
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¶
POST https://{apigw-address}/connect-service/v2.1/ota-firmwares?action=search
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>> |
Request Parameters (Body)¶
Name |
Mandatory/Optional |
Data Type |
Description |
---|---|---|---|
expression |
Optional |
String |
The query expression, which supports sql-like query. The supported query fields are as per the below.
|
pagination |
Optional |
Pagination Request Struct |
Lists the paging requirements in a request. When not specified, 10 records are displayed per page by default and sorted in descending order by |
Response Parameters¶
Name |
Data Type |
Description |
---|---|---|
data |
Array of FirmwareInfo Structs |
The list of firmwares. 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¶
For the description of error codes, see Common Error Codes.
Samples¶
Request Sample¶
url: https://{apigw-address}/connect-service/v2.1/ota-firmwares?action=search&orgId=yourOrgId
method: POST
requestBody:
{
"expression":"productKey='yourProductKey'",
"pagination":{
"pageNo":1,
"pageSize":5
}
}
Return Sample¶
{
"code":0,
"msg":"OK",
"requestId":"dc5d94aa-b021-4631-9def-2404d02d30a5",
"data":[
{
"orgId":"o15475466766371",
"firmwareId":"5ede13577072bf001f23de83",
"productKey":"BXwU4kMk",
"name":{
"defaultValue":"ota_subdevice",
"i18nValue":{
}
},
"version":"2.6",
"desc":null,
"signMethod":"md5",
"sign":"fileSig1",
"fileUrl":"enos-connect://file1.zip",
"fileSize":1767,
"isVerified":false,
"enableVerification":false,
"createTime":1591612247588,
"firmwareTags": {
"tagKey":"tagValue"
},
"maxAllowedForVerification":5,
"minSuccessForVerified":2
},
{
"orgId":"o15475466766371",
"firmwareId":"5ed49964a19bac001bcdb84e",
"productKey":"BXwU4kMk",
"name":{
"defaultValue":"validateTest",
"i18nValue":{
}
},
"version":"validate2.0",
"desc":null,
"signMethod":"md5",
"sign":"fileSig2",
"fileUrl":"enos-connect://file2.zip",
"fileSize":1767,
"isVerified":true,
"enableVerification":false,
"createTime":1590991204702,
"firmwareTags": {
"tagKey":"tagValue"
},
"maxAllowedForVerification":5,
"minSuccessForVerified":3
},
{
"orgId":"o15475466766371",
"firmwareId":"5ed0ddb7646542001b3d1144",
"productKey":"BXwU4kMk",
"name":{
"defaultValue":"validatetest",
"i18nValue":{
}
},
"version":"3.0",
"desc":null,
"signMethod":"md5",
"sign":"fileSig3",
"fileUrl":"enos-connect://file3.zip",
"fileSize":1767,
"isVerified":true,
"enableVerification":false,
"createTime":1590746551873,
"firmwareTags": {
"tagKey":"tagValue"
},
"maxAllowedForVerification":2,
"minSuccessForVerified":2
},
{
"orgId":"o15475466766371",
"firmwareId":"5ed0dd4a646542001b3d113f",
"productKey":"BXwU4kMk",
"name":{
"defaultValue":"HC_TEST",
"i18nValue":{
}
},
"version":"2.0",
"desc":null,
"signMethod":"md5",
"sign":"fileSig4",
"fileUrl":"enos-connect://file4.zip",
"fileSize":1767,
"isVerified":false,
"enableVerification":false,
"createTime":1590746442378,
"firmwareTags": {
"tagKey":"tagValue"
},
"maxAllowedForVerification":6,
"minSuccessForVerified":3
}
],
"pagination":{
"sortedBy":null,
"pageNo":1,
"pageSize":5,
"totalSize":4
}
}
SDK Samples¶
You can access the SDK samples for Connection Service on GitHub: