Delete view

Delete the specified view. Please confirm that the view is no longer needed before executing.

HTTP
POST $CLOUDSIGMA_API_BASE/meta/view/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 view permission.

  2. View database, select the database name.

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

  4. Confirm that the view is no longer needed.

Request body

Replace $CLOUDSIGMA_API_KEY, $WORKSPACE_ID, $DATABASE, $VIEW in the example with actual values.

Shell
curl -X POST "$CLOUDSIGMA_API_BASE/meta/view/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\": \"$VIEW\"
  }"

Parameter

Type

Required

Description

db_name

string

Yes

The name of the database where the view resides.

table_name

string

Yes

The name of the view 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": "table_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