Updated on 2026-07-21 GMT+08:00

Batch Changing Instance Specifications

Function

This API is used to change instance specifications in batches.

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

write

-

- rds:FlavorType

-

-

Constraints

  • This API is available only for RDS for MySQL.
  • This API can be called a maximum of 10 times per minute.
  • The original instances must meet the following requirements:
    • They must use the same billing mode, either pay-per-use or yearly/monthly.
    • They must have the same instance class.
    • They must have the same storage type.
    • They must be in the same AZ. For primary/standby instances, there is no restriction on the AZ order.
    • They must belong to the same enterprise project.
    • They must not have auto scaling enabled.

URI

  • URI format

    POST /v3/{project_id}/instances/batch/resize

  • Parameter description
    Table 1 Parameters

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Definition

    Project ID of a tenant in a region.

    To obtain the value, see Obtaining a Project ID.

    Constraints

    N/A

    Range

    N/A

    Default Value

    N/A

Request

Table 2 Parameters

Parameter

Mandatory

Type

Description

instance_ids

Yes

Array of strings

Definition

Instance IDs.

You can obtain the value of this parameter from id in Table 4 by calling the API for querying DB instances.

Constraints

You can change specifications of a maximum of 10 instances at a time.

Range

Use commas (,) to separate multiple instance IDs. Example:

["347288b745f9455faa700e88c17ca276in01", "161ddefa425441289661354f0c370c9din01"]

Default Value

N/A

spec_code

Yes

String

Definition

Resource specification code.

You can obtain the value of this parameter from code in Table 4 by calling the API for querying available instance classes for a DB Instance.

Constraints

N/A

Range

N/A

Default Value

N/A

delay

No

Boolean

Definition

Whether to change the specifications at the scheduled time.

Constraints

N/A

Range

  • true: The specifications are changed at the scheduled time.
  • false: The specifications are changed immediately.

Default Value

false

auto_pay

No

Boolean

Definition

Whether the order will be automatically paid when the specifications of yearly/monthly instances are changed.

Constraints

This parameter is invalid when the specifications of yearly/monthly instances are downgraded, as downgrades trigger automatic refunds.

Range

  • true: The order will be automatically paid.
  • false: You need to pay on the unpaid order page.

Default Value

false

occupy_ip

No

Boolean

Definition

Whether changing specifications occupies IP addresses.

Constraints

If this parameter is set to false, single-node instances will be interrupted for several minutes during the change.

Range

  • true: Changing specifications occupies IP addresses.
  • false: Changing specifications does not occupy IP addresses.

Default Value

true

Example Request

Change instance specifications in batches.

POST https://{Endpoint}/v3/054e292c9880d4992f02c0196d3ea468/instances/batch/resize
{
  "instance_ids": ["347288b745f9455faa700e88c17ca276in01", "161ddefa425441289661354f0c370c9din01"],
  "spec_code": "rds.mysql.n1.large.2",
  "delay": false,
  "auto_pay": false,
  "occupy_ip": true
}

Response

  • Pay-per-use instances
    • Normal response
      Table 3 Parameters

      Parameter

      Type

      Description

      job_id

      String

      Definition

      Task ID. This task ID will not be displayed on the RDS task center page. Go to the task center page to check whether the selected instances are in the changing status.

      Range

      N/A

    • Example normal response
      {
      	"job_id": "2b414788a6004883a02390e2eb0ea227"
      }
    • Abnormal response

      For details, see Abnormal Request Results.

  • Yearly/Monthly instances
    • Normal response
      Table 4 Parameters

      Parameter

      Type

      Description

      order_id

      String

      Definition

      Order ID.

      Range

      N/A

    • Example normal response
      {
      	"order_id": "CS2009151216NO2U1"
      }
    • Abnormal response

      For details, see Abnormal Request Results.

Status Code

Error Code

For details, see Error Codes.