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.

  • productKey: supports arithmetic operators “=” and “in”.

  • isVerified: supports arithmetic operator “=”.

  • name: supports fuzzy inquiry of the specified language.

    • name like ‘xxx’: fuzzy inquiry of the default name, Chinese name, and English name.

    • name.default like ‘xxx’: fuzzy inquiry of the default name.

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 createTime. The maximum records per page is 200 but for optimal performance, it is recommended to have not more than 50 records per page. sorters is not supported to sort the response.For more details, see Pagination Request Struct.

Response Parameters

Note

For old firmware files, return product information. For new firmware files, do not return product information.

Name

Data Type

Description

data

Array of FirmwareInfo Structs

The list of firmwares. For details, see FirmwareInfo Struct.

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: