Keyspaces class

Amazon Keyspaces (for Apache Cassandra) is a scalable, highly available, and managed Apache Cassandra-compatible database service. Amazon Keyspaces makes it easy to migrate, run, and scale Cassandra workloads in the Amazon Web Services Cloud. With just a few clicks on the Amazon Web Services Management Console or a few lines of code, you can create keyspaces and tables in Amazon Keyspaces, without deploying any infrastructure or installing software.

In addition to supporting Cassandra Query Language (CQL) requests via open-source Cassandra drivers, Amazon Keyspaces supports data definition language (DDL) operations to manage keyspaces and tables using the Amazon Web Services SDK and CLI, as well as infrastructure as code (IaC) services and tools such as CloudFormation and Terraform. This API reference describes the supported DDL operations in detail.

For the list of all supported CQL APIs, see Supported Cassandra APIs, operations, and data types in Amazon Keyspaces in the Amazon Keyspaces Developer Guide.

To learn how Amazon Keyspaces API actions are recorded with CloudTrail, see Amazon Keyspaces information in CloudTrail in the Amazon Keyspaces Developer Guide.

For more information about Amazon Web Services APIs, for example how to implement retry logic or how to sign Amazon Web Services API requests, see Amazon Web Services APIs in the General Reference.

Constructors

Keyspaces({required String region, AwsClientCredentials? credentials, AwsClientCredentialsProvider? credentialsProvider, Client? client, String? endpointUrl})

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() → void
Closes the internal HTTP client if none was provided at creation. If a client was passed as a constructor argument, this becomes a noop.
createKeyspace({required String keyspaceName, ReplicationSpecification? replicationSpecification, List<Tag>? tags}) Future<CreateKeyspaceResponse>
The CreateKeyspace operation adds a new keyspace to your account. In an Amazon Web Services account, keyspace names must be unique within each Region.
createTable({required String keyspaceName, required SchemaDefinition schemaDefinition, required String tableName, AutoScalingSpecification? autoScalingSpecification, CapacitySpecification? capacitySpecification, CdcSpecification? cdcSpecification, ClientSideTimestamps? clientSideTimestamps, Comment? comment, int? defaultTimeToLive, EncryptionSpecification? encryptionSpecification, PointInTimeRecovery? pointInTimeRecovery, List<ReplicaSpecification>? replicaSpecifications, List<Tag>? tags, TimeToLive? ttl, WarmThroughputSpecification? warmThroughputSpecification}) Future<CreateTableResponse>
The CreateTable operation adds a new table to the specified keyspace. Within a keyspace, table names must be unique.
createType({required List<FieldDefinition> fieldDefinitions, required String keyspaceName, required String typeName}) Future<CreateTypeResponse>
The CreateType operation creates a new user-defined type in the specified keyspace.
deleteKeyspace({required String keyspaceName}) Future<void>
The DeleteKeyspace operation deletes a keyspace and all of its tables.
deleteTable({required String keyspaceName, required String tableName}) Future<void>
The DeleteTable operation deletes a table and all of its data. After a DeleteTable request is received, the specified table is in the DELETING state until Amazon Keyspaces completes the deletion. If the table is in the ACTIVE state, you can delete it. If a table is either in the CREATING or UPDATING states, then Amazon Keyspaces returns a ResourceInUseException. If the specified table does not exist, Amazon Keyspaces returns a ResourceNotFoundException. If the table is already in the DELETING state, no error is returned.
deleteType({required String keyspaceName, required String typeName}) Future<DeleteTypeResponse>
The DeleteType operation deletes a user-defined type (UDT). You can only delete a type that is not used in a table or another UDT.
getKeyspace({required String keyspaceName}) Future<GetKeyspaceResponse>
Returns the name of the specified keyspace, the Amazon Resource Name (ARN), the replication strategy, the Amazon Web Services Regions of a multi-Region keyspace, and the status of newly added Regions after an UpdateKeyspace operation.
getTable({required String keyspaceName, required String tableName}) Future<GetTableResponse>
Returns information about the table, including the table's name and current status, the keyspace name, configuration settings, and metadata.
getTableAutoScalingSettings({required String keyspaceName, required String tableName}) Future<GetTableAutoScalingSettingsResponse>
Returns auto scaling related settings of the specified table in JSON format. If the table is a multi-Region table, the Amazon Web Services Region specific auto scaling settings of the table are included.
getType({required String keyspaceName, required String typeName}) Future<GetTypeResponse>
The GetType operation returns information about the type, for example the field definitions, the timestamp when the type was last modified, the level of nesting, the status, and details about if the type is used in other types and tables.
listKeyspaces({int? maxResults, String? nextToken}) Future<ListKeyspacesResponse>
The ListKeyspaces operation returns a list of keyspaces.
listTables({required String keyspaceName, int? maxResults, String? nextToken}) Future<ListTablesResponse>
The ListTables operation returns a list of tables for a specified keyspace.
listTagsForResource({required String resourceArn, int? maxResults, String? nextToken}) Future<ListTagsForResourceResponse>
Returns a list of all tags associated with the specified Amazon Keyspaces resource.
listTypes({required String keyspaceName, int? maxResults, String? nextToken}) Future<ListTypesResponse>
The ListTypes operation returns a list of types for a specified keyspace.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
restoreTable({required String sourceKeyspaceName, required String sourceTableName, required String targetKeyspaceName, required String targetTableName, AutoScalingSpecification? autoScalingSpecification, CapacitySpecification? capacitySpecificationOverride, EncryptionSpecification? encryptionSpecificationOverride, PointInTimeRecovery? pointInTimeRecoveryOverride, List<ReplicaSpecification>? replicaSpecifications, DateTime? restoreTimestamp, List<Tag>? tagsOverride}) Future<RestoreTableResponse>
Restores the table to the specified point in time within the earliest_restorable_timestamp and the current time. For more information about restore points, see Time window for PITR continuous backups in the Amazon Keyspaces Developer Guide.
tagResource({required String resourceArn, required List<Tag> tags}) Future<void>
Associates a set of tags with a Amazon Keyspaces resource. You can then activate these user-defined tags so that they appear on the Cost Management Console for cost allocation tracking. For more information, see Adding tags and labels to Amazon Keyspaces resources in the Amazon Keyspaces Developer Guide.
toString() String
A string representation of this object.
inherited
untagResource({required String resourceArn, required List<Tag> tags}) Future<void>
Removes the association of tags from a Amazon Keyspaces resource.
updateKeyspace({required String keyspaceName, required ReplicationSpecification replicationSpecification, ClientSideTimestamps? clientSideTimestamps}) Future<UpdateKeyspaceResponse>
Adds a new Amazon Web Services Region to the keyspace. You can add a new Region to a keyspace that is either a single or a multi-Region keyspace. Amazon Keyspaces is going to replicate all tables in the keyspace to the new Region. To successfully replicate all tables to the new Region, they must use client-side timestamps for conflict resolution. To enable client-side timestamps, specify clientSideTimestamps.status = enabled when invoking the API. For more information about client-side timestamps, see Client-side timestamps in Amazon Keyspaces in the Amazon Keyspaces Developer Guide.
updateTable({required String keyspaceName, required String tableName, List<ColumnDefinition>? addColumns, AutoScalingSpecification? autoScalingSpecification, CapacitySpecification? capacitySpecification, CdcSpecification? cdcSpecification, ClientSideTimestamps? clientSideTimestamps, int? defaultTimeToLive, EncryptionSpecification? encryptionSpecification, PointInTimeRecovery? pointInTimeRecovery, List<ReplicaSpecification>? replicaSpecifications, TimeToLive? ttl, WarmThroughputSpecification? warmThroughputSpecification}) Future<UpdateTableResponse>
Adds new columns to the table or updates one of the table's settings, for example capacity mode, auto scaling, encryption, point-in-time recovery, or ttl settings. Note that you can only update one specific table setting per update operation.

Operators

operator ==(Object other) bool
The equality operator.
inherited