getTable method

Future<GetTableResponse> getTable({
  1. required String keyspaceName,
  2. required String tableName,
})

Returns information about the table, including the table's name and current status, the keyspace name, configuration settings, and metadata.

To read table metadata using GetTable, the IAM principal needs Select action permissions for the table and the system keyspace.

May throw AccessDeniedException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ValidationException.

Parameter keyspaceName : The name of the keyspace that the table is stored in.

Parameter tableName : The name of the table.

Implementation

Future<GetTableResponse> getTable({
  required String keyspaceName,
  required String tableName,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'KeyspacesService.GetTable'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'keyspaceName': keyspaceName,
      'tableName': tableName,
    },
  );

  return GetTableResponse.fromJson(jsonResponse.body);
}