DeleteTable method
Written by
Updated at July 12, 2022
Deletes a table and all of its items. It also deletes table indexes.
You can only delete a table if it is in the ACTIVE
state.
The method is asynchronous.
This means that it switches a table to the DELETING
state and immediately returns the result. However, the table is actually being deleted in the background. If it is already in the DELETING
state, the method returns no error.
While the table is in the DELETING
state, Managed Service for YDB may continue accepting data read and write requests like GetItem and PutItem.
Request
The request contains data in JSON format.
{
"TableName": "string"
}
Parameters
Parameter | Description |
---|---|
TableName |
Name of the table to delete. May contain a path in the directory hierarchy like path/to/table. Type: String Length: 3 - 255 characters Pattern: [a-zA-Z0-9_.-]+ Required: Yes |
Response
If successful, HTTP code 200 is returned.
The response is returned in JSON format.
{
"TableDescription": {
"ArchivalSummary": {
"ArchivalBackupArn": "string",
"ArchivalDateTime": number,
"ArchivalReason": "string"
},
"AttributeDefinitions": [
{
"AttributeName": "string",
"AttributeType": "string"
}
],
"BillingModeSummary": {
"BillingMode": "string",
"LastUpdateToPayPerRequestDateTime": number
},
"CreationDateTime": number,
"GlobalSecondaryIndexes": [
{
"Backfilling": boolean,
"IndexArn": "string",
"IndexName": "string",
"IndexSizeBytes": number,
"IndexStatus": "string",
"ItemCount": number,
"KeySchema": [
{
"AttributeName": "string",
"KeyType": "string"
}
],
"Projection": {
"NonKeyAttributes": [ "string" ],
"ProjectionType": "string"
},
"ProvisionedThroughput": {
"LastDecreaseDateTime": number,
"LastIncreaseDateTime": number,
"NumberOfDecreasesToday": number,
"ReadCapacityUnits": number,
"WriteCapacityUnits": number
}
}
],
"GlobalTableVersion": "string",
"ItemCount": number,
"KeySchema": [
{
"AttributeName": "string",
"KeyType": "string"
}
],
"LatestStreamArn": "string",
"LatestStreamLabel": "string",
"LocalSecondaryIndexes": [
{
"IndexArn": "string",
"IndexName": "string",
"IndexSizeBytes": number,
"ItemCount": number,
"KeySchema": [
{
"AttributeName": "string",
"KeyType": "string"
}
],
"Projection": {
"NonKeyAttributes": [ "string" ],
"ProjectionType": "string"
}
}
],
"ProvisionedThroughput": {
"LastDecreaseDateTime": number,
"LastIncreaseDateTime": number,
"NumberOfDecreasesToday": number,
"ReadCapacityUnits": number,
"WriteCapacityUnits": number
},
"Replicas": [
{
"GlobalSecondaryIndexes": [
{
"IndexName": "string",
"ProvisionedThroughputOverride": {
"ReadCapacityUnits": number
}
}
],
"KMSMainKeyId": "string",
"ProvisionedThroughputOverride": {
"ReadCapacityUnits": number
},
"RegionName": "string",
"ReplicaStatus": "string",
"ReplicaStatusDescription": "string",
"ReplicaStatusPercentProgress": "string"
}
],
"RestoreSummary": {
"RestoreDateTime": number,
"RestoreInProgress": boolean,
"SourceBackupArn": "string",
"SourceTableArn": "string"
},
"SSEDescription": {
"InaccessibleEncryptionDateTime": number,
"KMSMainKeyArn": "string",
"SSEType": "string",
"Status": "string"
},
"StreamSpecification": {
"StreamEnabled": boolean,
"StreamViewType": "string"
},
"TableArn": "string",
"TableId": "string",
"TableName": "string",
"TableSizeBytes": number,
"TableStatus": "string"
}
}
Parameters
Parameter | Description |
---|---|
TableDescription |
Properties of a deleted table. Type: JSON object |
Errors
Parameter | Description |
---|---|
InternalServerError |
An internal error occurred on the server side. HTTP status code: 500 |
LimitExceededException |
Table operations limit exceeded. You can simultaneously perform up to 50 operations on tables, such as CreateTable , UpdateTable , DeleteTable , UpdateTimeToLive , RestoreTableFromBackup , and RestoreTableToPointInTime .HTTP status code: 400 |
ResourceInUseException |
The table is in use and can't be deleted now. This error occurs if a table is being created or its structure is being updated (the table state is CREATING or UPDATING , respectively)HTTP status code: 400 |
ResourceNotFoundException |
The specified table doesn't exist. HTTP status code: 400 |
There may be common errors as well. These are errors that are common to all methods.