Delete table

Delete the specified table. Please confirm that the data in this table is no longer needed before execution.

HTTP
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.

  1. Prepare personal access token and target workspace ID that can access the target workspace. The token must have delete table permission.

  2. View database, select the database name.

  3. Query the table and view list in the database and select the table name to be deleted.

  4. 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.

Shell
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

db_name

string

Yes

The name of the database where the table resides.

table_name

string

Yes

The name of the table to delete.

Successful response

JSON
{
  "code": 200,
  "data": null
}

Field

Type

Description

code

integer

200 on success.

data

null

This operation does not return a result object.

Error response

JSON
{
  "code": 400,
  "message": "db_name 不能为空"
}

Field

Type

Description

code

integer or string

Error code or status code.

message

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.

Last updated on