V2.1 Get OTA Job


Get the details of an OTA job.


This API is available in EnOS 2.2.0 and above.

If you need to invoke this API after performing bulk updates to relevant OTA jobs 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 OTA

Request Format

GET https://{apigw-address}/connect-service/v2.1/ota-jobs?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>>
jobId Query Mandatory String The OTA job ID.

Response Parameters

Note

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

Name Data Type Description
data JobInfo Struct The details of the OTA job. For more information, see JobInfo Struct.

Error Codes

Code Message Description
24404 Job not found The job cannot be found.

Samples

Request Sample

url: https://{apigw-address}/connect-service/v2.1/ota-jobs?action=get&orgId=yourOrgId&jobId=yourJobId
method: GET

Return Sample

{
    "code":0,
    "msg":"OK",
    "requestId":"42fc4dcd-636b-48ac-a69b-4d2f95d0c3de",
    "data":{
        "orgId":"yourOrgId",
        "productKey":"yourProductKey",
        "jobId":"yourJobId",
        "name":{
            "defaultValue":"name",
            "i18nValue":{

            }
        },
        "firmwareId":"5ed0dd4a646542001b3d113f",
        "type":"upgrade",
        "enableUpgradeRequest":true,
        "upgradePolicy":null,
        "upgradeScope":{
            "type":"total",
            "versionNumbers":[
                "1.0"
            ],
            "deviceKeys":null,
            "attributes":null,
            "tags":null,
            "assetTrees":null
        },
        "startSchedule":null, //deprecated
        "endSchedule":null, //deprecated
        "status":"started",
        "createTime":1591171274788
    }
}

SDK Samples


You can access the SDK samples for Connection Service on GitHub: