DeleteTable

更新时间:
复制 MD 格式

Deletes a table and its data from a Table Bucket.

Usage notes

  • This operation permanently deletes a table and all its data and metadata. The deletion is irreversible.

  • Use the versionToken parameter for optimistic locking to delete only the intended table version.

Permissions

API

Action

Description

DeleteTable

oss:DeleteTable

Deletes a table and checks the corresponding Table Policy.

Request syntax

DELETE /tables/{tableBucketARN}/{namespace}/{name} HTTP/1.1
Host: cn-hangzhou.oss-tables.aliyuncs.com
Date: GMT Date
Authorization: SignatureValue

Request parameters

Parameter

Type

Required

Example

Description

tableBucketARN

String

Yes

acs:osstables:cn-hangzhou:1234567890:bucket/my-table-bucket

The Alibaba Cloud Resource Name (ARN) of the Table Bucket. Format: acs:osstables:{region}:{uid}:bucket/{bucketName}. Specified in the URI.

namespace

String

Yes

my_namespace

The namespace that contains the table. Specified in the URI.

name

String

Yes

my_table

The table to delete. Specified in the URI.

versionToken

String

No

aaabbb

The version token for optimistic locking. If the token does not match the current table version, a 409 Conflict error is returned. Specified in the query string.

Examples

Sample request

DELETE /tables/acs%3Aosstables%3Acn-hangzhou%3A1234567890%3Abucket%2Fmy-table-bucket/my_namespace/my_table HTTP/1.1
Host: cn-hangzhou.oss-tables.aliyuncs.com
Date: Thu, 10 Apr 2025 08:00:00 GMT
Authorization: OSS4-HMAC-SHA256 Credential=LTAI********************/20250417/cn-hangzhou/osstables/aliyun_v4_request,Signature=a7c3554c729d71929e0b84489addee6b2e8d5cb48595adfc51868c299c0c****

Sample response

HTTP/1.1 204 No Content
Server: AliyunOSS
x-oss-request-id: 5C06A3B67B8B5A3DA422****
x-oss-server-time: 3

SDKs

DeleteTable is available in the following SDKs:

CLI: ossutil

The corresponding ossutil command is delete-table.

Error codes

Error code

HTTP status code

Description

ForbiddenException

403

You do not have the required permissions.

NotFoundException

404

The requested resource does not exist.

ConflictException

409

The request conflicts with the current resource state, such as a versionToken mismatch with the current table version.