Skip to content

list_tables

list_tables(
    *,
    config_overrides: Optional[DynamoDBClientConfig] = None,
    exclusive_start_table_name: Optional[TableName] = None,
    limit: Optional[ListTablesInputLimit] = None,
) -> ListTablesOutput

Returns an array of table names associated with the current account and endpoint. The output from ListTables is paginated, with each page returning a maximum of 100 table names.

Parameters:

  • exclusive_start_table_name (Optional[TableName], default: None ) –

    The first table name that this operation will evaluate. Use the value that was returned for LastEvaluatedTableName in a previous operation, so that you can obtain the next page of results.

  • limit (Optional[ListTablesInputLimit], default: None ) –

    A maximum number of table names to return. If this parameter is not specified, the limit is 100.

Raises:

Examples:

To list tables This example lists all of the tables associated with the current AWS account and endpoint.

>>> client.list_tables()
Source code in docs_src/capo_dynamodb/_services/dynamo_db.py
def list_tables(
    self,
    *,
    config_overrides: Optional[DynamoDBClientConfig] = None,
    exclusive_start_table_name: Optional[
        "capo_dynamodb.types.table_name.TableName"
    ] = None,
    limit: Optional[
        "capo_dynamodb.types.list_tables_input_limit.ListTablesInputLimit"
    ] = None,
) -> "capo_dynamodb.types.list_tables_output.ListTablesOutput":
    """<p>Returns an array of table names associated with the current account and endpoint. The output from <code>ListTables</code> is paginated, with each page returning a maximum of 100 table names.</p>

    Args:
        exclusive_start_table_name: <p>The first table name that this operation will evaluate. Use the value that was returned for <code>LastEvaluatedTableName</code> in a previous operation, so that you can obtain the next page of results.</p>
        limit: <p>A maximum number of table names to return. If this parameter is not specified, the limit is 100.</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.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To list tables
        This example lists all of the tables associated with the current AWS account and endpoint.

        >>> client.list_tables()
    """

    def _handler(
        req: "OperationRequest[capo_dynamodb.types.list_tables_input.ListTablesInput]",
    ) -> OperationResponse[
        "capo_dynamodb.types.list_tables_output.ListTablesOutput"
    ]:
        import capo_dynamodb._operations.dynamo_db_20120810.list_tables

        output, http_response = (
            capo_dynamodb._operations.dynamo_db_20120810.list_tables.list_tables(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListTables")
    )
    input_: capo_dynamodb.types.list_tables_input.ListTablesInput = {}
    if exclusive_start_table_name is not None:
        input_["exclusive_start_table_name"] = exclusive_start_table_name
    if limit is not None:
        input_["limit"] = limit

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output