Skip to content

KeyspacesClient#

Index > Keyspaces > KeyspacesClient

Auto-generated documentation for Keyspaces type annotations stubs module types-aiobotocore-keyspaces.

KeyspacesClient#

Type annotations and code completion for session.client("keyspaces") boto3 documentation

# KeyspacesClient usage example

from aioboto3.session import Session
from types_aiobotocore_keyspaces.client import KeyspacesClient

session = Session()
async with session.client("keyspaces") as client:
    client: KeyspacesClient

Exceptions#

aioboto3 client exceptions are generated in runtime. This class provides code completion for session.client("keyspaces").exceptions structure.

# KeyspacesClient.exceptions usage example

async with session.client("keyspaces") as client:
    try:
        do_something(client)
    except (
            client.exceptions.AccessDeniedException,
        client.exceptions.ClientError,
        client.exceptions.ConflictException,
        client.exceptions.InternalServerException,
        client.exceptions.ResourceNotFoundException,
        client.exceptions.ServiceQuotaExceededException,
        client.exceptions.ValidationException,
    ) as e:
        print(e)
# KeyspacesClient.exceptions type checking example

from types_aiobotocore_keyspaces.client import Exceptions

def handle_error(exc: Exceptions.AccessDeniedException) -> None:
    ...

Methods#

can_paginate#

Type annotations and code completion for session.client("keyspaces").can_paginate method. boto3 documentation

# can_paginate method definition

def can_paginate(
    self,
    operation_name: str,
) -> bool:
    ...

generate_presigned_url#

Type annotations and code completion for session.client("keyspaces").generate_presigned_url method. boto3 documentation

# generate_presigned_url method definition

await def generate_presigned_url(
    self,
    ClientMethod: str,
    Params: Mapping[str, Any] = ...,
    ExpiresIn: int = 3600,
    HttpMethod: str = ...,
) -> str:
    ...

create_keyspace#

The CreateKeyspace operation adds a new keyspace to your account.

Type annotations and code completion for session.client("keyspaces").create_keyspace method. boto3 documentation

# create_keyspace method definition

await def create_keyspace(
    self,
    *,
    keyspaceName: str,
    tags: Sequence[TagTypeDef] = ...,  # (1)
    replicationSpecification: ReplicationSpecificationTypeDef = ...,  # (2)
) -> CreateKeyspaceResponseTypeDef:  # (3)
    ...
  1. See Sequence[TagTypeDef]
  2. See ReplicationSpecificationTypeDef
  3. See CreateKeyspaceResponseTypeDef
# create_keyspace method usage example with argument unpacking

kwargs: CreateKeyspaceRequestTypeDef = {  # (1)
    "keyspaceName": ...,
}

parent.create_keyspace(**kwargs)
  1. See CreateKeyspaceRequestTypeDef

create_table#

The CreateTable operation adds a new table to the specified keyspace.

Type annotations and code completion for session.client("keyspaces").create_table method. boto3 documentation

# create_table method definition

await def create_table(
    self,
    *,
    keyspaceName: str,
    tableName: str,
    schemaDefinition: SchemaDefinitionUnionTypeDef,  # (1)
    comment: CommentTypeDef = ...,  # (2)
    capacitySpecification: CapacitySpecificationTypeDef = ...,  # (3)
    encryptionSpecification: EncryptionSpecificationTypeDef = ...,  # (4)
    pointInTimeRecovery: PointInTimeRecoveryTypeDef = ...,  # (5)
    ttl: TimeToLiveTypeDef = ...,  # (6)
    defaultTimeToLive: int = ...,
    tags: Sequence[TagTypeDef] = ...,  # (7)
    clientSideTimestamps: ClientSideTimestampsTypeDef = ...,  # (8)
    autoScalingSpecification: AutoScalingSpecificationTypeDef = ...,  # (9)
    replicaSpecifications: Sequence[ReplicaSpecificationTypeDef] = ...,  # (10)
) -> CreateTableResponseTypeDef:  # (11)
    ...
  1. See SchemaDefinitionUnionTypeDef
  2. See CommentTypeDef
  3. See CapacitySpecificationTypeDef
  4. See EncryptionSpecificationTypeDef
  5. See PointInTimeRecoveryTypeDef
  6. See TimeToLiveTypeDef
  7. See Sequence[TagTypeDef]
  8. See ClientSideTimestampsTypeDef
  9. See AutoScalingSpecificationTypeDef
  10. See Sequence[ReplicaSpecificationTypeDef]
  11. See CreateTableResponseTypeDef
# create_table method usage example with argument unpacking

kwargs: CreateTableRequestTypeDef = {  # (1)
    "keyspaceName": ...,
    "tableName": ...,
    "schemaDefinition": ...,
}

parent.create_table(**kwargs)
  1. See CreateTableRequestTypeDef

create_type#

The CreateType operation creates a new user-defined type in the specified keyspace.

Type annotations and code completion for session.client("keyspaces").create_type method. boto3 documentation

# create_type method definition

await def create_type(
    self,
    *,
    keyspaceName: str,
    typeName: str,
    fieldDefinitions: Sequence[FieldDefinitionTypeDef],  # (1)
) -> CreateTypeResponseTypeDef:  # (2)
    ...
  1. See Sequence[FieldDefinitionTypeDef]
  2. See CreateTypeResponseTypeDef
# create_type method usage example with argument unpacking

kwargs: CreateTypeRequestTypeDef = {  # (1)
    "keyspaceName": ...,
    "typeName": ...,
    "fieldDefinitions": ...,
}

parent.create_type(**kwargs)
  1. See CreateTypeRequestTypeDef

delete_keyspace#

The DeleteKeyspace operation deletes a keyspace and all of its tables.

Type annotations and code completion for session.client("keyspaces").delete_keyspace method. boto3 documentation

# delete_keyspace method definition

await def delete_keyspace(
    self,
    *,
    keyspaceName: str,
) -> Dict[str, Any]:
    ...
# delete_keyspace method usage example with argument unpacking

kwargs: DeleteKeyspaceRequestTypeDef = {  # (1)
    "keyspaceName": ...,
}

parent.delete_keyspace(**kwargs)
  1. See DeleteKeyspaceRequestTypeDef

delete_table#

The DeleteTable operation deletes a table and all of its data.

Type annotations and code completion for session.client("keyspaces").delete_table method. boto3 documentation

# delete_table method definition

await def delete_table(
    self,
    *,
    keyspaceName: str,
    tableName: str,
) -> Dict[str, Any]:
    ...
# delete_table method usage example with argument unpacking

kwargs: DeleteTableRequestTypeDef = {  # (1)
    "keyspaceName": ...,
    "tableName": ...,
}

parent.delete_table(**kwargs)
  1. See DeleteTableRequestTypeDef

delete_type#

The DeleteType operation deletes a user-defined type (UDT).

Type annotations and code completion for session.client("keyspaces").delete_type method. boto3 documentation

# delete_type method definition

await def delete_type(
    self,
    *,
    keyspaceName: str,
    typeName: str,
) -> DeleteTypeResponseTypeDef:  # (1)
    ...
  1. See DeleteTypeResponseTypeDef
# delete_type method usage example with argument unpacking

kwargs: DeleteTypeRequestTypeDef = {  # (1)
    "keyspaceName": ...,
    "typeName": ...,
}

parent.delete_type(**kwargs)
  1. See DeleteTypeRequestTypeDef

get_keyspace#

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.

Type annotations and code completion for session.client("keyspaces").get_keyspace method. boto3 documentation

# get_keyspace method definition

await def get_keyspace(
    self,
    *,
    keyspaceName: str,
) -> GetKeyspaceResponseTypeDef:  # (1)
    ...
  1. See GetKeyspaceResponseTypeDef
# get_keyspace method usage example with argument unpacking

kwargs: GetKeyspaceRequestTypeDef = {  # (1)
    "keyspaceName": ...,
}

parent.get_keyspace(**kwargs)
  1. See GetKeyspaceRequestTypeDef

get_table#

Returns information about the table, including the table's name and current status, the keyspace name, configuration settings, and metadata.

Type annotations and code completion for session.client("keyspaces").get_table method. boto3 documentation

# get_table method definition

await def get_table(
    self,
    *,
    keyspaceName: str,
    tableName: str,
) -> GetTableResponseTypeDef:  # (1)
    ...
  1. See GetTableResponseTypeDef
# get_table method usage example with argument unpacking

kwargs: GetTableRequestTypeDef = {  # (1)
    "keyspaceName": ...,
    "tableName": ...,
}

parent.get_table(**kwargs)
  1. See GetTableRequestTypeDef

get_table_auto_scaling_settings#

Returns auto scaling related settings of the specified table in JSON format.

Type annotations and code completion for session.client("keyspaces").get_table_auto_scaling_settings method. boto3 documentation

# get_table_auto_scaling_settings method definition

await def get_table_auto_scaling_settings(
    self,
    *,
    keyspaceName: str,
    tableName: str,
) -> GetTableAutoScalingSettingsResponseTypeDef:  # (1)
    ...
  1. See GetTableAutoScalingSettingsResponseTypeDef
# get_table_auto_scaling_settings method usage example with argument unpacking

kwargs: GetTableAutoScalingSettingsRequestTypeDef = {  # (1)
    "keyspaceName": ...,
    "tableName": ...,
}

parent.get_table_auto_scaling_settings(**kwargs)
  1. See GetTableAutoScalingSettingsRequestTypeDef

get_type#

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.

Type annotations and code completion for session.client("keyspaces").get_type method. boto3 documentation

# get_type method definition

await def get_type(
    self,
    *,
    keyspaceName: str,
    typeName: str,
) -> GetTypeResponseTypeDef:  # (1)
    ...
  1. See GetTypeResponseTypeDef
# get_type method usage example with argument unpacking

kwargs: GetTypeRequestTypeDef = {  # (1)
    "keyspaceName": ...,
    "typeName": ...,
}

parent.get_type(**kwargs)
  1. See GetTypeRequestTypeDef

list_keyspaces#

The ListKeyspaces operation returns a list of keyspaces.

Type annotations and code completion for session.client("keyspaces").list_keyspaces method. boto3 documentation

# list_keyspaces method definition

await def list_keyspaces(
    self,
    *,
    nextToken: str = ...,
    maxResults: int = ...,
) -> ListKeyspacesResponseTypeDef:  # (1)
    ...
  1. See ListKeyspacesResponseTypeDef
# list_keyspaces method usage example with argument unpacking

kwargs: ListKeyspacesRequestTypeDef = {  # (1)
    "nextToken": ...,
}

parent.list_keyspaces(**kwargs)
  1. See ListKeyspacesRequestTypeDef

list_tables#

The ListTables operation returns a list of tables for a specified keyspace.

Type annotations and code completion for session.client("keyspaces").list_tables method. boto3 documentation

# list_tables method definition

await def list_tables(
    self,
    *,
    keyspaceName: str,
    nextToken: str = ...,
    maxResults: int = ...,
) -> ListTablesResponseTypeDef:  # (1)
    ...
  1. See ListTablesResponseTypeDef
# list_tables method usage example with argument unpacking

kwargs: ListTablesRequestTypeDef = {  # (1)
    "keyspaceName": ...,
}

parent.list_tables(**kwargs)
  1. See ListTablesRequestTypeDef

list_tags_for_resource#

Returns a list of all tags associated with the specified Amazon Keyspaces resource.

Type annotations and code completion for session.client("keyspaces").list_tags_for_resource method. boto3 documentation

# list_tags_for_resource method definition

await def list_tags_for_resource(
    self,
    *,
    resourceArn: str,
    nextToken: str = ...,
    maxResults: int = ...,
) -> ListTagsForResourceResponseTypeDef:  # (1)
    ...
  1. See ListTagsForResourceResponseTypeDef
# list_tags_for_resource method usage example with argument unpacking

kwargs: ListTagsForResourceRequestTypeDef = {  # (1)
    "resourceArn": ...,
}

parent.list_tags_for_resource(**kwargs)
  1. See ListTagsForResourceRequestTypeDef

list_types#

The ListTypes operation returns a list of types for a specified keyspace.

Type annotations and code completion for session.client("keyspaces").list_types method. boto3 documentation

# list_types method definition

await def list_types(
    self,
    *,
    keyspaceName: str,
    nextToken: str = ...,
    maxResults: int = ...,
) -> ListTypesResponseTypeDef:  # (1)
    ...
  1. See ListTypesResponseTypeDef
# list_types method usage example with argument unpacking

kwargs: ListTypesRequestTypeDef = {  # (1)
    "keyspaceName": ...,
}

parent.list_types(**kwargs)
  1. See ListTypesRequestTypeDef

restore_table#

Restores the table to the specified point in time within the earliest_restorable_timestamp and the current time.

Type annotations and code completion for session.client("keyspaces").restore_table method. boto3 documentation

# restore_table method definition

await def restore_table(
    self,
    *,
    sourceKeyspaceName: str,
    sourceTableName: str,
    targetKeyspaceName: str,
    targetTableName: str,
    restoreTimestamp: TimestampTypeDef = ...,
    capacitySpecificationOverride: CapacitySpecificationTypeDef = ...,  # (1)
    encryptionSpecificationOverride: EncryptionSpecificationTypeDef = ...,  # (2)
    pointInTimeRecoveryOverride: PointInTimeRecoveryTypeDef = ...,  # (3)
    tagsOverride: Sequence[TagTypeDef] = ...,  # (4)
    autoScalingSpecification: AutoScalingSpecificationTypeDef = ...,  # (5)
    replicaSpecifications: Sequence[ReplicaSpecificationTypeDef] = ...,  # (6)
) -> RestoreTableResponseTypeDef:  # (7)
    ...
  1. See CapacitySpecificationTypeDef
  2. See EncryptionSpecificationTypeDef
  3. See PointInTimeRecoveryTypeDef
  4. See Sequence[TagTypeDef]
  5. See AutoScalingSpecificationTypeDef
  6. See Sequence[ReplicaSpecificationTypeDef]
  7. See RestoreTableResponseTypeDef
# restore_table method usage example with argument unpacking

kwargs: RestoreTableRequestTypeDef = {  # (1)
    "sourceKeyspaceName": ...,
    "sourceTableName": ...,
    "targetKeyspaceName": ...,
    "targetTableName": ...,
}

parent.restore_table(**kwargs)
  1. See RestoreTableRequestTypeDef

tag_resource#

Associates a set of tags with a Amazon Keyspaces resource.

Type annotations and code completion for session.client("keyspaces").tag_resource method. boto3 documentation

# tag_resource method definition

await def tag_resource(
    self,
    *,
    resourceArn: str,
    tags: Sequence[TagTypeDef],  # (1)
) -> Dict[str, Any]:
    ...
  1. See Sequence[TagTypeDef]
# tag_resource method usage example with argument unpacking

kwargs: TagResourceRequestTypeDef = {  # (1)
    "resourceArn": ...,
    "tags": ...,
}

parent.tag_resource(**kwargs)
  1. See TagResourceRequestTypeDef

untag_resource#

Removes the association of tags from a Amazon Keyspaces resource.

Type annotations and code completion for session.client("keyspaces").untag_resource method. boto3 documentation

# untag_resource method definition

await def untag_resource(
    self,
    *,
    resourceArn: str,
    tags: Sequence[TagTypeDef],  # (1)
) -> Dict[str, Any]:
    ...
  1. See Sequence[TagTypeDef]
# untag_resource method usage example with argument unpacking

kwargs: UntagResourceRequestTypeDef = {  # (1)
    "resourceArn": ...,
    "tags": ...,
}

parent.untag_resource(**kwargs)
  1. See UntagResourceRequestTypeDef

update_keyspace#

Adds a new Amazon Web Services Region to the keyspace.

Type annotations and code completion for session.client("keyspaces").update_keyspace method. boto3 documentation

# update_keyspace method definition

await def update_keyspace(
    self,
    *,
    keyspaceName: str,
    replicationSpecification: ReplicationSpecificationTypeDef,  # (1)
    clientSideTimestamps: ClientSideTimestampsTypeDef = ...,  # (2)
) -> UpdateKeyspaceResponseTypeDef:  # (3)
    ...
  1. See ReplicationSpecificationTypeDef
  2. See ClientSideTimestampsTypeDef
  3. See UpdateKeyspaceResponseTypeDef
# update_keyspace method usage example with argument unpacking

kwargs: UpdateKeyspaceRequestTypeDef = {  # (1)
    "keyspaceName": ...,
    "replicationSpecification": ...,
}

parent.update_keyspace(**kwargs)
  1. See UpdateKeyspaceRequestTypeDef

update_table#

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.

Type annotations and code completion for session.client("keyspaces").update_table method. boto3 documentation

# update_table method definition

await def update_table(
    self,
    *,
    keyspaceName: str,
    tableName: str,
    addColumns: Sequence[ColumnDefinitionTypeDef] = ...,  # (1)
    capacitySpecification: CapacitySpecificationTypeDef = ...,  # (2)
    encryptionSpecification: EncryptionSpecificationTypeDef = ...,  # (3)
    pointInTimeRecovery: PointInTimeRecoveryTypeDef = ...,  # (4)
    ttl: TimeToLiveTypeDef = ...,  # (5)
    defaultTimeToLive: int = ...,
    clientSideTimestamps: ClientSideTimestampsTypeDef = ...,  # (6)
    autoScalingSpecification: AutoScalingSpecificationTypeDef = ...,  # (7)
    replicaSpecifications: Sequence[ReplicaSpecificationTypeDef] = ...,  # (8)
) -> UpdateTableResponseTypeDef:  # (9)
    ...
  1. See Sequence[ColumnDefinitionTypeDef]
  2. See CapacitySpecificationTypeDef
  3. See EncryptionSpecificationTypeDef
  4. See PointInTimeRecoveryTypeDef
  5. See TimeToLiveTypeDef
  6. See ClientSideTimestampsTypeDef
  7. See AutoScalingSpecificationTypeDef
  8. See Sequence[ReplicaSpecificationTypeDef]
  9. See UpdateTableResponseTypeDef
# update_table method usage example with argument unpacking

kwargs: UpdateTableRequestTypeDef = {  # (1)
    "keyspaceName": ...,
    "tableName": ...,
}

parent.update_table(**kwargs)
  1. See UpdateTableRequestTypeDef

__aenter__#

Type annotations and code completion for session.client("keyspaces").__aenter__ method. boto3 documentation

# __aenter__ method definition

await def __aenter__(
    self,
) -> Self:
    ...

__aexit__#

Type annotations and code completion for session.client("keyspaces").__aexit__ method. boto3 documentation

# __aexit__ method definition

await def __aexit__(
    self,
    exc_type: Type[BaseException] | None,
    exc_val: BaseException | None,
    exc_tb: types.TracebackType | None,
) -> None:
    ...

get_paginator#

Type annotations and code completion for session.client("keyspaces").get_paginator method with overloads.