Skip to content

describe_table async

describe_table(
    table_name: TableArn,
    *,
    config_overrides: Optional[AsyncDynamoDBClientConfig] = None,
) -> DescribeTableOutput

Returns information about the table, including the current status of the table, when it was created, the primary key schema, and any indexes on the table.

If you issue a DescribeTable request immediately after a CreateTable request, DynamoDB might return a ResourceNotFoundException. This is because DescribeTable uses an eventually consistent query, and the metadata for your table might not be available at that moment. Wait for a few seconds, and then try the DescribeTable request again.

Parameters:

  • table_name (TableArn) –

    The name of the table to describe. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.

Raises:

  • InternalServerError –

    An error occurred on the server side.

  • ResourceNotFoundException –

    The operation tried to access a nonexistent table or index. The resource might not be specified correctly, or its status might not be ACTIVE.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_dynamodb/_services/async_dynamo_db.py
async def describe_table(
    self,
    table_name: "capo_dynamodb.types.table_arn.TableArn",
    *,
    config_overrides: Optional[AsyncDynamoDBClientConfig] = None,
) -> "capo_dynamodb.types.describe_table_output.DescribeTableOutput":
    """<p>Returns information about the table, including the current status of the table, when it was created, the primary key schema, and any indexes on the table.</p> <note> <p>If you issue a <code>DescribeTable</code> request immediately after a <code>CreateTable</code> request, DynamoDB might return a <code>ResourceNotFoundException</code>. This is because <code>DescribeTable</code> uses an eventually consistent query, and the metadata for your table might not be available at that moment. Wait for a few seconds, and then try the <code>DescribeTable</code> request again.</p> </note>

    Args:
        table_name: <p>The name of the table to describe. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>

    Raises:
        capo_dynamodb.errors.internal_server_error.InternalServerError: <p>An error occurred on the server side.</p>
        capo_dynamodb.errors.invalid_endpoint_exception.InvalidEndpointException
        capo_dynamodb.errors.resource_not_found_exception.ResourceNotFoundException: <p>The operation tried to access a nonexistent table or index. The resource might not be specified correctly, or its status might not be <code>ACTIVE</code>.</p>
        capo_dynamodb.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_dynamodb.types.describe_table_input.DescribeTableInput]",
    ) -> AsyncOperationResponse[
        "capo_dynamodb.types.describe_table_output.DescribeTableOutput"
    ]:
        import capo_dynamodb._operations.dynamo_db_20120810.describe_table

        (
            output,
            http_response,
        ) = await capo_dynamodb._operations.dynamo_db_20120810.describe_table.async_describe_table(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeTable")
    )
    input_: capo_dynamodb.types.describe_table_input.DescribeTableInput = {
        "table_name": table_name
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output