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

ParameterTypeRequiredExampleDescription
ActionStringYesModifyDBInstanceDeletionProtection

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

ClientTokenStringNoETnLKlblzczshOTUbOCzxxxxxxxxxx

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.

DBInstanceIdStringYesrm-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
  • The instance is a pay-as-you-go instance.
DeletionProtectionBooleanYestrue

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

ParameterTypeExampleDescription
RequestIdString3C5CFDEE-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 codeError codeError messageDescription
400OperationDenied.PayTypeThe 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.