Delete table¶
Delete the specified table. Please confirm that the data in this table is no longer needed before execution.
POST $CLOUDSIGMA_API_BASE/meta/table/drop
Before you call¶
Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region.
Prepare personal access token and target workspace ID that can access the target workspace. The token must have delete table permission.
View database, select the database name.
Query the table and view list in the database and select the table name to be deleted.
Confirm that the data in this table is no longer needed.
Request body¶
Replace $CLOUDSIGMA_API_KEY, $WORKSPACE_ID, $DATABASE, $TABLE in the example with actual values.
curl -X POST "$CLOUDSIGMA_API_BASE/meta/table/drop" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d "{
\"db_name\": \"$DATABASE\",
\"table_name\": \"$TABLE\"
}"
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
The name of the database where the table resides. |
|
string |
Yes |
The name of the table to delete. |
Successful response¶
{
"code": 200,
"data": null
}
Field |
Type |
Description |
|---|---|---|
code |
integer |
200 on success. |
data |
null |
This operation does not return a result object. |
Error response¶
{
"code": 400,
"message": "db_name 不能为空"
}
Field |
Type |
Description |
|---|---|---|
|
integer or string |
Error code or status code. |
|
string |
error message. |
DROP IF EXISTS is executed in autocommit mode and may succeed even if the target does not exist. If the connection fails to be released after deletion, the interface may still return an error.
After receiving an error, first use an identity with target permissions to query whether the target still exists. Do not try again directly. The empty list may also be caused by insufficient permissions, and the successful deletion cannot be confirmed based on this.