The DeleteTable operation deletes a table and all of its data. After a DeleteTable request is received, the specified table is in the DELETING state until Amazon Keyspaces completes the deletion. If the table is in the ACTIVE state, you can delete it. If a table is either in the CREATING or UPDATING states, then Amazon Keyspaces returns a ResourceInUseException. If the specified table does not exist, Amazon Keyspaces returns a ResourceNotFoundException. If the table is already in the DELETING state, no error is returned.
Parameters:
-
keyspace_name
(KeyspaceName)
–
The name of the keyspace of the to be deleted table.
-
table_name
(TableName)
–
The name of the table to be deleted.
Raises:
-
AccessDeniedException
–
You don't have sufficient access permissions to perform this action.
-
ConflictException
–
Amazon Keyspaces couldn't complete the requested action. This error may occur if you try to perform an action and the same or a different action is already in progress, or if you try to create a resource that already exists.
-
InternalServerException
–
Amazon Keyspaces was unable to fully process this request because of an internal server error.
-
ResourceNotFoundException
–
The operation tried to access a keyspace, table, or type that doesn't exist. The resource might not be specified correctly, or its status might not be ACTIVE.
-
ServiceQuotaExceededException
–
The operation exceeded the service quota for this resource. For more information on service quotas, see Quotas in the Amazon Keyspaces Developer Guide.
-
ValidationException
–
The operation failed due to an invalid or malformed request.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_keyspaces/_services/keyspaces.py
| def delete_table(
self,
keyspace_name: "capo_keyspaces.types.keyspace_name.KeyspaceName",
table_name: "capo_keyspaces.types.table_name.TableName",
*,
config_overrides: Optional[KeyspacesClientConfig] = None,
) -> "capo_keyspaces.types.delete_table_response.DeleteTableResponse":
"""<p>The <code>DeleteTable</code> operation deletes a table and all of its data. After a <code>DeleteTable</code> request is received, the specified table is in the <code>DELETING</code> state until Amazon Keyspaces completes the deletion. If the table is in the <code>ACTIVE</code> state, you can delete it. If a table is either in the <code>CREATING</code> or <code>UPDATING</code> states, then Amazon Keyspaces returns a <code>ResourceInUseException</code>. If the specified table does not exist, Amazon Keyspaces returns a <code>ResourceNotFoundException</code>. If the table is already in the <code>DELETING</code> state, no error is returned.</p>
Args:
keyspace_name: <p>The name of the keyspace of the to be deleted table.</p>
table_name: <p>The name of the table to be deleted.</p>
Raises:
capo_keyspaces.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access permissions to perform this action. </p>
capo_keyspaces.errors.conflict_exception.ConflictException: <p>Amazon Keyspaces couldn't complete the requested action. This error may occur if you try to perform an action and the same or a different action is already in progress, or if you try to create a resource that already exists. </p>
capo_keyspaces.errors.internal_server_exception.InternalServerException: <p>Amazon Keyspaces was unable to fully process this request because of an internal server error.</p>
capo_keyspaces.errors.resource_not_found_exception.ResourceNotFoundException: <p>The operation tried to access a keyspace, table, or type that doesn't exist. The resource might not be specified correctly, or its status might not be <code>ACTIVE</code>.</p>
capo_keyspaces.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The operation exceeded the service quota for this resource. For more information on service quotas, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/quotas.html">Quotas</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
capo_keyspaces.errors.validation_exception.ValidationException: <p>The operation failed due to an invalid or malformed request.</p>
capo_keyspaces.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_keyspaces.types.delete_table_request.DeleteTableRequest]",
) -> OperationResponse[
"capo_keyspaces.types.delete_table_response.DeleteTableResponse"
]:
import capo_keyspaces._operations.keyspaces_service.delete_table
output, http_response = (
capo_keyspaces._operations.keyspaces_service.delete_table.delete_table(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteTable")
)
input_: capo_keyspaces.types.delete_table_request.DeleteTableRequest = {
"keyspace_name": keyspace_name,
"table_name": table_name,
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|