Use Tablestore SDK for Python to query a table's schema, configurations, encryption settings, reserved throughput, and secondary indexes.
Prerequisites
Install the Tablestore SDK for Python and initialize a client.
Function description
Call the describe_table method to query a table. The method returns a DescribeTableResponse that contains the current table information.
def describe_table(self, table_name)
The following example queries example_table and prints the main fields in the response.
response = client.describe_table("example_table")
print("Table metadata:", response.table_meta)
print("Table options:", response.table_options)
print("Encryption settings:", response.sse_details)
print(
"Reserved throughput:",
response.reserved_throughput_details,
)
print("Secondary indexes:", response.secondary_indexes)
Parameters
The describe_table method contains the following parameter.
|
Name |
Type |
Description |
|
table_name (required) |
|
The name of the table. |
Response
DescribeTableResponse contains the following business information.
|
Field |
Type |
Description |
|
table_meta |
|
The table schema, including the table name, primary key columns, and predefined columns. |
|
table_options |
|
The table configurations, including the TTL, maximum number of versions, maximum version deviation, and whether updates are allowed. |
|
reserved_throughput_details |
|
The current reserved throughput and the times of the latest increase and decrease. |
|
secondary_indexes |
|
The secondary index metadata, including the index name, primary key columns, predefined columns, and index type. |
|
sse_details |
|
The server-side encryption settings, including the enablement status, key type, key ID, and RAM role ARN. |