Struct aws_sdk_keyspaces::Client
source · [−]pub struct Client { /* private fields */ }
Expand description
Client for Amazon Keyspaces
Client for invoking operations on Amazon Keyspaces. Each operation on Amazon Keyspaces is a method on this
this struct. .send()
MUST be invoked on the generated operations to dispatch the request to the service.
Examples
Constructing a client and invoking an operation
// create a shared configuration. This can be used & shared between multiple service clients.
let shared_config = aws_config::load_from_env().await;
let client = aws_sdk_keyspaces::Client::new(&shared_config);
// invoke an operation
/* let rsp = client
.<operation_name>().
.<param>("some value")
.send().await; */
Constructing a client with custom configuration
use aws_config::RetryConfig;
let shared_config = aws_config::load_from_env().await;
let config = aws_sdk_keyspaces::config::Builder::from(&shared_config)
.retry_config(RetryConfig::disabled())
.build();
let client = aws_sdk_keyspaces::Client::from_conf(config);
Implementations
sourceimpl Client
impl Client
sourcepub fn with_config(
client: Client<DynConnector, DynMiddleware<DynConnector>>,
conf: Config
) -> Self
pub fn with_config(
client: Client<DynConnector, DynMiddleware<DynConnector>>,
conf: Config
) -> Self
Creates a client with the given service configuration.
sourceimpl Client
impl Client
sourcepub fn create_keyspace(&self) -> CreateKeyspace
pub fn create_keyspace(&self) -> CreateKeyspace
Constructs a fluent builder for the CreateKeyspace
operation.
- The fluent builder is configurable:
keyspace_name(impl Into<String>)
/set_keyspace_name(Option<String>)
:The name of the keyspace to be created.
tags(Vec<Tag>)
/set_tags(Option<Vec<Tag>>)
:A list of key-value pair tags to be attached to the keyspace.
For more information, see Adding tags and labels to Amazon Keyspaces resources in the Amazon Keyspaces Developer Guide.
- On success, responds with
CreateKeyspaceOutput
with field(s):resource_arn(Option<String>)
:The unique identifier of the keyspace in the format of an Amazon Resource Name (ARN).
- On failure, responds with
SdkError<CreateKeyspaceError>
sourcepub fn create_table(&self) -> CreateTable
pub fn create_table(&self) -> CreateTable
Constructs a fluent builder for the CreateTable
operation.
- The fluent builder is configurable:
keyspace_name(impl Into<String>)
/set_keyspace_name(Option<String>)
:The name of the keyspace that the table is going to be created in.
table_name(impl Into<String>)
/set_table_name(Option<String>)
:The name of the table.
schema_definition(SchemaDefinition)
/set_schema_definition(Option<SchemaDefinition>)
:The
schemaDefinition
consists of the following parameters.For each column to be created:
•
name
- The name of the column.•
type
- An Amazon Keyspaces data type. For more information, see Data types in the Amazon Keyspaces Developer Guide.The primary key of the table consists of the following columns:
•
partitionKeys
- The partition key can be a single column, or it can be a compound value composed of two or more columns. The partition key portion of the primary key is required and determines how Amazon Keyspaces stores your data.•
name
- The name of each partition key column.•
clusteringKeys
- The optional clustering column portion of your primary key determines how the data is clustered and sorted within each partition.•
name
- The name of the clustering column.•
orderBy
- Sets the ascendant (ASC
) or descendant (DESC
) order modifier.To define a column as static use
staticColumns
- Static columns store values that are shared by all rows in the same partition:•
name
- The name of the column.•
type
- An Amazon Keyspaces data type.comment(Comment)
/set_comment(Option<Comment>)
:This parameter allows to enter a description of the table.
capacity_specification(CapacitySpecification)
/set_capacity_specification(Option<CapacitySpecification>)
:Specifies the read/write throughput capacity mode for the table. The options are:
•
throughputMode:PAY_PER_REQUEST
and•
throughputMode:PROVISIONED
- Provisioned capacity mode requiresreadCapacityUnits
andwriteCapacityUnits
as input.The default is
throughput_mode:PAY_PER_REQUEST
.For more information, see Read/write capacity modes in the Amazon Keyspaces Developer Guide.
encryption_specification(EncryptionSpecification)
/set_encryption_specification(Option<EncryptionSpecification>)
:Specifies how the encryption key for encryption at rest is managed for the table. You can choose one of the following KMS key (KMS key):
•
type:AWS_OWNED_KMS_KEY
- This key is owned by Amazon Keyspaces.•
type:CUSTOMER_MANAGED_KMS_KEY
- This key is stored in your account and is created, owned, and managed by you. This option requires thekms_key_identifier
of the KMS key in Amazon Resource Name (ARN) format as input.The default is
type:AWS_OWNED_KMS_KEY
.For more information, see Encryption at rest in the Amazon Keyspaces Developer Guide.
point_in_time_recovery(PointInTimeRecovery)
/set_point_in_time_recovery(Option<PointInTimeRecovery>)
:Specifies if
pointInTimeRecovery
is enabled or disabled for the table. The options are:•
ENABLED
•
DISABLED
If it’s not specified, the default is
DISABLED
.For more information, see Point-in-time recovery in the Amazon Keyspaces Developer Guide.
ttl(TimeToLive)
/set_ttl(Option<TimeToLive>)
:Enables Time to Live custom settings for the table. The options are:
•
status:enabled
•
status:disabled
The default is
status:disabled
. Afterttl
is enabled, you can’t disable it for the table.For more information, see Expiring data by using Amazon Keyspaces Time to Live (TTL) in the Amazon Keyspaces Developer Guide.
default_time_to_live(i32)
/set_default_time_to_live(Option<i32>)
:The default Time to Live setting in seconds for the table.
For more information, see Setting the default TTL value for a table in the Amazon Keyspaces Developer Guide.
tags(Vec<Tag>)
/set_tags(Option<Vec<Tag>>)
:A list of key-value pair tags to be attached to the resource.
For more information, see Adding tags and labels to Amazon Keyspaces resources in the Amazon Keyspaces Developer Guide.
- On success, responds with
CreateTableOutput
with field(s):resource_arn(Option<String>)
:The unique identifier of the table in the format of an Amazon Resource Name (ARN).
- On failure, responds with
SdkError<CreateTableError>
sourcepub fn delete_keyspace(&self) -> DeleteKeyspace
pub fn delete_keyspace(&self) -> DeleteKeyspace
Constructs a fluent builder for the DeleteKeyspace
operation.
- The fluent builder is configurable:
keyspace_name(impl Into<String>)
/set_keyspace_name(Option<String>)
:The name of the keyspace to be deleted.
- On success, responds with
DeleteKeyspaceOutput
- On failure, responds with
SdkError<DeleteKeyspaceError>
sourcepub fn delete_table(&self) -> DeleteTable
pub fn delete_table(&self) -> DeleteTable
Constructs a fluent builder for the DeleteTable
operation.
- The fluent builder is configurable:
keyspace_name(impl Into<String>)
/set_keyspace_name(Option<String>)
:The name of the keyspace of the to be deleted table.
table_name(impl Into<String>)
/set_table_name(Option<String>)
:The name of the table to be deleted.
- On success, responds with
DeleteTableOutput
- On failure, responds with
SdkError<DeleteTableError>
sourcepub fn get_keyspace(&self) -> GetKeyspace
pub fn get_keyspace(&self) -> GetKeyspace
Constructs a fluent builder for the GetKeyspace
operation.
- The fluent builder is configurable:
keyspace_name(impl Into<String>)
/set_keyspace_name(Option<String>)
:The name of the keyspace.
- On success, responds with
GetKeyspaceOutput
with field(s):keyspace_name(Option<String>)
:The name of the keyspace.
resource_arn(Option<String>)
:The ARN of the keyspace.
- On failure, responds with
SdkError<GetKeyspaceError>
sourcepub fn get_table(&self) -> GetTable
pub fn get_table(&self) -> GetTable
Constructs a fluent builder for the GetTable
operation.
- The fluent builder is configurable:
keyspace_name(impl Into<String>)
/set_keyspace_name(Option<String>)
:The name of the keyspace that the table is stored in.
table_name(impl Into<String>)
/set_table_name(Option<String>)
:The name of the table.
- On success, responds with
GetTableOutput
with field(s):keyspace_name(Option<String>)
:The name of the keyspace that the specified table is stored in.
table_name(Option<String>)
:The name of the specified table.
resource_arn(Option<String>)
:The Amazon Resource Name (ARN) of the specified table.
creation_timestamp(Option<DateTime>)
:The creation timestamp of the specified table.
status(Option<TableStatus>)
:The current status of the specified table.
schema_definition(Option<SchemaDefinition>)
:The schema definition of the specified table.
capacity_specification(Option<CapacitySpecificationSummary>)
:The read/write throughput capacity mode for a table. The options are:
•
throughputMode:PAY_PER_REQUEST
•
throughputMode:PROVISIONED
encryption_specification(Option<EncryptionSpecification>)
:The encryption settings of the specified table.
point_in_time_recovery(Option<PointInTimeRecoverySummary>)
:The point-in-time recovery status of the specified table.
ttl(Option<TimeToLive>)
:The custom Time to Live settings of the specified table.
default_time_to_live(Option<i32>)
:The default Time to Live settings of the specified table.
comment(Option<Comment>)
:The the description of the specified table.
- On failure, responds with
SdkError<GetTableError>
sourcepub fn list_keyspaces(&self) -> ListKeyspaces
pub fn list_keyspaces(&self) -> ListKeyspaces
Constructs a fluent builder for the ListKeyspaces
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
next_token(impl Into<String>)
/set_next_token(Option<String>)
:The pagination token. To resume pagination, provide the
NextToken
value as argument of a subsequent API invocation.max_results(i32)
/set_max_results(Option<i32>)
:The total number of keyspaces to return in the output. If the total number of keyspaces available is more than the value specified, a
NextToken
is provided in the output. To resume pagination, provide theNextToken
value as an argument of a subsequent API invocation.
- On success, responds with
ListKeyspacesOutput
with field(s):next_token(Option<String>)
:A token to specify where to start paginating. This is the
NextToken
from a previously truncated response.keyspaces(Option<Vec<KeyspaceSummary>>)
:A list of keyspaces.
- On failure, responds with
SdkError<ListKeyspacesError>
sourcepub fn list_tables(&self) -> ListTables
pub fn list_tables(&self) -> ListTables
Constructs a fluent builder for the ListTables
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
next_token(impl Into<String>)
/set_next_token(Option<String>)
:The pagination token. To resume pagination, provide the
NextToken
value as an argument of a subsequent API invocation.max_results(i32)
/set_max_results(Option<i32>)
:The total number of tables to return in the output. If the total number of tables available is more than the value specified, a
NextToken
is provided in the output. To resume pagination, provide theNextToken
value as an argument of a subsequent API invocation.keyspace_name(impl Into<String>)
/set_keyspace_name(Option<String>)
:The name of the keyspace.
- On success, responds with
ListTablesOutput
with field(s):next_token(Option<String>)
:A token to specify where to start paginating. This is the
NextToken
from a previously truncated response.tables(Option<Vec<TableSummary>>)
:A list of tables.
- On failure, responds with
SdkError<ListTablesError>
Constructs a fluent builder for the ListTagsForResource
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:The Amazon Resource Name (ARN) of the Amazon Keyspaces resource.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:The pagination token. To resume pagination, provide the
NextToken
value as argument of a subsequent API invocation.max_results(i32)
/set_max_results(Option<i32>)
:The total number of tags to return in the output. If the total number of tags available is more than the value specified, a
NextToken
is provided in the output. To resume pagination, provide theNextToken
value as an argument of a subsequent API invocation.
- On success, responds with
ListTagsForResourceOutput
with field(s):next_token(Option<String>)
:A token to specify where to start paginating. This is the
NextToken
from a previously truncated response.tags(Option<Vec<Tag>>)
:A list of tags.
- On failure, responds with
SdkError<ListTagsForResourceError>
sourcepub fn restore_table(&self) -> RestoreTable
pub fn restore_table(&self) -> RestoreTable
Constructs a fluent builder for the RestoreTable
operation.
- The fluent builder is configurable:
source_keyspace_name(impl Into<String>)
/set_source_keyspace_name(Option<String>)
:The keyspace name of the source table.
source_table_name(impl Into<String>)
/set_source_table_name(Option<String>)
:The name of the source table.
target_keyspace_name(impl Into<String>)
/set_target_keyspace_name(Option<String>)
:The name of the target keyspace.
target_table_name(impl Into<String>)
/set_target_table_name(Option<String>)
:The name of the target table.
restore_timestamp(DateTime)
/set_restore_timestamp(Option<DateTime>)
:The restore timestamp in ISO 8601 format.
capacity_specification_override(CapacitySpecification)
/set_capacity_specification_override(Option<CapacitySpecification>)
:Specifies the read/write throughput capacity mode for the target table. The options are:
•
throughputMode:PAY_PER_REQUEST
•
throughputMode:PROVISIONED
- Provisioned capacity mode requiresreadCapacityUnits
andwriteCapacityUnits
as input.The default is
throughput_mode:PAY_PER_REQUEST
.For more information, see Read/write capacity modes in the Amazon Keyspaces Developer Guide.
encryption_specification_override(EncryptionSpecification)
/set_encryption_specification_override(Option<EncryptionSpecification>)
:Specifies the encryption settings for the target table. You can choose one of the following KMS key (KMS key):
•
type:AWS_OWNED_KMS_KEY
- This key is owned by Amazon Keyspaces.•
type:CUSTOMER_MANAGED_KMS_KEY
- This key is stored in your account and is created, owned, and managed by you. This option requires thekms_key_identifier
of the KMS key in Amazon Resource Name (ARN) format as input.The default is
type:AWS_OWNED_KMS_KEY
.For more information, see Encryption at rest in the Amazon Keyspaces Developer Guide.
point_in_time_recovery_override(PointInTimeRecovery)
/set_point_in_time_recovery_override(Option<PointInTimeRecovery>)
:Specifies the
pointInTimeRecovery
settings for the target table. The options are:•
ENABLED
•
DISABLED
If it’s not specified, the default is
DISABLED
.For more information, see Point-in-time recovery in the Amazon Keyspaces Developer Guide.
tags_override(Vec<Tag>)
/set_tags_override(Option<Vec<Tag>>)
:A list of key-value pair tags to be attached to the restored table.
For more information, see Adding tags and labels to Amazon Keyspaces resources in the Amazon Keyspaces Developer Guide.
- On success, responds with
RestoreTableOutput
with field(s):restored_table_arn(Option<String>)
:The Amazon Resource Name (ARN) of the restored table.
- On failure, responds with
SdkError<RestoreTableError>
sourcepub fn tag_resource(&self) -> TagResource
pub fn tag_resource(&self) -> TagResource
Constructs a fluent builder for the TagResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:The Amazon Resource Name (ARN) of the Amazon Keyspaces resource to which to add tags.
tags(Vec<Tag>)
/set_tags(Option<Vec<Tag>>)
:The tags to be assigned to the Amazon Keyspaces resource.
- On success, responds with
TagResourceOutput
- On failure, responds with
SdkError<TagResourceError>
sourcepub fn untag_resource(&self) -> UntagResource
pub fn untag_resource(&self) -> UntagResource
Constructs a fluent builder for the UntagResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:The Amazon Keyspaces resource that the tags will be removed from. This value is an Amazon Resource Name (ARN).
tags(Vec<Tag>)
/set_tags(Option<Vec<Tag>>)
:A list of existing tags to be removed from the Amazon Keyspaces resource.
- On success, responds with
UntagResourceOutput
- On failure, responds with
SdkError<UntagResourceError>
sourcepub fn update_table(&self) -> UpdateTable
pub fn update_table(&self) -> UpdateTable
Constructs a fluent builder for the UpdateTable
operation.
- The fluent builder is configurable:
keyspace_name(impl Into<String>)
/set_keyspace_name(Option<String>)
:The name of the keyspace the specified table is stored in.
table_name(impl Into<String>)
/set_table_name(Option<String>)
:The name of the table.
add_columns(Vec<ColumnDefinition>)
/set_add_columns(Option<Vec<ColumnDefinition>>)
:For each column to be added to the specified table:
•
name
- The name of the column.•
type
- An Amazon Keyspaces data type. For more information, see Data types in the Amazon Keyspaces Developer Guide.capacity_specification(CapacitySpecification)
/set_capacity_specification(Option<CapacitySpecification>)
:Modifies the read/write throughput capacity mode for the table. The options are:
•
throughputMode:PAY_PER_REQUEST
and•
throughputMode:PROVISIONED
- Provisioned capacity mode requiresreadCapacityUnits
andwriteCapacityUnits
as input.The default is
throughput_mode:PAY_PER_REQUEST
.For more information, see Read/write capacity modes in the Amazon Keyspaces Developer Guide.
encryption_specification(EncryptionSpecification)
/set_encryption_specification(Option<EncryptionSpecification>)
:Modifies the encryption settings of the table. You can choose one of the following KMS key (KMS key):
•
type:AWS_OWNED_KMS_KEY
- This key is owned by Amazon Keyspaces.•
type:CUSTOMER_MANAGED_KMS_KEY
- This key is stored in your account and is created, owned, and managed by you. This option requires thekms_key_identifier
of the KMS key in Amazon Resource Name (ARN) format as input.The default is
AWS_OWNED_KMS_KEY
.For more information, see Encryption at rest in the Amazon Keyspaces Developer Guide.
point_in_time_recovery(PointInTimeRecovery)
/set_point_in_time_recovery(Option<PointInTimeRecovery>)
:Modifies the
pointInTimeRecovery
settings of the table. The options are:•
ENABLED
•
DISABLED
If it’s not specified, the default is
DISABLED
.For more information, see Point-in-time recovery in the Amazon Keyspaces Developer Guide.
ttl(TimeToLive)
/set_ttl(Option<TimeToLive>)
:Modifies Time to Live custom settings for the table. The options are:
•
status:enabled
•
status:disabled
The default is
status:disabled
. Afterttl
is enabled, you can’t disable it for the table.For more information, see Expiring data by using Amazon Keyspaces Time to Live (TTL) in the Amazon Keyspaces Developer Guide.
default_time_to_live(i32)
/set_default_time_to_live(Option<i32>)
:The default Time to Live setting in seconds for the table.
For more information, see Setting the default TTL value for a table in the Amazon Keyspaces Developer Guide.
- On success, responds with
UpdateTableOutput
with field(s):resource_arn(Option<String>)
:The Amazon Resource Name (ARN) of the modified table.
- On failure, responds with
SdkError<UpdateTableError>
sourceimpl Client
impl Client
sourcepub fn from_conf_conn<C, E>(conf: Config, conn: C) -> Self where
C: SmithyConnector<Error = E> + Send + 'static,
E: Into<ConnectorError>,
pub fn from_conf_conn<C, E>(conf: Config, conn: C) -> Self where
C: SmithyConnector<Error = E> + Send + 'static,
E: Into<ConnectorError>,
Creates a client with the given service config and connector override.
Trait Implementations
sourceimpl From<Client<DynConnector, DynMiddleware<DynConnector>, Standard>> for Client
impl From<Client<DynConnector, DynMiddleware<DynConnector>, Standard>> for Client
sourcefn from(client: Client<DynConnector, DynMiddleware<DynConnector>>) -> Self
fn from(client: Client<DynConnector, DynMiddleware<DynConnector>>) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more