Queries all firmware update tasks of a device.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ListOTAJobByDevice

The operation that you want to perform. Set the value to ListOTAJobByDevice.

CurrentPage Integer Yes 1

The number of the page to return. Pages start from page 1.

DeviceName String Yes light1

The name of the device.

FirmwareId String Yes FJFx8JzpnhpIsKftRjjm03****

The ID of the firmware. This parameter uniquely identifies the firmware.

A firmware ID is returned when you call the CreateOTAFirmware operation to create a firmware. You can call the ListOTAFirmware operation and view the firmware ID in the response.

PageSize Integer Yes 10

The number of entries to return on each page. Maximum value: 100.

ProductKey String Yes a19mzPZ****

The key of the product to which the device belongs.

IotInstanceId String No iot_instc_pu****_c*-v64********

The ID of the instance. This parameter is not required for public instances. However, the parameter is required for the instances that you have purchased.

In addition to the preceding exclusive request parameters, you must specify common request parameters when calling this API operation. For more information about common request parameters, see Common parameters.

Response parameters

Element Type Example Description
Code String MissingFirmwareId

The error code returned if the call failed.

CurrentPage Integer 1

The number of the returned page.

Data Array

The firmware information returned if the call was successful. For more information, see the following parameters in SimpleOTAJobInfo.

SimpleOTAJobInfo
FirmwareId String FJFx8JzpnhpIsKftRjjm03****

The ID of the firmware.

JobId String HvKuBpuk3rdk6E92CP****

The ID of the update task.

JobStatus String COMPLETED

The status of the update task. Valid values:

  • IN_PROGRESS: The task is running.
  • COMPLETE: The task is completed.
  • CANCELED: The task is canceled.
JobType String UPGRADE_FIRMWARE

The type of the task. Valid values:

  • VERIFY_FIRMWARE: firmware verification
  • UPGRADE_FIRMWARE: batch update
ProductKey String a19mzPZ****

The unique identifier of the product to which the firmware belongs.

SelectionType String STATIC

The policy of the update. Valid value:

  • DYNAMIC: dynamic update. This parameter value is returned when you call the CreateOTADynamicUpgradeJob operation to create an update task.
  • STATIC: static update. This parameter value is returned when you call the CreateOTAStaticUpgradeJob operation to create an update task.
TargetSelection String ALL

The scope of the update. Valid values:

  • ALL: complete update
  • SPECIFIC: specific update
  • GRAY: phased update
Note The parameter value ALL is returned when you call the CreateOTADynamicUpgradeJob operation to create an update task.
UtcCreate String 2019-12-28T02:43:10.000Z

The time when the task was created. The time is in UTC.

UtcEndTime String 2019-12-29T02:43:10.000Z

The time when the task was completed. The time is in UTC.

Note This parameter is returned only for update tasks that have been completed.
UtcModified String 2019-12-29T02:43:10.000Z

The time when the task was last modified. The time is in UTC.

UtcStartTime String 2019-12-29T02:43:10.000Z

The time when the task started. The time is in UTC.

ErrorMessage String FirmwareId is mandatory for this action

The error message returned if the call failed.

PageCount Integer 1

The total number of pages returned.

PageSize Integer 10

The number of entries returned per page.

RequestId String A01829CE-75A1-4920-B775-921146A1AB79

The globally unique ID that is generated by Alibaba Cloud for the request.

Success Boolean true

Indicates whether the call was successful. true indicates that the call was successful. false indicates that the call failed.

Total Integer 1

The total number of firmware files.

Samples

Sample requests

https://iot.cn-shanghai.aliyuncs.com/?Action=ListOTAJobByDevice
&FirmwareId=FJFx8JzpnhpIsKftRjjm03****
&ProductKey=a19mzPZ****
&DeviceName=light
&PageSize=10
&CurrentPage=1
&<Common request parameters>

Sample success responses

XML format

<ListOTAJobByDeviceResponse>
  <PageCount>1</PageCount>
  <Data>
        <SimpleOTAJobInfo>
              <SelectionType>STATIC</SelectionType>
              <TargetSelection>SPECIFIC</TargetSelection>
              <JobType>UPGRADE_FIRMWARE</JobType>
              <FirmwareId>FJFx8JzpnhpIsKftRjjm03****</FirmwareId>
              <UtcStartTime>2019-12-28T02:43:10.000Z</UtcStartTime>
              <ProductKey>a19mzPZ****</ProductKey>
              <JobId>HvKuBpuk3rdk6E92CPQN02****</JobId>
              <UtcModified>2019-12-28T02:43:10.000Z</UtcModified>
              <JobStatus>IN_PROGRESS</JobStatus>
              <UtcCreate>2019-12-28T02:43:10.000Z</UtcCreate>
        </SimpleOTAJobInfo>
  </Data>
  <PageSize>10</PageSize>
  <RequestId>5D58AC86-D5BF-4B39-834E-913E7F2C985D</RequestId>
  <CurrentPage>1</CurrentPage>
  <Success>true</Success>
  <Total>1</Total>
</ListOTAJobByDeviceResponse>

JSON format

{
  "PageCount": 1,
  "Data": {
    "SimpleOTAJobInfo": [{
      "SelectionType": "STATIC",
      "TargetSelection": "SPECIFIC",
      "JobType": "UPGRADE_FIRMWARE",
      "FirmwareId": "FJFx8JzpnhpIsKftRjjm03****",
      "UtcStartTime": "2019-12-28T02:43:10.000Z",
      "ProductKey": "a19mzPZ****",
      "JobId": "HvKuBpuk3rdk6E92CPQN02****",
      "UtcModified": "2019-12-28T02:43:10.000Z",
      "JobStatus": "IN_PROGRESS",
      "UtcCreate": "2019-12-28T02:43:10.000Z"
    }]
  },
  "PageSize": 10,
  "RequestId": "5D58AC86-D5BF-4B39-834E-913E7F2C985D",
  "CurrentPage": 1,
  "Success": true,
  "Total": 1
}

Error codes

For a list of error codes, visit the API Error Center.