You can call the ModifyDBInstanceDeletionProtection operation to enable or disable the release protection feature for an ApsaraDB RDS instance.

For more information, see Enable or disable the release protection feature for an ApsaraDB RDS for MySQL instance.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ModifyDBInstanceDeletionProtection

The operation that you want to perform. Set the value to ModifyDBInstanceDeletionProtection.

ClientToken String No ETnLKlblzczshOTUbOCzxxxxxxxxxx

The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can only contain ASCII characters and cannot exceed 64 characters in length.

DBInstanceId String Yes rm-uf6wjk5xxxxxxx

The ID of the instance. You can call the DescribeDBInstances operation to query the instance ID.

Note
  • Before you call this operation, make sure that the instance runs one of the following database engines:
    • MySQL
    • PostgreSQL
    • MariaDB TX
  • The instance is a pay-as-you-go instance.
DeletionProtection Boolean Yes true

Specifies whether to enable the release protection feature for the instance. Valid values:

  • true: The feature is enabled.
  • false: The feature is not enabled.

Response parameters

Parameter Type Example Description
RequestId String 3C5CFDEE-F774-4DED-89A2-1D76EC63C575

The ID of the request.

Examples

Sample requests

http(s)://rds.aliyuncs.com/?Action=ModifyDBInstanceDeletionProtection
&DBInstanceId=rm-uf6wjk5xxxxxxx
&DeletionProtection=true
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<ModifyDBInstanceDeletionProtectionResponse>
    <RequestId>3C5CFDEE-F774-4DED-89A2-1D76EC63C575</RequestId>
</ModifyDBInstanceDeletionProtectionResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "3C5CFDEE-F774-4DED-89A2-1D76EC63C575"
}

Error codes

HTTP status code Error code Error message Description
400 OperationDenied.PayType The operation is not permitted due to pay type of instance. The error message returned because the operation failed. The billing method of the instance does not support this operation.

For a list of error codes, visit the API Error Center.