Class: Aws::Keyspaces::Client
- Inherits:
-
Seahorse::Client::Base
- Object
- Seahorse::Client::Base
- Aws::Keyspaces::Client
- Includes:
- ClientStubs
- Defined in:
- lib/aws-sdk-keyspaces/client.rb
Overview
An API client for Keyspaces. To construct a client, you need to configure a ‘:region` and `:credentials`.
client = Aws::Keyspaces::Client.new(
region: region_name,
credentials: credentials,
# ...
)
For details on configuring region and credentials see the [developer guide](/sdk-for-ruby/v3/developer-guide/setup-config.html).
See #initialize for a full list of supported configuration options.
Class Attribute Summary collapse
- .identifier ⇒ Object readonly private
API Operations collapse
-
#create_keyspace(params = {}) ⇒ Types::CreateKeyspaceResponse
The ‘CreateKeyspace` operation adds a new keyspace to your account.
-
#create_table(params = {}) ⇒ Types::CreateTableResponse
The ‘CreateTable` operation adds a new table to the specified keyspace.
-
#create_type(params = {}) ⇒ Types::CreateTypeResponse
The ‘CreateType` operation creates a new user-defined type in the specified keyspace.
-
#delete_keyspace(params = {}) ⇒ Struct
The ‘DeleteKeyspace` operation deletes a keyspace and all of its tables.
-
#delete_table(params = {}) ⇒ Struct
The ‘DeleteTable` operation deletes a table and all of its data.
-
#delete_type(params = {}) ⇒ Types::DeleteTypeResponse
The ‘DeleteType` operation deletes a user-defined type (UDT).
-
#get_keyspace(params = {}) ⇒ Types::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.
-
#get_table(params = {}) ⇒ Types::GetTableResponse
Returns information about the table, including the table’s name and current status, the keyspace name, configuration settings, and metadata.
-
#get_table_auto_scaling_settings(params = {}) ⇒ Types::GetTableAutoScalingSettingsResponse
Returns auto scaling related settings of the specified table in JSON format.
-
#get_type(params = {}) ⇒ Types::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.
-
#list_keyspaces(params = {}) ⇒ Types::ListKeyspacesResponse
The ‘ListKeyspaces` operation returns a list of keyspaces.
-
#list_tables(params = {}) ⇒ Types::ListTablesResponse
The ‘ListTables` operation returns a list of tables for a specified keyspace.
-
#list_tags_for_resource(params = {}) ⇒ Types::ListTagsForResourceResponse
Returns a list of all tags associated with the specified Amazon Keyspaces resource.
-
#list_types(params = {}) ⇒ Types::ListTypesResponse
The ‘ListTypes` operation returns a list of types for a specified keyspace.
-
#restore_table(params = {}) ⇒ Types::RestoreTableResponse
Restores the table to the specified point in time within the ‘earliest_restorable_timestamp` and the current time.
-
#tag_resource(params = {}) ⇒ Struct
Associates a set of tags with a Amazon Keyspaces resource.
-
#untag_resource(params = {}) ⇒ Struct
Removes the association of tags from a Amazon Keyspaces resource.
-
#update_keyspace(params = {}) ⇒ Types::UpdateKeyspaceResponse
Adds a new Amazon Web Services Region to the keyspace.
-
#update_table(params = {}) ⇒ Types::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.
Class Method Summary collapse
- .errors_module ⇒ Object private
Instance Method Summary collapse
- #build_request(operation_name, params = {}) ⇒ Object private
-
#initialize(options) ⇒ Client
constructor
A new instance of Client.
- #waiter_names ⇒ Object deprecated private Deprecated.
Constructor Details
#initialize(options) ⇒ Client
Returns a new instance of Client.
474 475 476 |
# File 'lib/aws-sdk-keyspaces/client.rb', line 474 def initialize(*args) super end |
Class Attribute Details
.identifier ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
2241 2242 2243 |
# File 'lib/aws-sdk-keyspaces/client.rb', line 2241 def identifier @identifier end |
Class Method Details
.errors_module ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
2244 2245 2246 |
# File 'lib/aws-sdk-keyspaces/client.rb', line 2244 def errors_module Errors end |
Instance Method Details
#build_request(operation_name, params = {}) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 |
# File 'lib/aws-sdk-keyspaces/client.rb', line 2214 def build_request(operation_name, params = {}) handlers = @handlers.for(operation_name) tracer = config.telemetry_provider.tracer_provider.tracer( Aws::Telemetry.module_to_tracer_name('Aws::Keyspaces') ) context = Seahorse::Client::RequestContext.new( operation_name: operation_name, operation: config.api.operation(operation_name), client: self, params: params, config: config, tracer: tracer ) context[:gem_name] = 'aws-sdk-keyspaces' context[:gem_version] = '1.38.0' Seahorse::Client::Request.new(handlers, context) end |
#create_keyspace(params = {}) ⇒ Types::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.
‘CreateKeyspace` is an asynchronous operation. You can monitor the creation status of the new keyspace by using the `GetKeyspace` operation.
For more information, see [Create a keyspace] in the *Amazon Keyspaces Developer Guide*.
[1]: docs.aws.amazon.com/keyspaces/latest/devguide/getting-started.keyspaces.html
547 548 549 550 |
# File 'lib/aws-sdk-keyspaces/client.rb', line 547 def create_keyspace(params = {}, = {}) req = build_request(:create_keyspace, params) req.send_request() end |
#create_table(params = {}) ⇒ Types::CreateTableResponse
The ‘CreateTable` operation adds a new table to the specified keyspace. Within a keyspace, table names must be unique.
‘CreateTable` is an asynchronous operation. When the request is received, the status of the table is set to `CREATING`. You can monitor the creation status of the new table by using the `GetTable` operation, which returns the current `status` of the table. You can start using a table when the status is `ACTIVE`.
For more information, see [Create a table] in the *Amazon Keyspaces Developer Guide*.
[1]: docs.aws.amazon.com/keyspaces/latest/devguide/getting-started.tables.html
876 877 878 879 |
# File 'lib/aws-sdk-keyspaces/client.rb', line 876 def create_table(params = {}, = {}) req = build_request(:create_table, params) req.send_request() end |
#create_type(params = {}) ⇒ Types::CreateTypeResponse
The ‘CreateType` operation creates a new user-defined type in the specified keyspace.
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*.
[1]: docs.aws.amazon.com/keyspaces/latest/devguide/configure-udt-permissions.html#udt-permissions-create [2]: docs.aws.amazon.com/keyspaces/latest/devguide/udts.html
945 946 947 948 |
# File 'lib/aws-sdk-keyspaces/client.rb', line 945 def create_type(params = {}, = {}) req = build_request(:create_type, params) req.send_request() end |
#delete_keyspace(params = {}) ⇒ Struct
The ‘DeleteKeyspace` operation deletes a keyspace and all of its tables.
968 969 970 971 |
# File 'lib/aws-sdk-keyspaces/client.rb', line 968 def delete_keyspace(params = {}, = {}) req = build_request(:delete_keyspace, params) req.send_request() end |
#delete_table(params = {}) ⇒ Struct
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.
1001 1002 1003 1004 |
# File 'lib/aws-sdk-keyspaces/client.rb', line 1001 def delete_table(params = {}, = {}) req = build_request(:delete_table, params) req.send_request() end |
#delete_type(params = {}) ⇒ Types::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.
To configure the required permissions, see [Permissions to delete a UDT] in the *Amazon Keyspaces Developer Guide*.
[1]: docs.aws.amazon.com/keyspaces/latest/devguide/configure-udt-permissions.html#udt-permissions-drop
1043 1044 1045 1046 |
# File 'lib/aws-sdk-keyspaces/client.rb', line 1043 def delete_type(params = {}, = {}) req = build_request(:delete_type, params) req.send_request() end |
#get_keyspace(params = {}) ⇒ Types::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.
1086 1087 1088 1089 |
# File 'lib/aws-sdk-keyspaces/client.rb', line 1086 def get_keyspace(params = {}, = {}) req = build_request(:get_keyspace, params) req.send_request() end |
#get_table(params = {}) ⇒ Types::GetTableResponse
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.
1169 1170 1171 1172 |
# File 'lib/aws-sdk-keyspaces/client.rb', line 1169 def get_table(params = {}, = {}) req = build_request(:get_table, params) req.send_request() end |
#get_table_auto_scaling_settings(params = {}) ⇒ Types::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.
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*.
‘GetTableAutoScalingSettings` can’t be used as an action in an IAM policy.
To define permissions for ‘GetTableAutoScalingSettings`, you must allow the following two actions in the IAM policy statement’s ‘Action` element:
-
‘application-autoscaling:DescribeScalableTargets`
-
‘application-autoscaling:DescribeScalingPolicies`
[1]: docs.aws.amazon.com/keyspaces/latest/devguide/autoscaling.html
1261 1262 1263 1264 |
# File 'lib/aws-sdk-keyspaces/client.rb', line 1261 def get_table_auto_scaling_settings(params = {}, = {}) req = build_request(:get_table_auto_scaling_settings, params) req.send_request() end |
#get_type(params = {}) ⇒ Types::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.
To read keyspace metadata using ‘GetType`, the IAM principal needs `Select` action permissions for the system keyspace. To configure the required permissions, see [Permissions to view a UDT] in the *Amazon Keyspaces Developer Guide*.
[1]: docs.aws.amazon.com/keyspaces/latest/devguide/configure-udt-permissions.html#udt-permissions-view
1328 1329 1330 1331 |
# File 'lib/aws-sdk-keyspaces/client.rb', line 1328 def get_type(params = {}, = {}) req = build_request(:get_type, params) req.send_request() end |
#list_keyspaces(params = {}) ⇒ Types::ListKeyspacesResponse
The ‘ListKeyspaces` operation returns a list of keyspaces.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1373 1374 1375 1376 |
# File 'lib/aws-sdk-keyspaces/client.rb', line 1373 def list_keyspaces(params = {}, = {}) req = build_request(:list_keyspaces, params) req.send_request() end |
#list_tables(params = {}) ⇒ Types::ListTablesResponse
The ‘ListTables` operation returns a list of tables for a specified keyspace.
To read keyspace metadata using ‘ListTables`, the IAM principal needs `Select` action permissions for the system keyspace.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1424 1425 1426 1427 |
# File 'lib/aws-sdk-keyspaces/client.rb', line 1424 def list_tables(params = {}, = {}) req = build_request(:list_tables, params) req.send_request() end |
#list_tags_for_resource(params = {}) ⇒ Types::ListTagsForResourceResponse
Returns a list of all tags associated with the specified Amazon Keyspaces resource.
To read keyspace metadata using ‘ListTagsForResource`, the IAM principal needs `Select` action permissions for the specified resource and the system keyspace.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1475 1476 1477 1478 |
# File 'lib/aws-sdk-keyspaces/client.rb', line 1475 def (params = {}, = {}) req = build_request(:list_tags_for_resource, params) req.send_request() end |
#list_types(params = {}) ⇒ Types::ListTypesResponse
The ‘ListTypes` operation returns a list of types for a specified keyspace.
To read keyspace metadata using ‘ListTypes`, the IAM principal needs `Select` action permissions for the system keyspace. To configure the required permissions, see [Permissions to view a UDT] in the *Amazon Keyspaces Developer Guide*.
[1]: docs.aws.amazon.com/keyspaces/latest/devguide/configure-udt-permissions.html#udt-permissions-view
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1530 1531 1532 1533 |
# File 'lib/aws-sdk-keyspaces/client.rb', line 1530 def list_types(params = {}, = {}) req = build_request(:list_types, params) req.send_request() end |
#restore_table(params = {}) ⇒ Types::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*.
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 ‘(day:hour:minute:second)` to a new table. The Time to Live (TTL) settings are also restored to the state based on the selected timestamp.
In addition to the table’s schema, data, and TTL settings, ‘RestoreTable` restores the capacity mode, auto scaling settings, encryption settings, and point-in-time recovery settings from the source table. Unlike the table’s schema data and TTL settings, which are restored based on the selected timestamp, these settings are always restored based on the table’s settings as of the current time or when the table was deleted.
You can also overwrite these settings during restore:
-
Read/write capacity mode
-
Provisioned throughput capacity units
-
Auto scaling settings
-
Point-in-time (PITR) settings
-
Tags
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:
-
Identity and Access Management (IAM) policies
-
Amazon CloudWatch metrics and alarms
[1]: docs.aws.amazon.com/keyspaces/latest/devguide/PointInTimeRecovery_HowItWorks.html#howitworks_backup_window [2]: docs.aws.amazon.com/keyspaces/latest/devguide/PointInTimeRecovery_HowItWorks.html#howitworks_backup_settings
1771 1772 1773 1774 |
# File 'lib/aws-sdk-keyspaces/client.rb', line 1771 def restore_table(params = {}, = {}) req = build_request(:restore_table, params) req.send_request() end |
#tag_resource(params = {}) ⇒ Struct
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*.
[1]: docs.aws.amazon.com/keyspaces/latest/devguide/tagging-keyspaces.html [2]: docs.aws.amazon.com/keyspaces/latest/devguide/security_iam_id-based-policy-examples.html#security_iam_id-based-policy-examples-tags
1816 1817 1818 1819 |
# File 'lib/aws-sdk-keyspaces/client.rb', line 1816 def tag_resource(params = {}, = {}) req = build_request(:tag_resource, params) req.send_request() end |
#untag_resource(params = {}) ⇒ Struct
Removes the association of tags from a Amazon Keyspaces resource.
1849 1850 1851 1852 |
# File 'lib/aws-sdk-keyspaces/client.rb', line 1849 def untag_resource(params = {}, = {}) req = build_request(:untag_resource, params) req.send_request() end |
#update_keyspace(params = {}) ⇒ Types::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*.
To add a Region to a keyspace using the ‘UpdateKeyspace` API, the IAM principal needs permissions for the following IAM actions:
-
‘cassandra:Alter`
-
‘cassandra:AlterMultiRegionResource`
-
‘cassandra:Create`
-
‘cassandra:CreateMultiRegionResource`
-
‘cassandra:Select`
-
‘cassandra:SelectMultiRegionResource`
-
‘cassandra:Modify`
-
‘cassandra:ModifyMultiRegionResource`
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.
-
‘application-autoscaling:RegisterScalableTarget`
-
‘application-autoscaling:DeregisterScalableTarget`
-
‘application-autoscaling:DescribeScalableTargets`
-
‘application-autoscaling:PutScalingPolicy`
-
‘application-autoscaling:DescribeScalingPolicies`
To use the ‘UpdateKeyspace` API, the IAM principal also needs permissions to create a service-linked role with the following elements:
-
‘iam:CreateServiceLinkedRole` - The action the principal can perform.
-
‘arn:aws:iam::*:role/aws-service-role/replication.cassandra.amazonaws.com/AWSServiceRoleForKeyspacesReplication`
-
The resource that the action can be performed on.
-
-
‘iam:AWSServiceName: replication.cassandra.amazonaws.com` - The only Amazon Web Services service that this role can be attached to is Amazon Keyspaces.
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*.
[1]: docs.aws.amazon.com/keyspaces/latest/devguide/client-side-timestamps.html [2]: docs.aws.amazon.com/keyspaces/latest/devguide/howitworks_replication_permissions_addReplica.html
1968 1969 1970 1971 |
# File 'lib/aws-sdk-keyspaces/client.rb', line 1968 def update_keyspace(params = {}, = {}) req = build_request(:update_keyspace, params) req.send_request() end |
#update_table(params = {}) ⇒ Types::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.
2205 2206 2207 2208 |
# File 'lib/aws-sdk-keyspaces/client.rb', line 2205 def update_table(params = {}, = {}) req = build_request(:update_table, params) req.send_request() end |
#waiter_names ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
2234 2235 2236 |
# File 'lib/aws-sdk-keyspaces/client.rb', line 2234 def waiter_names [] end |