Queries all the update batches of a device by update package.

Limits

Each Alibaba Cloud account can run a maximum of 10 queries per second (QPS).

Note RAM users of an Alibaba Cloud account share the quota of the account.

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 DeviceName of the device.

FirmwareId String Yes FJFx8JzpnhpIsKftRjjm03****

The ID of the update package. The ID is the unique identifier for the update package.

An update package ID is returned when you call the CreateOTAFirmware operation to create the update package. You can call the ListOTAFirmware operation and view the update package 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 ProductKey of the product to which the device belongs.

IotInstanceId String No iot-cn-0pp1n8t****

The ID of the instance. You can view the instance ID on the Overview page in the IoT Platform console.

Notice
  • If your instance has an ID, you must configure this parameter. If you do not set this parameter, the call fails.
  • If your instance has no Overview page or ID, you do not need to set this parameter.

For more information, see Overview.

In addition to the preceding operation-specific request parameters, you must specify common request parameters when you call this operation. For more information, see Common request parameters.

Response parameters

Parameter Type Example Description
Code String MissingFirmwareId

The error code returned if the call fails. For more information, see Error codes.

CurrentPage Integer 1

The number of the returned page.

Data Array of SimpleOTAJobInfo

The update batch information returned if the call is successful. For more information, see the following SimpleOTAJobInfo parameter.

SimpleOTAJobInfo
FirmwareId String FJFx8JzpnhpIsKftRjjm03****

The ID of the update package.

JobId String HvKuBpuk3rdk6E92CP****

The ID of the update batch.

JobStatus String COMPLETED

The status of the update batch. Valid values:

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

The type of the task. Valid values:

  • VERFIY_FIRMWARE: update package verification.
  • UPGRADE_FIRMWARE: batch update.
ProductKey String a19mzPZ****

The ProductKey of the product to which the update package belongs.

SelectionType String STATIC

The update policy of the update batch. Valid values:

  • DYNAMIC: dynamic update. This value is returned if you call the CreateOTADynamicUpgradeJob API operation to create an update batch.
  • STATIC: static update. This value is returned if you call the CreateOTAStaticUpgradeJob API operation to create an update batch.
Tags Array of OtaTagDTO

The tags of the update batch.

OtaTagDTO
Key String key1

The key of each tag.

Value String value1

The value of the tag.

TargetSelection String ALL

The scope of the update. Valid values:

  • ALL: updates all devices.
  • SPECIFIC: updates specified devices.
  • GRAY: performs a phased update.
Note The value ALL is returned if you call the CreateOTADynamicUpgradeJob API operation to create an update batch.
UtcCreate String 2019-12-28T02:43:10.000Z

The time when the update batch was created. The time is displayed in UTC.

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

The end time of the update batch. The time is displayed in UTC.

Note This parameter is returned only after the update batch is 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 start time of the update batch. The time is in the UTC format.

ErrorMessage String FirmwareId is mandatory for this action

The error message returned if the call fails.

PageCount Integer 1

The total number of pages.

PageSize Integer 10

The number of entries returned per page.

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

The ID of the request.

Success Boolean true

Indicates whether the call was successful.

  • true: The call was successful.
  • false: The call failed.
Total Integer 1

The total number of update packages returned.

Examples

Sample requests

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

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.