Updated on 2026-01-29 GMT+08:00

Querying the Instance Task List

Function

This API is used to query the task list of an IoTDA instance.

Constraint: Only instance tasks within 180 days can be queried. The maximum number of instance tasks is 20.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    iotda:instance:queryTaskList

    List

    instance *

    • g:EnterpriseProjectId

    • g:ResourceTag/<tag-key>

    -

    -

URI

GET /v5/iot/{project_id}/iotda-instances/{instance_id}/tasks

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Parameter description: project ID. For details, see Obtaining a Project ID.

instance_id

Yes

String

Parameter description: instance ID.

Value: Enter up to 36 characters, including lowercase letters (a to f), digits, and hyphens (-).

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

offset

No

Integer

Parameter description: If offset is set to N, the query starts from the N+1 record after the last record in the previous query. The value is an integer ranging from 0 to 500. The default value is 0. If offset is set to 0, the output starts from the first record after the last record in the previous query. - To ensure API performance, you can use this parameter together with marker to turn pages. For example, if there are 50 records on each page, you can directly specify offset to jump to the specified page within page 1 and 11. If you want to view records displayed on pages 12 to 22, you need to use the marker value returned on page 11 as the marker value for the next query. Value: an integer ranging from 0 to 500. The default value is 0.

limit

No

Integer

Parameter description: number of records to display on each page.

Value: an integer ranging from 1 to 500. The default value is 500.

marker

No

String

ID of the last record in the previous query. The value is returned by the platform during the previous query. Records are queried in descending order of record IDs (the marker value). A newer record will have a larger ID. If marker is specified, only the records whose IDs are smaller than marker are queried. If marker is not specified, the query starts from the record with the largest ID, that is, the latest record. If all data needs to be queried in sequence, this parameter must be filled with the value of marker returned in the last query response each time.

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

page

Page object

Structure of the batch query result pagination. It defines page numbers, the number of records on each page, the total number of records, and ID of the last record on the current page.

tasks

Array of InstanceTask objects

Instance task list.

Table 4 Page

Parameter

Type

Description

count

Long

Total number of records that meet the filter criteria.

marker

String

ID of the last record in this query, which can be used in the next query.

Table 5 InstanceTask

Parameter

Type

Description

task_id

String

Parameter description: instance task ID.

Value: Enter up to 64 characters, including lowercase letters (a to f), digits, and hyphens (-).

type

String

Parameter description: instance task type.

Range:

  • CREATE: instance creation task

  • MODIFY: task for changing instance specifications

  • DELETE: instance deletion task

  • FREEZE: instance freezing task

  • UNFREEZE: instance unfreezing task

  • UPDATE_ACCESS_CONFIG: task for modifying instance access information

  • UPDATE_ALLOW_LISTS: task for modifying the instance access whitelist

  • OPEN_SNAT: task for enabling SNAT configuration of an instance

status

String

Parameter description: task status.

Range:

  • PENDING: The task is waiting to be executed.

  • RUNNING: The task is being executed.

  • SUCCESS: The task is executed successfully.

  • FAILED: The task fails to be executed.

status_detail

String

Parameter description: task status description.

create_time

String

Parameter description: time when the instance task is created. Format: yyyy-MM-dd'T'HH:mm:ss.SSS'Z'

start_time

String

Parameter description: time when the instance task starts. Format: yyyy-MM-dd'T'HH:mm:ss.SSS'Z'

end_time

String

Parameter description: time when the instance task ends. Format: yyyy-MM-dd'T'HH:mm:ss.SSS'Z'

target_config

TargetConfig object

The target specification of the instance.

operate_window

OperateWindow object

Instance maintenance time window. You can specify the time window during which the specifications are modified.

Table 6 TargetConfig

Parameter

Type

Description

flavor

Flavor object

Parameter description: specifications of an IoTDA instance.

charge_mode

String

Parameter description: payment mode of the instance.

Range:

  • prePaid: yearly/monthly

  • postPaid: pay-per-use

Table 7 Flavor

Parameter

Type

Description

type

String

Parameter description: specification name of the IoTDA instance to create. For details, see Specifications.

size

Integer

Parameter description: unit number of the standard IoTDA instances to create. For details, see Specifications. This parameter is mandatory when instance_type is set to standard.

Table 8 OperateWindow

Parameter

Type

Description

start_time

String

Parameter description: start time of the change time window. The value is UTC time in HH:mm format.

end_time

String

Parameter description: end time of the change time window. The value is UTC time in HH:mm format.

Example Requests

Queries the instance task list.

GET https://{endpoint}/v5/iot/{project_id}/iotda-instances/{instance_id}/tasks

Example Responses

Status code: 200

OK

{
  "page" : {
    "count" : 1,
    "marker" : 1805431584415871305
  },
  "tasks" : [ {
    "task_id" : "075f413d-a3bb-4243-974d-8eb9221c2df8",
    "type" : "CREATE",
    "status" : "SUCCESS",
    "create_time" : "2020-08-19T01:52:49.493Z",
    "start_time" : "2020-08-19T01:52:49.492Z",
    "end_time" : "2020-08-19T01:52:49.492Z",
    "target_config" : null,
    "operate_window" : null
  }, {
    "task_id" : "075f413d-a3bb-4243-974d-8eb9221c1234",
    "type" : "MODIFY",
    "status" : "PENDING",
    "create_time" : "2021-08-19T01:52:49.493Z",
    "start_time" : "2021-08-19T01:52:49.492Z",
    "end_time" : "2021-08-19T01:52:49.492Z",
    "target_config" : {
      "flavor" : {
        "type" : "iotda.standard.s2",
        "size" : 2
      }
    },
    "operate_window" : {
      "start_time" : "18:00",
      "end_time" : "22:00"
    }
  } ]
}

Status Codes

Status Code

Description

200

OK

400

Bad Request

401

Unauthorized

403

Forbidden

Error Codes

See Error Codes.