You can call the DescribeTable operation to query the description such as the schema information and the reserved read and write throughput of a table.

Note For more information about the DescribeTable operation, see DescribeTable.

Prerequisites

  • A Tablestore client is initialized. For more information, see Initialization.
  • A data table is created.

API operations

 /// <summary>
 /// Query the schema information and the reserved read throughput and reserved write throughput of the specified table. 
 /// </summary>
 /// <param name="request">Request parameters, including the table name.</param>
 /// <returns>Contains the schema information and the reserved read throughput and reserved write throughput of the specified table. </returns>
 public DescribeTableResponse DescribeTable(DescribeTableRequest request);

 /// <summary>
 /// Asynchronous mode of DescribeTable. 
 /// </summary>
 public Task<DescribeTableResponse> DescribeTableAsync(DescribeTableRequest request);            

Parameters

Parameter Description
tableName The name of the table.

Examples

The following code provides an example on how to query the description of a table:

 try
 {
     var request = new DescribeTableRequest("SampleTable");
     var response = otsClient.DescribeTable(request);

     // Display the description of the specified table. 
     Console.Writeline("Describe table succeeded.");
     Console.WriteLine("LastIncreaseTime: {0}", response.ReservedThroughputDetails.LastIncreaseTime);
     Console.WriteLine("LastDecreaseTime: {0}", response.ReservedThroughputDetails.LastDecreaseTime);
     Console.WriteLine("NumberOfDecreaseToday: {0}", response.ReservedThroughputDetails.LastIncreaseTime);
     Console.WriteLine("ReadCapacity: {0}", response.ReservedThroughputDetails.CapacityUnit.Read);
     Console.WriteLine("WriteCapacity: {0}", response.ReservedThroughputDetails.CapacityUnit.Write);
 }
 catch (Exception ex)
 {
     // If an exception is thrown, the operation fails and the system handles the exception. 
     Console.WriteLine("Describe table failed, exception:{0}", ex.Message);
 }           

For the detailed sample code, visit DescribeTable@GitHub.