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

Querying the Execution History of an Agent Job

Function

This API is used to query the execution history of an agent job.

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 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

rds:instance:update

write

-

-

rds:instance:modify

-

URI

  • URI format

    GET /v3/{project_id}/instances/{instance_id}/db-jobs/{job_id}/histories?offset={offset}&limit={limit}&run_status={run_status}

  • Parameter description
    Table 1 Parameters

    Parameter

    Mandatory

    Description

    project_id

    Yes

    Definition

    Project ID of a tenant in a region.

    To obtain the value, see Obtaining a Project ID.

    Constraints

    The value cannot be empty.

    Range

    N/A

    Default Value

    N/A

    instance_id

    Yes

    Definition

    Instance ID.

    Constraints

    The value cannot be empty.

    Range

    N/A

    Default Value

    N/A

    job_id

    Yes

    Definition

    Job ID.

    Constraints

    The value cannot be empty.

    Range

    N/A

    Default Value

    N/A

    offset

    No

    Definition

    Index offset. The query starts from the next piece of data indexed by this parameter.

    Constraints

    N/A

    Range

    The value must be a non-negative number.

    Default Value

    0: The query starts from the first data record.

    limit

    No

    Definition

    Number of records returned by a query.

    Constraints

    N/A

    Range

    1–100

    Default Value

    10

    run_status

    No

    Definition

    Job execution status.

    Constraints

    N/A

    Range

    • failed
    • succeeded
    • retrying
    • canceled
    • in_progress
    • null: This parameter is not specified.

    Default Value

    null

Request

  • Request parameters

    None

  • URI example

    GET https://{Endpoint}/v3/0483b6b16e954cb88930a360d2c4e663/instances/72ee4cc4607347049df9ad50f615bbd8in04/db-jobs/0C6A3BC7-D2D5-41C2-BA3A-012DC43C4CD5/histories?offset=0&limit=10&run_status=succeeded

Response

  • Normal response
    Table 2 Parameters

    Parameter

    Type

    Description

    historys

    Array of objects

    Definition

    List of historical execution records.

    For details, see Table 3.

    total_count

    Integer

    Definition

    Total number of historical execution records.

    Range

    N/A

    Table 3 historys element structure description

    Parameter

    Type

    Description

    history_id

    String

    Definition

    Historical record ID.

    Range

    N/A

    run_status

    String

    Definition

    Job execution status.

    Range

    • failed
    • succeeded
    • retrying
    • canceled
    • in_progress

    run_time

    String

    Definition

    Latest execution time, in the format of yyyy-mm-ddThh:mm:ssZ. 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

    run_duration

    String

    Definition

    Job execution duration, in the format of hh:mm:ss.

    Range

    N/A

    message

    String

    Definition

    Execution information.

    Range

    N/A

  • Example normal response
    {
        "histories": [
            {
                "history_id": "41005",
                "run_time": "2025-11-14T11:04:00+0000",
                "run_status": "succeeded",
                "run_duration": "00:00:00",
                "message": "The job succeeded.  The Job was invoked by Schedule 10 (Replication agent schedule.).  The last step to run was step 1 (Run agent.)."
            },
            {
                "history_id": "40981",
                "run_time": "2025-11-14T10:55:00+0000",
                "run_status": "succeeded",
                "run_duration": "00:00:00",
                "message": "The job succeeded.  The Job was invoked by Schedule 10 (Replication agent schedule.).  The last step to run was step 1 (Run agent.)."
            }
        ],
        "total_count": 2
    }
  • Abnormal response

    For details, see Abnormal Request Results.

Status Code

Error Code

For details, see Error Codes.