Applicability
Deleting databases from a standby cluster is not supported in the current version.
Overview
You can call this API to delete one or more databases.
Notice
After you call the DeleteDatabases API, the database is immediately deleted. Make sure the database is no longer in use to avoid affecting your business.
API details
Constraints
The caller must have an AccessKey for accessing the multi-cloud API. For information about how to obtain the AccessKey ID and AccessKey secret, see Manage AccessKeys.
Request path
DELETE /api/v2/instances/{instanceId}/tenants/{tenantId}/databases
Request parameters
Query
| Name | Type | Required | Description | Example value |
|---|---|---|---|---|
| instanceId | string | No | The ID of the OceanBase cluster. | ob317v4uif**** |
| tenantId | string | Yes | The ID of the tenant. | ob2mr3oae0**** |
Body
| Name | Type | Required | Description | Example value |
|---|---|---|---|---|
| instanceId | string | No | The ID of the OceanBase cluster. | ob317v4uif**** |
| tenantId | string | Yes | The ID of the tenant. | ob2mr3oae0**** |
| databaseNames | string | Yes | The list of database names. The value is a JSON array. Each object in the array is a string that specifies the name of a database. | ["d1", "d2"] |
Response parameters
| Name | Type | Description | Example value |
|---|---|---|---|
| success | boolean | Indicates whether the databases are successfully deleted. | true |
Examples
Request example
curl -v --request DELETE \
--digest -u 'ak:sk' \
--url 'https://api-cloud.oceanbase.com/api/v2/instances/{instanceId}/tenants/{tenantId}/databases' \
-H 'X-Ob-Project-Id: <Project ID>'
--data \ '{"instanceId":"ob4ioyiw82yhuo","tenantId":"t4ismze9nltds","databaseNames":["default_database"]}'
Note
- A project ID uniquely identifies a project. For information about how to obtain the project ID of an instance, see Manage projects.
- Make sure that the project ID corresponding to the specified instanceId is consistent with the specified project ID.
Response example
JSON format
{
"success":true
}