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

Batch Modifying Subscriptions

Function

This API is used to modify subscriptions in batches for 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

    PUT /v3/{project_id}/instances/{instance_id}/replication/subscriptions

  • 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

Request Parameters

Table 2 Parameters

Parameter

Mandatory

Type

Description

subscription_ids

Yes

Array of strings

Definition

IDs of subscriptions to modify.

Constraints

The subscriptions to modify must belong to the same instance.

Range

N/A

Default Value

N/A

job_schedule

Yes

Object

Definition

Snapshot schedule.

For details, see Table 3.

Constraints

N/A

Table 3 job_schedule element structure description

Parameter

Mandatory

Type

Description

id

No

String

Definition

Schedule ID.

Constraints

N/A

Range

N/A

Default Value

N/A

job_schedule_type

No

String

Definition

Schedule type.

Constraints

N/A

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.

Default Value

recurring

one_time_occurrence

No

Object

Definition

Execution time when the task is executed only once.

For details, see Table 4.

Constraints

N/A

frequency

No

Object

Definition

Interval of the schedule.

For details, see Table 5.

Constraints

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

daily_frequency

No

Object

Definition

Daily frequency of the schedule.

For details, see Table 6.

Constraints

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

duration

No

Object

Definition

Validity period of the schedule.

For details, see Table 7.

Constraints

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

Table 4 one_time_occurrence element structure description

Parameter

Mandatory

Type

Description

active_start_date

No

String

Definition

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

Constraints

N/A

Range

1990-01-01 to 2099-12-31

Default Value

N/A

active_start_time

No

String

Definition

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

Constraints

N/A

Range

N/A

Default Value

N/A

Table 5 frequency element structure description

Parameter

Mandatory

Type

Description

freq_type

No

String

Definition

Frequency type of the schedule.

Constraints

N/A

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

Default Value

N/A

freq_interval

No

Integer

Definition

Execution interval.

Constraints

N/A

Range

1–99

Default Value

N/A

freq_interval_weekly

No

Array of strings

Definition

Days in a week when the task is executed.

Constraints

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

Range

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

Default Value

N/A

freq_interval_day_monthly

No

Integer

Definition

Monthly execution dates.

Constraints

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

Range

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

Default Value

N/A

freq_interval_monthly

No

String

Definition

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

Constraints

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

Range

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

Default Value

N/A

freq_relative_interval_monthly

No

String

Definition

Week in a month when the task is executed.

Constraints

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

Range

first, second, third, fourth, last

Default Value

N/A

Table 6 daily_frequency element structure description

Parameter

Mandatory

Type

Description

freq_subday_type

No

String

Definition

Daily frequency type.

Constraints

N/A

Range

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

Default Value

N/A

active_start_time

No

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.

Constraints

N/A

Range

N/A

Default Value

N/A

active_end_time

No

String

Definition

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

Constraints

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

Range

N/A

Default Value

N/A

freq_subday_interval

No

Integer

Definition

Execution interval.

Constraints

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

Range

1–99

Default Value

N/A

freq_interval_unit

No

String

Definition

Execution interval unit.

Constraints

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

Range

  • second
  • minute
  • hour

Default Value

N/A

Table 7 duration element structure description

Parameter

Mandatory

Type

Description

active_start_date

No

String

Definition

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

Constraints

N/A

Range

1990-01-01 to 2099-12-31

Default Value

N/A

active_end_date

No

String

Definition

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

Constraints

N/A

Range

N/A

Default Value

N/A

Example Request

Modify subscriptions in batches for a DB instance.

PUT https://{Endpoint}/v3/054e292c9880d4992f02c0196d3ea468/instances/3d39c18788b54a919bab633874c159dfin04/replication/subscriptions

{
    "subscription_ids": [
        "5b7dfa4f-a16e-4588-9d4e-89353f823512"
    ],
    "job_schedule": {
        "id": "569d69c2-53e5-4bef-a356-d7ea2ff6fb98",
        "user_defined": false,
        "schedule_type": "sync",
        "job_schedule_type": "automatically",
        "one_time_occurrence": {
        },
        "frequency": {
        },
        "daily_frequency": {
        },
        "duration": {
        }
    }
}

Response

  • Normal response
    Table 8 Response body parameters

    Parameter

    Type

    Description

    subscriptions

    Array of objects

    Definition

    Subscription modification results.

    For details, see Table 9.

    Range

    N/A

    Table 9 subscriptions element structure description

    Parameter

    Type

    Description

    id

    String

    Definition

    Subscription ID.

    Range

    N/A

    result

    String

    Definition

    Execution result.

    Range

    • success
    • failure

    error_message

    String

    Definition

    Failure error.

    Range

    N/A

  • Example normal response
    {
        "subscriptions": [
            {
                "id": "5b7dfa4f-a16e-4588-9d4e-89353f823512",
                "result": "success"
            }
        ]
    }
  • Abnormal response

    For details, see Abnormal Request Results.

Status Code

Error Code

For details, see Error Codes.