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

Querying Agent Jobs

Function

This API is used to query agent jobs of a DB instance.

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?offset={offset}&limit={limit}&job_type={job_type}

  • 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

    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

    job_type

    No

    Definition

    Job type.

    Constraints

    N/A

    Range

    replication: publication and subscription jobs.

    Default Value

    replication

Request

  • Request parameters

    None

  • URI example

    GET https://{Endpoint}/v3/0483b6b16e954cb88930a360d2c4e663/instances/72ee4cc4607347049df9ad50f615bbd8in04/db-jobs?offset=0&limit=10&job_type=replication

Response

  • Normal response
    Table 2 Parameters

    Parameter

    Type

    Description

    jobs

    Array of objects

    Definition

    List of jobs.

    For details, see Table 3.

    total_count

    Integer

    Definition

    Total number of jobs.

    Range

    N/A

    Table 3 jobs element structure description

    Parameter

    Type

    Description

    job_id

    String

    Definition

    Job ID.

    Range

    N/A

    job_name

    String

    Definition

    Job name.

    Range

    N/A

    is_enabled

    Boolean

    Definition

    Whether the job is enabled.

    Range

    • true: enabled
    • false: disabled

    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_status

    String

    Definition

    Job execution status.

    Range

    • failed
    • succeeded
    • retrying
    • canceled
    • in_progress

    last_failure_time

    String

    Definition

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

    failure_count

    Integer

    Definition

    Number of historical failures.

    Range

    N/A

    agent_type

    String

    Definition

    Job agent type.

    Range

    • snapshot: snapshot agent
    • log_reader: log reader agent
    • distribution: distribution agent
    • merge: merge agent
    • queue_reader: queue reader agent

    profile_id

    String

    Definition

    Profile ID. This parameter is valid only when the job type is replication.

    Range

    N/A

    profile_name

    String

    Definition

    Profile name. This parameter is valid only when the job type is replication.

    Range

    N/A

  • Example normal response
    {
        "jobs": [
            {
                "job_id": "0C6A3BC7-D2D5-41C2-BA3A-012DC43C4CD5",
                "job_name": "Monitor and sync replication agent jobs",
                "is_enabled": true,
                "run_time": "2025-11-08T10:58:00+0000",
                "run_status": "succeeded",
                "failure_count": 0,
                "profile_id": "0"
            },
            {
                "job_id": "F19D8EDB-B248-4ECD-BA92-F588DA687AFD",
                "job_name": "Replication agents checkup",
                "is_enabled": true,
                "run_time": "2025-11-08T10:50:00+0000",
                "run_status": "succeeded",
                "failure_count": 0,
                "profile_id": "0"
            }
        ],
        "total_count": 2
    }
  • Abnormal response

    For details, see Abnormal Request Results.

Status Code

Error Code

For details, see Error Codes.