DescribeTable
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.
Important
For global tables, this operation only applies to global tables using Version 2019.11.21 (Current version).
Note
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.
Request Syntax
{
"TableName": "string
"
}
Request Parameters
The request accepts the following data in JSON format.
Note
In the following list, the required parameters are described first.
- TableName
-
The name of the table to describe. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 1024.
Required: Yes
Response Syntax
{
"Table": {
"ArchivalSummary": {
"ArchivalBackupArn": "string",
"ArchivalDateTime": number,
"ArchivalReason": "string"
},
"AttributeDefinitions": [
{
"AttributeName": "string",
"AttributeType": "string"
}
],
"BillingModeSummary": {
"BillingMode": "string",
"LastUpdateToPayPerRequestDateTime": number
},
"CreationDateTime": number,
"DeletionProtectionEnabled": boolean,
"GlobalSecondaryIndexes": [
{
"Backfilling": boolean,
"IndexArn": "string",
"IndexName": "string",
"IndexSizeBytes": number,
"IndexStatus": "string",
"ItemCount": number,
"KeySchema": [
{
"AttributeName": "string",
"KeyType": "string"
}
],
"OnDemandThroughput": {
"MaxReadRequestUnits": number,
"MaxWriteRequestUnits": number
},
"Projection": {
"NonKeyAttributes": [ "string" ],
"ProjectionType": "string"
},
"ProvisionedThroughput": {
"LastDecreaseDateTime": number,
"LastIncreaseDateTime": number,
"NumberOfDecreasesToday": number,
"ReadCapacityUnits": number,
"WriteCapacityUnits": number
}
}
],
"GlobalTableVersion": "string",
"ItemCount": number,
"KeySchema": [
{
"AttributeName": "string",
"KeyType": "string"
}
],
"LatestStreamArn": "string",
"LatestStreamLabel": "string",
"LocalSecondaryIndexes": [
{
"IndexArn": "string",
"IndexName": "string",
"IndexSizeBytes": number,
"ItemCount": number,
"KeySchema": [
{
"AttributeName": "string",
"KeyType": "string"
}
],
"Projection": {
"NonKeyAttributes": [ "string" ],
"ProjectionType": "string"
}
}
],
"OnDemandThroughput": {
"MaxReadRequestUnits": number,
"MaxWriteRequestUnits": number
},
"ProvisionedThroughput": {
"LastDecreaseDateTime": number,
"LastIncreaseDateTime": number,
"NumberOfDecreasesToday": number,
"ReadCapacityUnits": number,
"WriteCapacityUnits": number
},
"Replicas": [
{
"GlobalSecondaryIndexes": [
{
"IndexName": "string",
"OnDemandThroughputOverride": {
"MaxReadRequestUnits": number
},
"ProvisionedThroughputOverride": {
"ReadCapacityUnits": number
}
}
],
"KMSMasterKeyId": "string",
"OnDemandThroughputOverride": {
"MaxReadRequestUnits": number
},
"ProvisionedThroughputOverride": {
"ReadCapacityUnits": number
},
"RegionName": "string",
"ReplicaInaccessibleDateTime": number,
"ReplicaStatus": "string",
"ReplicaStatusDescription": "string",
"ReplicaStatusPercentProgress": "string",
"ReplicaTableClassSummary": {
"LastUpdateDateTime": number,
"TableClass": "string"
}
}
],
"RestoreSummary": {
"RestoreDateTime": number,
"RestoreInProgress": boolean,
"SourceBackupArn": "string",
"SourceTableArn": "string"
},
"SSEDescription": {
"InaccessibleEncryptionDateTime": number,
"KMSMasterKeyArn": "string",
"SSEType": "string",
"Status": "string"
},
"StreamSpecification": {
"StreamEnabled": boolean,
"StreamViewType": "string"
},
"TableArn": "string",
"TableClassSummary": {
"LastUpdateDateTime": number,
"TableClass": "string"
},
"TableId": "string",
"TableName": "string",
"TableSizeBytes": number,
"TableStatus": "string"
}
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- Table
-
The properties of the table.
Type: TableDescription object
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
- 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
.HTTP Status Code: 400
Examples
Describe a Table
This example describes the Thread
table.
Sample Request
POST / HTTP/1.1
Host: dynamodb.<region>.<domain>;
Accept-Encoding: identity
Content-Length: <PayloadSizeBytes>
User-Agent: <UserAgentString>
Content-Type: application/x-amz-json-1.0
Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature>
X-Amz-Date: <Date>
X-Amz-Target: DynamoDB_20120810.DescribeTable
{
"TableName":"Thread"
}
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>
{
"Table": {
"TableArn": "arn:aws:dynamodb:us-west-2:123456789012:table/Thread",
"AttributeDefinitions": [
{
"AttributeName": "ForumName",
"AttributeType": "S"
},
{
"AttributeName": "LastPostDateTime",
"AttributeType": "S"
},
{
"AttributeName": "Subject",
"AttributeType": "S"
}
],
"CreationDateTime": 1.363729002358E9,
"ItemCount": 0,
"KeySchema": [
{
"AttributeName": "ForumName",
"KeyType": "HASH"
},
{
"AttributeName": "Subject",
"KeyType": "RANGE"
}
],
"LocalSecondaryIndexes": [
{
"IndexArn": "arn:aws:dynamodb:us-west-2:123456789012:table/Thread/index/LastPostIndex",
"IndexName": "LastPostIndex",
"IndexSizeBytes": 0,
"ItemCount": 0,
"KeySchema": [
{
"AttributeName": "ForumName",
"KeyType": "HASH"
},
{
"AttributeName": "LastPostDateTime",
"KeyType": "RANGE"
}
],
"Projection": {
"ProjectionType": "KEYS_ONLY"
}
}
],
"ProvisionedThroughput": {
"NumberOfDecreasesToday": 0,
"ReadCapacityUnits": 5,
"WriteCapacityUnits": 5
},
"TableName": "Thread",
"TableSizeBytes": 0,
"TableStatus": "ACTIVE"
}
}
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: