Updated on 2025-09-01 GMT+08:00

Querying Instant Tasks

Function

This API is used to query instant tasks.

URI

  • URI format

    GET /v3/{project_id}/tasklist?offset={offset}&limit={limit}&id={id}&instance_id={instance_id}&order_id={order_id}&name={name}&status={status}&start_time={start_time}&end_time={end_time}

  • Parameter description
    Table 1 Parameters

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Definition

    Project ID of a tenant in a region.

    To obtain the value, see Obtaining a Project ID.

    Constraints

    N/A

    Range

    N/A

    Default Value

    N/A

    offset

    No

    Integer

    Definition

    Index offset.

    Constraints

    N/A

    Range

    The query starts from the next piece of data indexed by this parameter. The value must be a number and cannot be a negative number.

    Default Value

    0: The query starts from the first data record.

    limit

    No

    Integer

    Definition

    Number of records returned by a query.

    Constraints

    N/A

    Range

    The value must be a positive integer ranging from 1 to 50.

    Default Value

    10

    id

    No

    String

    Definition

    Task ID, which can be used for filtering.

    Constraints

    N/A

    Range

    N/A

    Default Value

    N/A

    instance_id

    No

    String

    Definition

    Instance ID, which can be used for filtering.

    Constraints

    N/A

    Range

    N/A

    Default Value

    N/A

    order_id

    No

    String

    Definition

    Order ID, which can be used for filtering.

    Constraints

    N/A

    Range

    N/A

    Default Value

    N/A

    name

    No

    String

    Definition

    Task name, which can be used for filtering.

    Constraints

    N/A

    Range

    N/A

    Default Value

    N/A

    status

    No

    String

    Definition

    Task status, which can be used for filtering.

    Constraints

    N/A

    Range

    • Running: The task is running.
    • Completed: The task is complete.
    • Failed: The task failed.

    Default Value

    N/A

    start_time

    No

    String

    Definition

    Task creation time, which can be used for filtering.

    Constraints

    If start_time is specified, end_time is mandatory. The value is in the UTC timestamp format.

    Range

    N/A

    Default Value

    N/A

    end_time

    No

    String

    Definition

    Task end time, which can be used for filtering.

    Constraints

    If start_time is specified, end_time is mandatory. The value is in the UTC timestamp format.

    Range

    N/A

    Default Value

    N/A

Request

None

Example Request

GET https://{Endpoint}/v3/54623db08b174c858ba779d2aa7923a3/tasklist?offset=1&limit=3&start_time=1747919701390&end_time=1748524501390

Response

  • Normal response
    Table 2 Parameters

    Parameter

    Type

    Description

    total_count

    Integer

    Definition

    Total number of tasks.

    Range

    N/A

    actions

    Array of strings

    Definition

    List of task names.

    Range

    N/A

    tasks

    Array of objects

    Definition

    Task list. For details, see Table 3.

    Table 3 schedule_tasks field description

    Parameter

    Type

    Description

    id

    String

    Definition

    Task ID.

    Range

    N/A

    name

    String

    Definition

    Task name.

    Range

    N/A

    instance_id

    String

    Definition

    Instance ID.

    Range

    N/A

    instance_name

    String

    Definition

    Instance name.

    Range

    N/A

    instance_status

    String

    Definition

    Instance status.

    Range

    • BUILD: The instance is being created.
    • CREATE FAIL: The instance failed to be created.
    • ACTIVE: The instance is normal.
    • FAILED: The instance is abnormal.
    • FROZEN: The instance is frozen.
    • MODIFYING: The instance is being scaled up.
    • REBOOTING: The instance is being rebooted.
    • RESTORING: The instance is being restored.
    • MODIFYING INSTANCE TYPE: The instance is being changed to primary/standby.
    • SWITCHOVER: A primary/standby switchover is being performed.
    • MIGRATING: The instance is being migrated.
    • BACKING UP: The instance is being backed up.
    • MODIFYING DATABASE PORT: The database port is being changed.
    • STORAGE FULL: The instance storage is full.

    order_id

    String

    Definition

    Order ID.

    Range

    N/A

    process

    String

    Definition

    Task progress, in percentage.

    Range

    0–100. If the task is in the Completed or Failed status, the value is an empty string.

    fail_reason

    String

    Definition

    Failure cause.

    Range

    N/A

    create_time

    String

    Definition

    Task creation time in the "yyyy-mm-ddThh:mm:ssZ" format.

    T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. For example, in the Beijing time zone, the time zone offset is shown as +0800.

    Range

    N/A

    end_time

    String

    Definition

    Planned task end time in the "yyyy-mm-ddThh:mm:ssZ" format.

    T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. For example, in the Beijing time zone, the time zone offset is shown as +0800.

    Range

    N/A

    status

    String

    Definition

    Task status.

    Range

    • Running: The task is running.
    • Completed: The task is complete.
    • Failed: The task failed.
  • Example normal response
    { 
      "tasks" : [ { 
        "id" : "676e9f17f9b74289883a44a47b8101f5", 
        "name" : "RestoreSqlserverInInstance", 
        "instance_id" : "4d00c7e9d22145deb889937a72b59c8ein01", 
        "instance_name" : "rds-local-scale", 
        "instance_status" : "FAILED", 
        "order_id" : "CS2506041000FOJXC", 
        "process" : "", 
        "create_time" : "2020-07-15T07:46:10+0000", 
        "end_time" : "2020-07-15T09:46:10+0000", 
        "status" : "Completed" 
      } ], 
      "actions" : [ "RestoreSqlserverInInstance" ], 
      "total_count" : 1 
    }
  • Abnormal response

    For details, see Abnormal Request Results.

Status Code

Error Code

For details, see Error Codes.