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

Querying Publications of a DB Instance

Function

This API is used to query publications 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/publications?offset={offset}&limit={limit}&publication_name={publication_name}&publication_db_name={publication_db_name}&subscriber_instance_id={subscriber_instance_id}

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

    No

    Definition

    Publication name (fuzzy match).

    Constraints

    N/A

    Range

    N/A

    Default Value

    N/A

    publication_db_name

    No

    Definition

    Publication database name (fuzzy match).

    Constraints

    N/A

    Range

    N/A

    Default Value

    N/A

    subscriber_instance_id

    No

    Definition

    Subscriber instance ID.

    Constraints

    N/A

    Range

    N/A

    Default Value

    N/A

Request

  • Request parameters

    None

  • URI example

    GET https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/72ee4cc4607347049df9ad50f615bbd8in04/replication//publications?offset=0&limit=10&subscriber_instance_id=2ed347084f6b4faab16f6f2446f59d71in04&publication_name=pub01&publication_db_name=testdb1

Response

  • Normal response
    Table 2 Parameters

    Parameter

    Type

    Description

    publications

    Array of objects

    Definition

    List of publications.

    For details, see Table 3.

    total_count

    Integer

    Definition

    Number of publications.

    Range

    N/A

    Table 3 publications element structure description

    Parameter

    Type

    Description

    id

    String

    Definition

    Publication ID.

    Range

    N/A

    status

    String

    Definition

    Publication status.

    Range

    • normal
    • abnormal
    • creating
    • modifying
    • createfail

    publication_name

    String

    Definition

    Publication name.

    Range

    N/A

    publication_database

    String

    Definition

    Publication database name.

    Range

    N/A

    subscription_count

    Integer

    Definition

    Number of subscriptions.

    Range

    N/A

    subscription_options

    Object

    Definition

    Subscription options.

    For details, see Table 4.

    job_schedule

    Object

    Definition

    Schedule details.

    For details, see Table 5.

    is_select_all_table

    Boolean

    Definition

    Whether all data tables are selected.

    Range

    • true: All data tables are selected.
    • false: Not all data tables are selected.

    extend_tables

    Array of strings

    Definition

    Tables to be removed after all tables are selected.

    Range

    N/A

    tables

    Array of objects

    Definition

    Published tables.

    For details, see Table 10.

    Table 4 subscription_options element structure description

    Parameter

    Type

    Description

    independent_agent

    Boolean

    Definition

    Whether an independent distribution agent is used.

    Range

    • true: An agent is used.
    • false: No agent is used.

    snapshot_always_available

    Boolean

    Definition

    Whether snapshots are always available. Independent Distribution Agent must be enabled.

    Range

    • true: Snapshots are always available.
    • false: Snapshots are not always available.

    replicate_ddl

    Boolean

    Definition

    Whether schema changes can be replicated.

    Range

    • true: Schema changes can be replicated.
    • false: Schema changes cannot be replicated.

    allow_initialize_from_backup

    Boolean

    Definition

    Whether backup files can be used for initialization.

    Range

    • true: Backup files can be used for initialization.
    • false: Backup files cannot be used for initialization.
    Table 5 job_schedule element structure description

    Parameter

    Type

    Description

    id

    String

    Definition

    Schedule ID.

    Range

    OBS or BACKUP

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

    frequency

    Object

    Definition

    Interval of the schedule. This parameter is valid only when the schedule ID is empty.

    For details, see Table 7.

    daily_frequency

    Object

    Definition

    Daily frequency of the schedule. This parameter is valid only when the schedule ID is empty.

    For details, see Table 8.

    duration

    Object

    Definition

    Validity period of the schedule. This parameter is valid only when the schedule ID is empty.

    For details, see Table 9.

    Table 6 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 7 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 8 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 9 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

    Table 10 tables element structure description

    Parameter

    Type

    Description

    table_name

    String

    Definition

    Table name.

    Range

    N/A

    schema

    String

    Definition

    Namespace.

    Range

    N/A

    columns

    Array of strings

    Definition

    Published fields.

    Range

    N/A

    primary_key

    Array of strings

    Definition

    Primary key.

    Range

    N/A

    filter_statement

    String

    Definition

    Filter statement.

    Range

    N/A

    filter

    Object

    Definition

    Filter.

    For details, see Table 11.

    article_properties

    Object

    Definition

    Project properties.

    For details, see Table 12.

    Table 11 filter element structure description

    Parameter

    Type

    Description

    relation

    String

    Definition

    Filter relationship. If the value is empty, the current filter is the lowest-level filter. If the value is not empty, there are lower-level filters.

    Range

    N/A

    column

    String

    Definition

    Filter field.

    Range

    N/A

    condition

    String

    Definition

    Filter condition.

    Range

    N/A

    value

    String

    Definition

    Filter value.

    Range

    N/A

    filters

    Array of objects

    Definition

    Lower-level filter.

    For details, see Table 11.

    Table 12 article_properties element structure description

    Parameter

    Type

    Description

    destination_object_name

    String

    Definition

    Name of the target object.

    Range

    N/A

    destination_object_owner

    String

    Definition

    Namespace of the target object.

    Range

    N/A

    insert_delivery_format

    String

    Definition

    INSERT delivery format.

    Range

    • do_not_insert: Do not execute the INSERT statement.
    • insert: Execute the INSERT statement.
    • insert_without_column_list: The fields of the INSERT statement remain in the original order.
    • call_procedure: Execute the stored procedure to pass all values for all columns.

    insert_stored_procedure

    String

    Definition

    INSERT stored procedure.

    Range

    N/A

    update_delivery_format

    String

    Definition

    UPDATE delivery format.

    Range

    • do_not_update: Do not execute the UPDATE statement.
    • update: Execute the UPDATE statement.
    • call_procedure: Execute the stored procedure to pass all values for all columns.
    • mcall_procedure: Execute the stored procedure to only pass values for affected columns. It also includes a bitmask representing the changed columns.
    • xcall_procedure: Execute the stored procedure to pass all columns (whether affected or not) and the old data values for each column.
    • scall_procedure: Execute the stored procedure to pass values only for the columns that were actually affected by the update.

    update_stored_procedure

    String

    Definition

    UPDATE stored procedure.

    Range

    N/A

    delete_delivery_format

    String

    Definition

    DELETE delivery format.

    Range

    • do_not_delete: Do not execute the DELETE statement.
    • delete: Execute the DELETE statement.
    • call_procedure: Execute the stored procedure to pass all values for all columns.
    • xcall_procedure: Execute the stored procedure to pass all columns (whether affected or not) and the old data values for each column.

    delete_stored_procedure

    String

    Definition

    DELETE stored procedure.

    Range

    N/A

  • Example normal response
    {
        "publications": [
            {
                "id": "942d9062-4fb9-48ce-bfe1-15655560ad56",
                "status": "normal",
                "publication_name": "pub001",
                "publication_database": "db01",
                "subscription_count": 1,
                "subscription_options": {
                    "independent_agent": true,
                    "snapshot_always_available": true,
                    "replicate_ddl": true,
                    "allow_initialize_from_backup": true
                },
                "job_schedule": {
                    "id": "3d85677d-e0c7-4a19-a2b6-106589ecd151",
                    "job_schedule_type": "recurring",
                    "frequency": {
                        "freq_type": "weekly",
                        "freq_interval": 1,
                        "freq_interval_weekly": [
                            "Sunday"
                        ]
                    },
                    "daily_frequency": {
                        "freq_subday_type": "once",
                        "active_start_time": "02:00:00"
                    },
                    "duration": {
                        "active_start_date": "1990-01-01",
                        "active_end_date": "2099-12-31"
                    }
                },
                "is_select_all_table": false,
                "extend_tables": [
                ],
                "tables": [
                    {
                        "table_name": "tab02",
                        "schema": "dbo",
                        "columns": [
                        ],
                        "primary_key": [
                            "id"
                        ],
                        "article_properties": {
                            "destination_object_name": "tab02",
                            "destination_object_owner": "dbo",
                            "insert_delivery_format": "call_procedure",
                            "insert_stored_procedure": "sp_MSins_dbotab02",
                            "update_delivery_format": "scall_procedure",
                            "update_stored_procedure": "sp_MSupd_dbotab02",
                            "delete_delivery_format": "call_procedure",
                            "delete_stored_procedure": "sp_MSdel_dbotab02"
                        }
                    }
                ]
            }
        ],
        "total_count": 1
    }
  • Abnormal response

    For details, see Abnormal Request Results.

Status Code

Error Code

For details, see Error Codes.