You can call the DescribeTable operation to query the description of a table, such as the schema information, reserved read throughput, and reserved write throughput.
Prerequisites
An OTSClient instance is initialized. For more information, see Initialize an OTSClient instance.
A data table is created. For more information, see Create a data table.
API operation
/**
* Query the schema information and the reserved read throughput and reserved write throughput of the specified table.
*/
describeTable(params, callback)
Parameters
Parameter | Description |
tableName | The name of the table |
Examples
The following sample code provides an example on how to query the configuration information about a table, such as the max versions and time to live (TTL).
var client = require('./client');
var params = {
tableName: 'sampleTable'
};
client.describeTable(params, function (err, data) {
if (err) {
console.log('error:', err);
return;
}
console.log('success:', data, 'maxVersions:', data.tableOptions.maxVersions, 'timeToLive:', data.tableOptions.timeToLive);
});
References
For information about the API operation that you can call to query the description of a table, see DescribeTable. For the detailed sample code, visit DescribeTable@GitHub.
You can call API operations to read and write data in a table. For more information, see Basic operations on data.
You can update a table to modify the information about the table, such as the time to live (TTL) and max versions. For more information, see Update a table.
You can delete a data table that you no longer require. For more information, see Delete tables.