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

Querying Subscriptions of a DB Instance

Function

This API is used to query subscriptions 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}/replication/subscriptions?offset={offset}&limit={limit}&publication_id={publication_id}&is_cloud={is_cloud}&publication_name={publication_name}&subscription_db_name={subscription_db_name}

  • 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

    publication_id

    No

    Definition

    Publication ID.

    Constraints

    N/A

    Range

    • If this parameter is not null, subscriptions under this publication are queried.
    • If the value is null, local subscriptions of the instance are queried.

    Default Value

    null

    is_cloud

    No

    Definition

    Source of the subscriber.

    Constraints

    N/A

    Range

    • true: The subscriber is a cloud instance.
    • false: The subscriber is not a cloud instance.
    • null: All subscriptions are queried.

    Default Value

    null

    publication_name

    No

    Definition

    Publication name (fuzzy match).

    Constraints

    N/A

    Range

    N/A

    Default Value

    N/A

    subscription_db_name

    No

    Definition

    Subscription database name (fuzzy match).

    Constraints

    N/A

    Range

    N/A

    Default Value

    N/A

Request

  • Request parameters

    None

  • URI example

    GET https://{Endpoint}/v3/0483b6b16e954cb88930a360d2c4e663/instances/72ee4cc4607347049df9ad50f615bbd8in04/replication/subscriptions?offset=0&limit=10&publication_id=959d6fd2-c32f-47fe-a209-7fb6b261a6bb&is_cloud=true&publication_name=pub01&subscription_db_name=db01

Response

  • Normal response
    Table 2 Parameters

    Parameter

    Type

    Description

    subscriptions

    Array of objects

    Definition

    List of subscriptions.

    For details, see Table 3.

    total_count

    Integer

    Definition

    Number of subscriptions.

    Range

    N/A

    Table 3 subscriptions element structure description

    Parameter

    Type

    Description

    id

    String

    Definition

    Subscription ID.

    Range

    N/A

    status

    String

    Definition

    Subscription status.

    Range

    • normal
    • abnormal
    • creating
    • createfail

    publication_id

    String

    Definition

    Publication ID.

    Range

    N/A

    publication_name

    String

    Definition

    Publication name.

    Range

    N/A

    is_cloud

    Boolean

    Definition

    Source of the subscriber.

    Range

    • true: The subscriber is a cloud instance.
    • false: The subscriber is not a cloud instance.

    subscription_database

    String

    Definition

    Destination database name.

    Range

    N/A

    subscription_type

    String

    Definition

    Subscription type.

    Range

    push

    publication_subscription

    Object

    Definition

    Subscription information of the publication.

    For details, see Table 4.

    local_subscription

    Object

    Definition

    Local subscription information.

    For details, see Table 5.

    job_schedule

    Object

    Definition

    Schedule details.

    For details, see Table 6.

    Table 4 publication_subscription element structure description

    Parameter

    Type

    Description

    subscription_instance_name

    String

    Definition

    Subscriber name.

    Range

    N/A

    subscription_instance_ip

    String

    Definition

    Subscriber IP address.

    Range

    N/A

    subscription_instance_id

    String

    Definition

    Subscriber instance ID.

    Range

    N/A

    Table 5 local_subscription element structure description

    Parameter

    Type

    Description

    publication_instance_id

    String

    Definition

    Publisher instance ID when the publisher is a cloud instance.

    Range

    N/A

    publication_instance_name

    String

    Definition

    Publisher name.

    Range

    N/A

    Table 6 job_schedule element structure description

    Parameter

    Type

    Description

    id

    String

    Definition

    Schedule ID.

    Range

    N/A

    job_schedule_type

    String

    Definition

    Schedule type.

    Range

    • automatically: The task starts when the SQL Server Agent is started.
    • cpu_idle: The task starts when the CPU is idle.
    • recurring: The task is executed repeatedly.
    • one_time: The task is executed only once.

    one_time_occurrence

    Object

    Definition

    Execution time when the task is executed only once.

    For details, see Table 7.

    frequency

    Object

    Definition

    Interval of the schedule.

    For details, see Table 8.

    daily_frequency

    Object

    Definition

    Daily frequency of the schedule.

    For details, see Table 9.

    duration

    Object

    Definition

    Validity period of the schedule.

    For details, see Table 10.

    Table 7 one_time_occurrence element structure description

    Parameter

    Type

    Description

    active_start_date

    String

    Definition

    Execution date, in the format of yyyy-MM-dd.

    Range

    1990-01-01 to 2099-12-31

    active_start_time

    String

    Definition

    Execution time, in the format of HH:mm:ss.

    Range

    N/A

    Table 8 frequency element structure description

    Parameter

    Type

    Description

    freq_type

    String

    Definition

    Frequency type of the schedule.

    Range

    • daily: by day
    • weekly: by week
    • monthly_day: by month and by day in each month
    • monthly_week: by month and by week in each month

    freq_interval

    Integer

    Definition

    Execution interval.

    Range

    1–99

    freq_interval_weekly

    Array of strings

    Definition

    Days in a week when the task is executed.

    Range

    This parameter is returned when freq_type is set to weekly. If freq_type is not set to weekly, this parameter does not take effect.

    Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday

    freq_interval_day_monthly

    Integer

    Definition

    Monthly execution dates.

    Range

    This parameter is returned when freq_type is set to monthly_day. If freq_type is not set to monthly_day, this parameter does not take effect.

    1 to the total number of days in the month, for example, 1 to 31

    freq_interval_monthly

    String

    Definition

    Days in a week when the task is executed in the current month.

    Range

    This parameter is returned when freq_type is set to monthly_week. If freq_type is not set to monthly_week, this parameter does not take effect.

    Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, day, weekday, weekend

    freq_relative_interval_monthly

    String

    Definition

    Week in a month when the task is executed.

    Range

    This parameter is returned when freq_type is set to monthly_week. If freq_type is not set to monthly_week, this parameter does not take effect.

    first, second, third, fourth, last

    Table 9 daily_frequency element structure description

    Parameter

    Type

    Description

    freq_subday_type

    String

    Definition

    Daily frequency type.

    Range

    • once: once a day
    • multiple: multiple times a day

    active_start_time

    String

    Definition

    Time of the first execution on each day. If freq_subday_type is set to once, the task is executed only once a day. The value is in HH:mm:ss format.

    Range

    N/A

    active_end_time

    String

    Definition

    Last execution time, in the format of HH:mm:ss.

    Range

    This parameter is returned when the task is executed multiple times a day. It does not take effect when the task is executed only once a day.

    freq_subday_interval

    Integer

    Definition

    Execution interval.

    Range

    This parameter is returned when the task is executed multiple times a day. It does not take effect when the task is executed only once a day.

    1–99

    freq_interval_unit

    String

    Definition

    Execution interval unit.

    Range

    This parameter is returned when the task is executed multiple times a day. It does not take effect when the task is executed only once a day.

    • second
    • minute
    • hour
    Table 10 duration element structure description

    Parameter

    Type

    Description

    active_start_date

    String

    Definition

    First execution date, in the format of yyyy-MM-dd.

    Range

    1990-01-01 to 2099-12-31

    active_end_date

    String

    Definition

    Last execution date, in the format of yyyy-MM-dd. By default, the execution does not end.

    Range

    N/A

  • Example normal response
    Query local subscriptions of a DB instance.
    {
        "subscriptions": [
            {
                "id": "5b7dfa4f-a16e-4588-9d4e-89353f823512",
                "status": "normal",
                "publication_id": "959d6fd2-c32f-47fe-a209-7fb6b261a6bb",
                "publication_name": "pub01",
                "is_cloud": true,
                "subscription_database": "tab01",
                "subscription_type": "push",
                "job_schedule": {
                    "id": "eb1e69b9-afa3-4169-890e-9449752863d8",
                    "job_schedule_type": "automatically",
                    "one_time_occurrence": {
                    },
                    "frequency": {
                    },
                    "daily_frequency": {
                    },
                    "duration": {
                    }
                },
                "local_subscription": {
                    "publication_instance_id": "422dc09255994da0b40ead6d74af017ein04",
                    "publication_instance_name": "rds-7941"
                }
            }
        ],
        "total_count": 1
    }
    Query subscriptions under a publication of a DB instance.
    {
        "subscriptions": [
            {
                "id": "b60c7d34-2541-4582-bb89-eed9fe81fcae",
                "status": "normal",
                "publication_id": "959d6fd2-c32f-47fe-a209-7fb6b261a6bb",
                "publication_name": "pub01",
                "is_cloud": true,
                "subscription_database": "tab01",
                "subscription_type": "push",
                "job_schedule": {
                    "id": "eb1e69b9-afa3-4169-890e-9449752863d8",
                    "job_schedule_type": "automatically",
                    "one_time_occurrence": {
                    },
                    "frequency": {
                    },
                    "daily_frequency": {
                    },
                    "duration": {
                    }
                },
                "publication_subscription": {
                    "subscription_instance_id": "baaede94ce354dbfa8eeef7d99550ed4in04",
                    "subscription_instance_name": "rds-31a2",
                    "subscription_instance_ip": "192.168.0.135"
                }
            }
        ],
        "total_count": 1
    }
  • Abnormal response

    For details, see Abnormal Request Results.

Status Code

Error Code

For details, see Error Codes.