Updated on 2024-08-28 GMT+08:00

Stopping an Instance

Function

This API is used to stop a pay-per-use DB instance.

  • Before calling an API, you need to understand the API in Authentication.

Constraints

  • 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. In CN East-Shanghai1, both the primary instance and read replicas can be stopped for up to 15 days. In other regions, they can be stopped for up to 7 days.
    • In CN East-Shanghai1, if you do not manually start your instance 15 days after the instance is stopped, your instance will start during the next maintenance window.
    • In other regions, if you do not manually start your instance 7 days after the instance is stopped, your instance will start during the next maintenance window.
  • After an instance is stopped, the ECS is no longer billed. Other resources, including EIPs, storage resources, and backups, are still billed.
  • A stopped pay-per-use DB instance may fail to be started due to insufficient resources. In this case, contact customer service.
  • 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/{instance_id}/action/shutdown

  • Parameter description
    Table 1 Parameter description

    Name

    Mandatory

    Description

    project_id

    Yes

    Project ID of a tenant in a region.

    For details about how to obtain the project ID, see Obtaining a Project ID.

    instance_id

    Yes

    Instance ID.

Request

None

Example Request

Stop an instance.

POST https://{endpoint}/v3/054ea741f700d4a32f1bc00f5c80dd4c/instances/5b409baece064984a1b3eef6addae50cin01/action/shutdown

{}

Response

  • Normal response
    Table 2 Parameter description

    Name

    Type

    Description

    job_id

    String

    Task ID.

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

Status Code

Error Code

For details, see Error Codes.