ListTablesCommand

Provides a list of tables, along with the name, status, and retention properties of each table. See code sample  for details.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { TimestreamWriteClient, ListTablesCommand } from "@aws-sdk/client-timestream-write"; // ES Modules import
// const { TimestreamWriteClient, ListTablesCommand } = require("@aws-sdk/client-timestream-write"); // CommonJS import
const client = new TimestreamWriteClient(config);
const input = { // ListTablesRequest
  DatabaseName: "STRING_VALUE",
  NextToken: "STRING_VALUE",
  MaxResults: Number("int"),
};
const command = new ListTablesCommand(input);
const response = await client.send(command);
// { // ListTablesResponse
//   Tables: [ // TableList
//     { // Table
//       Arn: "STRING_VALUE",
//       TableName: "STRING_VALUE",
//       DatabaseName: "STRING_VALUE",
//       TableStatus: "ACTIVE" || "DELETING" || "RESTORING",
//       RetentionProperties: { // RetentionProperties
//         MemoryStoreRetentionPeriodInHours: Number("long"), // required
//         MagneticStoreRetentionPeriodInDays: Number("long"), // required
//       },
//       CreationTime: new Date("TIMESTAMP"),
//       LastUpdatedTime: new Date("TIMESTAMP"),
//       MagneticStoreWriteProperties: { // MagneticStoreWriteProperties
//         EnableMagneticStoreWrites: true || false, // required
//         MagneticStoreRejectedDataLocation: { // MagneticStoreRejectedDataLocation
//           S3Configuration: { // S3Configuration
//             BucketName: "STRING_VALUE",
//             ObjectKeyPrefix: "STRING_VALUE",
//             EncryptionOption: "SSE_S3" || "SSE_KMS",
//             KmsKeyId: "STRING_VALUE",
//           },
//         },
//       },
//       Schema: { // Schema
//         CompositePartitionKey: [ // PartitionKeyList
//           { // PartitionKey
//             Type: "DIMENSION" || "MEASURE", // required
//             Name: "STRING_VALUE",
//             EnforcementInRecord: "REQUIRED" || "OPTIONAL",
//           },
//         ],
//       },
//     },
//   ],
//   NextToken: "STRING_VALUE",
// };

ListTablesCommand Input

See ListTablesCommandInput for more details

Parameter
Type
Description
DatabaseName
string | undefined

The name of the Timestream database.

MaxResults
number | undefined

The total number of items to return in the output. If the total number of items available is more than the value specified, a NextToken is provided in the output. To resume pagination, provide the NextToken value as argument of a subsequent API invocation.

NextToken
string | undefined

The pagination token. To resume pagination, provide the NextToken value as argument of a subsequent API invocation.

ListTablesCommand Output

See ListTablesCommandOutput for details

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
NextToken
string | undefined

A token to specify where to start paginating. This is the NextToken from a previously truncated response.

Tables
Table[] | undefined

A list of tables.

Throws

Name
Fault
Details
AccessDeniedException
client

You are not authorized to perform this action.

InternalServerException
server

Timestream was unable to fully process this request because of an internal server error.

InvalidEndpointException
client

The requested endpoint was not valid.

ResourceNotFoundException
client

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

ThrottlingException
client

Too many requests were made by a user and they exceeded the service quotas. The request was throttled.

ValidationException
client

An invalid or malformed request.

TimestreamWriteServiceException
Base exception class for all service exceptions from TimestreamWrite service.