/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include
#include
#include
#include
#include
#include
namespace Aws
{
namespace Keyspaces
{
/**
* 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.
*/
class AWS_KEYSPACES_API KeyspacesClient : public Aws::Client::AWSJsonClient, public Aws::Client::ClientWithAsyncTemplateMethods
{
public:
typedef Aws::Client::AWSJsonClient BASECLASS;
static const char* SERVICE_NAME;
static const char* ALLOCATION_TAG;
typedef KeyspacesClientConfiguration ClientConfigurationType;
typedef KeyspacesEndpointProvider EndpointProviderType;
/**
* Initializes client to use DefaultCredentialProviderChain, with default http client factory, and optional client config. If client config
* is not specified, it will be initialized to default values.
*/
KeyspacesClient(const Aws::Keyspaces::KeyspacesClientConfiguration& clientConfiguration = Aws::Keyspaces::KeyspacesClientConfiguration(),
std::shared_ptr endpointProvider = Aws::MakeShared(ALLOCATION_TAG));
/**
* Initializes client to use SimpleAWSCredentialsProvider, with default http client factory, and optional client config. If client config
* is not specified, it will be initialized to default values.
*/
KeyspacesClient(const Aws::Auth::AWSCredentials& credentials,
std::shared_ptr endpointProvider = Aws::MakeShared(ALLOCATION_TAG),
const Aws::Keyspaces::KeyspacesClientConfiguration& clientConfiguration = Aws::Keyspaces::KeyspacesClientConfiguration());
/**
* Initializes client to use specified credentials provider with specified client config. If http client factory is not supplied,
* the default http client factory will be used
*/
KeyspacesClient(const std::shared_ptr& credentialsProvider,
std::shared_ptr endpointProvider = Aws::MakeShared(ALLOCATION_TAG),
const Aws::Keyspaces::KeyspacesClientConfiguration& clientConfiguration = Aws::Keyspaces::KeyspacesClientConfiguration());
/* Legacy constructors due deprecation */
/**
* Initializes client to use DefaultCredentialProviderChain, with default http client factory, and optional client config. If client config
* is not specified, it will be initialized to default values.
*/
KeyspacesClient(const Aws::Client::ClientConfiguration& clientConfiguration);
/**
* Initializes client to use SimpleAWSCredentialsProvider, with default http client factory, and optional client config. If client config
* is not specified, it will be initialized to default values.
*/
KeyspacesClient(const Aws::Auth::AWSCredentials& credentials,
const Aws::Client::ClientConfiguration& clientConfiguration);
/**
* Initializes client to use specified credentials provider with specified client config. If http client factory is not supplied,
* the default http client factory will be used
*/
KeyspacesClient(const std::shared_ptr& credentialsProvider,
const Aws::Client::ClientConfiguration& clientConfiguration);
/* End of legacy constructors due deprecation */
virtual ~KeyspacesClient();
/**
* 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 Creating
* keyspaces in the Amazon Keyspaces Developer Guide.
See
* Also:
AWS
* API Reference
*/
virtual Model::CreateKeyspaceOutcome CreateKeyspace(const Model::CreateKeyspaceRequest& request) const;
/**
* A Callable wrapper for CreateKeyspace that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::CreateKeyspaceOutcomeCallable CreateKeyspaceCallable(const CreateKeyspaceRequestT& request) const
{
return SubmitCallable(&KeyspacesClient::CreateKeyspace, request);
}
/**
* An Async wrapper for CreateKeyspace that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void CreateKeyspaceAsync(const CreateKeyspaceRequestT& request, const CreateKeyspaceResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&KeyspacesClient::CreateKeyspace, request, handler, context);
}
/**
* 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 Creating
* tables in the Amazon Keyspaces Developer Guide.
See
* Also:
AWS
* API Reference
*/
virtual Model::CreateTableOutcome CreateTable(const Model::CreateTableRequest& request) const;
/**
* A Callable wrapper for CreateTable that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::CreateTableOutcomeCallable CreateTableCallable(const CreateTableRequestT& request) const
{
return SubmitCallable(&KeyspacesClient::CreateTable, request);
}
/**
* An Async wrapper for CreateTable that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void CreateTableAsync(const CreateTableRequestT& request, const CreateTableResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&KeyspacesClient::CreateTable, request, handler, context);
}
/**
* The DeleteKeyspace
operation deletes a keyspace and all of its
* tables.
See Also:
AWS
* API Reference
*/
virtual Model::DeleteKeyspaceOutcome DeleteKeyspace(const Model::DeleteKeyspaceRequest& request) const;
/**
* A Callable wrapper for DeleteKeyspace that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::DeleteKeyspaceOutcomeCallable DeleteKeyspaceCallable(const DeleteKeyspaceRequestT& request) const
{
return SubmitCallable(&KeyspacesClient::DeleteKeyspace, request);
}
/**
* An Async wrapper for DeleteKeyspace that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void DeleteKeyspaceAsync(const DeleteKeyspaceRequestT& request, const DeleteKeyspaceResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&KeyspacesClient::DeleteKeyspace, request, handler, context);
}
/**
* 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.
See Also:
AWS
* API Reference
*/
virtual Model::DeleteTableOutcome DeleteTable(const Model::DeleteTableRequest& request) const;
/**
* A Callable wrapper for DeleteTable that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::DeleteTableOutcomeCallable DeleteTableCallable(const DeleteTableRequestT& request) const
{
return SubmitCallable(&KeyspacesClient::DeleteTable, request);
}
/**
* An Async wrapper for DeleteTable that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void DeleteTableAsync(const DeleteTableRequestT& request, const DeleteTableResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&KeyspacesClient::DeleteTable, request, handler, context);
}
/**
* Returns the name and the Amazon Resource Name (ARN) of the specified
* table.
See Also:
AWS
* API Reference
*/
virtual Model::GetKeyspaceOutcome GetKeyspace(const Model::GetKeyspaceRequest& request) const;
/**
* A Callable wrapper for GetKeyspace that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::GetKeyspaceOutcomeCallable GetKeyspaceCallable(const GetKeyspaceRequestT& request) const
{
return SubmitCallable(&KeyspacesClient::GetKeyspace, request);
}
/**
* An Async wrapper for GetKeyspace that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void GetKeyspaceAsync(const GetKeyspaceRequestT& request, const GetKeyspaceResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&KeyspacesClient::GetKeyspace, request, handler, context);
}
/**
* 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
, Select
action
* permissions for the table and system tables are required to complete the
* operation.
See Also:
AWS
* API Reference
*/
virtual Model::GetTableOutcome GetTable(const Model::GetTableRequest& request) const;
/**
* A Callable wrapper for GetTable that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::GetTableOutcomeCallable GetTableCallable(const GetTableRequestT& request) const
{
return SubmitCallable(&KeyspacesClient::GetTable, request);
}
/**
* An Async wrapper for GetTable that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void GetTableAsync(const GetTableRequestT& request, const GetTableResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&KeyspacesClient::GetTable, request, handler, context);
}
/**
* Returns a list of keyspaces.
See Also:
AWS
* API Reference
*/
virtual Model::ListKeyspacesOutcome ListKeyspaces(const Model::ListKeyspacesRequest& request) const;
/**
* A Callable wrapper for ListKeyspaces that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::ListKeyspacesOutcomeCallable ListKeyspacesCallable(const ListKeyspacesRequestT& request) const
{
return SubmitCallable(&KeyspacesClient::ListKeyspaces, request);
}
/**
* An Async wrapper for ListKeyspaces that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void ListKeyspacesAsync(const ListKeyspacesRequestT& request, const ListKeyspacesResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&KeyspacesClient::ListKeyspaces, request, handler, context);
}
/**
* Returns a list of tables for a specified keyspace.
See Also:
* AWS
* API Reference
*/
virtual Model::ListTablesOutcome ListTables(const Model::ListTablesRequest& request) const;
/**
* A Callable wrapper for ListTables that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::ListTablesOutcomeCallable ListTablesCallable(const ListTablesRequestT& request) const
{
return SubmitCallable(&KeyspacesClient::ListTables, request);
}
/**
* An Async wrapper for ListTables that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void ListTablesAsync(const ListTablesRequestT& request, const ListTablesResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&KeyspacesClient::ListTables, request, handler, context);
}
/**
* Returns a list of all tags associated with the specified Amazon Keyspaces
* resource.
See Also:
AWS
* API Reference
*/
virtual Model::ListTagsForResourceOutcome ListTagsForResource(const Model::ListTagsForResourceRequest& request) const;
/**
* A Callable wrapper for ListTagsForResource that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::ListTagsForResourceOutcomeCallable ListTagsForResourceCallable(const ListTagsForResourceRequestT& request) const
{
return SubmitCallable(&KeyspacesClient::ListTagsForResource, request);
}
/**
* An Async wrapper for ListTagsForResource that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void ListTagsForResourceAsync(const ListTagsForResourceRequestT& request, const ListTagsForResourceResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&KeyspacesClient::ListTagsForResource, request, handler, context);
}
/**
* Restores the specified 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,
* encryption, 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 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:
-
Automatic scaling policies (for
* tables that use provisioned capacity mode)
-
Identity and Access
* Management (IAM) policies
-
Amazon CloudWatch metrics and
* alarms
See Also:
AWS
* API Reference
*/
virtual Model::RestoreTableOutcome RestoreTable(const Model::RestoreTableRequest& request) const;
/**
* A Callable wrapper for RestoreTable that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::RestoreTableOutcomeCallable RestoreTableCallable(const RestoreTableRequestT& request) const
{
return SubmitCallable(&KeyspacesClient::RestoreTable, request);
}
/**
* An Async wrapper for RestoreTable that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void RestoreTableAsync(const RestoreTableRequestT& request, const RestoreTableResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&KeyspacesClient::RestoreTable, request, handler, context);
}
/**
* 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.
See Also:
AWS
* API Reference
*/
virtual Model::TagResourceOutcome TagResource(const Model::TagResourceRequest& request) const;
/**
* A Callable wrapper for TagResource that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::TagResourceOutcomeCallable TagResourceCallable(const TagResourceRequestT& request) const
{
return SubmitCallable(&KeyspacesClient::TagResource, request);
}
/**
* An Async wrapper for TagResource that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void TagResourceAsync(const TagResourceRequestT& request, const TagResourceResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&KeyspacesClient::TagResource, request, handler, context);
}
/**
* Removes the association of tags from a Amazon Keyspaces
* resource.
See Also:
AWS
* API Reference
*/
virtual Model::UntagResourceOutcome UntagResource(const Model::UntagResourceRequest& request) const;
/**
* A Callable wrapper for UntagResource that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::UntagResourceOutcomeCallable UntagResourceCallable(const UntagResourceRequestT& request) const
{
return SubmitCallable(&KeyspacesClient::UntagResource, request);
}
/**
* An Async wrapper for UntagResource that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void UntagResourceAsync(const UntagResourceRequestT& request, const UntagResourceResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&KeyspacesClient::UntagResource, request, handler, context);
}
/**
* Adds new columns to the table or updates one of the table's settings, for
* example capacity mode, encryption, point-in-time recovery, or ttl settings. Note
* that you can only update one specific table setting per update
* operation.
See Also:
AWS
* API Reference
*/
virtual Model::UpdateTableOutcome UpdateTable(const Model::UpdateTableRequest& request) const;
/**
* A Callable wrapper for UpdateTable that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::UpdateTableOutcomeCallable UpdateTableCallable(const UpdateTableRequestT& request) const
{
return SubmitCallable(&KeyspacesClient::UpdateTable, request);
}
/**
* An Async wrapper for UpdateTable that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void UpdateTableAsync(const UpdateTableRequestT& request, const UpdateTableResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&KeyspacesClient::UpdateTable, request, handler, context);
}
void OverrideEndpoint(const Aws::String& endpoint);
std::shared_ptr& accessEndpointProvider();
private:
friend class Aws::Client::ClientWithAsyncTemplateMethods;
void init(const KeyspacesClientConfiguration& clientConfiguration);
KeyspacesClientConfiguration m_clientConfiguration;
std::shared_ptr m_executor;
std::shared_ptr m_endpointProvider;
};
} // namespace Keyspaces
} // namespace Aws