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

Batch Stopping DB Instances

Function

This API is used to batch stop pay-per-use DB instances.

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

write

-

-

rds:instance:operateServer

-

Constraints

  • A maximum of 50 instances can be stopped at a time.
  • This API is supported for RDS for MySQL only.
  • Only ultra-high I/O, cloud SSD, and extreme SSD pay-per-use instances can be stopped. RDS instances in a DCC cannot be stopped.
  • A stopped instance will not be moved to the recycle bin after being deleted.
  • If you stop a primary instance, read replicas (if there are any) will also be stopped. You cannot stop a read replica without stopping the primary instance.
  • If you do not manually start your DB instance within 15 days after it is stopped, the instance will automatically start during the next maintenance window.
  • After a DB instance is stopped, the VM where the DB instance is located is no longer billed. Other resources, including EIPs, storage resources, and backups, are still billed.
  • An instance cannot be stopped if it is in any of the following statuses:

    Creating, rebooting, scaling up, changing instance class, restoring, and changing port.

URI

  • URI format

    POST /v3/{project_id}/instances/batch/action/shutdown

  • 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

    N/A

    Range

    N/A

    Default Value

    N/A

Request

Table 2 Parameters

Parameter

Mandatory

Type

Description

instance_ids

Yes

List<String>

Definition

Instance IDs.

Constraints

The value cannot be empty.

Range

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

Default Value

N/A

Example Request

Batch stop DB instances.
POST https://{endpoint}/v3/054ea741f700d4a32f1bc00f5c80dd4c/instances/batch/action/shutdown

{
     "instance_ids" : [
        "5b409baece064984a1b3eef6addae50cin01"
       ]
}

Response

  • Normal response
    Table 3 Parameters

    Parameter

    Type

    Description

    records

    List

    Definition

    Result records.

    For details, see Table 4.

    Table 4 records field description

    Parameter

    Type

    Description

    instance_id

    String

    Definition

    Instance ID.

    Range

    N/A

    job_id

    String

    Definition

    Task ID.

    Range

    N/A

  • Example normal response
    {
        "records": [
            {
                "instance_id": "5b409baece064984a1b3eef6addae50cin01",
                "job_id": "2b414788a6004883a02390e2eb0ea227"
            }
        ]
    }

Status Code

Error Code

For details, see Error Codes.