Amazon DynamoDB
API Reference (API Version 2012-08-10)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Did this page help you?  Yes | No |  Tell us about it...

ListTables

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.

Request Syntax

{
    "ExclusiveStartTableName": "string",
    "Limit": "number"
}
			

Request Parameters

The request accepts the following data in JSON format.

Note

In the following list, the required parameters are described first.

ExclusiveStartTableName

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.

Type: String

Length constraints: Minimum length of 3. Maximum length of 255.

Required: No

Limit

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

Type: Number

Required: No

Response Syntax

{
    "LastEvaluatedTableName": "string",
    "TableNames": [
        "string"
    ]
}
			

Response Elements

The following data is returned in JSON format by the service.

LastEvaluatedTableName

The name of the last table in the current page of results. Use this value as the ExclusiveStartTableName in a new request to obtain the next page of results, until all the table names are returned.

If you do not receive a LastEvaluatedTableName value in the response, this means that there are no more table names to be retrieved.

Type: String

Length constraints: Minimum length of 3. Maximum length of 255.

TableNames

The names of the tables associated with the current account at the current endpoint. The maximum size of this array is 100.

If LastEvaluatedTableName also appears in the output, you can use this value as the ExclusiveStartTableName parameter in a subsequent ListTables request and obtain the next page of results.

Type: array of Strings

Errors

For information about the errors that are common to all actions, see Common Errors.

InternalServerError

An error occurred on the server side.

HTTP Status Code: 500

Examples

List Tables

This example requests a list of tables, starting with a table named comp2 and ending after three table names have been returned.

Sample Request

POST / HTTP/1.1
Host: dynamodb.<region>.<domain>;
X-Amz-Date: <Date>
Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=content-length;content-type;host;user-agent;x-amz-content-sha256;x-amz-date;x-amz-target, Signature=<Signature>
User-Agent: <UserAgentString>
x-amz-content-sha256: <PayloadHash>
Content-Type: application/x-amz-json-1.0
Content-Length: <PayloadSizeBytes>     
Connection: Keep-Alive
X-Amz-Target: DynamoDB_20120810.ListTables 

{
    "ExclusiveStartTableName": "Forum",
    "Limit": 3
}
        

Sample Response

HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId> 
x-amz-crc32: <Checksum>
Content-Type: application/x-amz-json-1.0
Content-Length: <PayloadSizeBytes>
Date: <Date>

{
    "LastEvaluatedTableName": "Thread",
    "TableNames": ["Forum","Reply","Thread"]
}