- Navigation GuideYou are on a Client landing page. Commands (operations) are listed on this page. The Client constructor type is linked at the bottom.
KeyspacesClient
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.
Installation
npm install @aws-sdk/client-keyspaces
yarn add @aws-sdk/client-keyspaces
pnpm add @aws-sdk/client-keyspaces
KeyspacesClient Operations
Command | Summary |
---|
Command | Summary |
---|---|
CreateKeyspaceCommand | The For more information, see Create a keyspace in the Amazon Keyspaces Developer Guide. |
CreateTableCommand | The For more information, see Create a table in the Amazon Keyspaces Developer Guide. |
CreateTypeCommand | The To configure the required permissions, see Permissions to create a UDT in the Amazon Keyspaces Developer Guide. For more information, see User-defined types (UDTs) in the Amazon Keyspaces Developer Guide. |
DeleteKeyspaceCommand | The |
DeleteTableCommand | The |
DeleteTypeCommand | The To configure the required permissions, see Permissions to delete a UDT in the Amazon Keyspaces Developer Guide. |
GetKeyspaceCommand | 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 |
GetTableAutoScalingSettingsCommand | 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. Amazon Keyspaces auto scaling helps you provision throughput capacity for variable workloads efficiently by increasing and decreasing your table's read and write capacity automatically in response to application traffic. For more information, see Managing throughput capacity automatically with Amazon Keyspaces auto scaling in the Amazon Keyspaces Developer Guide. To define permissions for
|
GetTableCommand | 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 |
GetTypeCommand | The To read keyspace metadata using |
ListKeyspacesCommand | The |
ListTablesCommand | The To read keyspace metadata using |
ListTagsForResourceCommand | Returns a list of all tags associated with the specified Amazon Keyspaces resource. To read keyspace metadata using |
ListTypesCommand | The To read keyspace metadata using |
RestoreTableCommand | Restores the table to the specified point in time within the Any number of users can execute up to 4 concurrent restores (any type of restore) in a given account. When you restore using point in time recovery, Amazon Keyspaces restores your source table's schema and data to the state based on the selected timestamp In addition to the table's schema, data, and TTL settings, You can also overwrite these settings during restore:
For more information, see PITR restore settings in the Amazon Keyspaces Developer Guide. Note that the following settings are not restored, and you must configure them manually for the new table:
|
TagResourceCommand | 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. For IAM policy examples that show how to control access to Amazon Keyspaces resources based on tags, see Amazon Keyspaces resource access based on tags in the Amazon Keyspaces Developer Guide. |
UntagResourceCommand | Removes the association of tags from a Amazon Keyspaces resource. |
UpdateKeyspaceCommand | 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 To add a Region to a keyspace using the
If the keyspace contains a table that is configured in provisioned mode with auto scaling enabled, the following additional IAM actions need to be allowed.
To use the
For more information, see Configure the IAM permissions required to add an Amazon Web Services Region to a keyspace in the Amazon Keyspaces Developer Guide. |
UpdateTableCommand | 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. |
KeyspacesClient Configuration
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
defaultsMode Optional | DefaultsMode | Provider<DefaultsMode> | The @smithy/smithy-client#DefaultsMode that will be used to determine how certain default configuration options are resolved in the SDK. |
disableHostPrefix Optional | boolean | Disable dynamically changing the endpoint of the client based on the hostPrefix trait of an operation. |
extensions Optional | RuntimeExtension[] | Optional extensions |
logger Optional | Logger | Optional logger for logging debug/info/warn/error. |
maxAttempts Optional | number | Provider<number> | Value for how many times a request will be made at most in case of retry. |
profile Optional | string | Setting a client profile is similar to setting a value for the AWS_PROFILE environment variable. Setting a profile on a client in code only affects the single client instance, unlike AWS_PROFILE.When set, and only for environments where an AWS configuration file exists, fields configurable by this file will be retrieved from the specified profile within that file. Conflicting code configuration and environment variables will still have higher priority.For client credential resolution that involves checking the AWS configuration file, the client's profile (this value) will be used unless a different profile is set in the credential provider options. |
region Optional | string | Provider<string> | The AWS region to which this client will send requests |
requestHandler Optional | __HttpHandlerUserInput | The HTTP handler to use or its constructor options. Fetch in browser and Https in Nodejs. |
retryMode Optional | string | Provider<string> | Specifies which retry algorithm to use. |
useDualstackEndpoint Optional | boolean | Provider<boolean> | Enables IPv6/IPv4 dualstack endpoint. |
useFipsEndpoint Optional | boolean | Provider<boolean> | Enables FIPS compatible endpoints. |
Additional config fields are described in the full configuration type: KeyspacesClientConfig