KafkaClient#
Auto-generated documentation for Kafka type annotations stubs module mypy-boto3-kafka.
KafkaClient#
Type annotations and code completion for boto3.client("kafka")
.
boto3 documentation
# KafkaClient usage example
from boto3.session import Session
from mypy_boto3_kafka.client import KafkaClient
def get_kafka_client() -> KafkaClient:
return Session().client("kafka")
Exceptions#
boto3
client exceptions are generated in runtime.
This class provides code completion for boto3.client("kafka").exceptions
structure.
# Exceptions.exceptions usage example
client = boto3.client("kafka")
try:
do_something(client)
except (
client.exceptions.BadRequestException,
client.exceptions.ClientError,
client.exceptions.ConflictException,
client.exceptions.ForbiddenException,
client.exceptions.InternalServerErrorException,
client.exceptions.NotFoundException,
client.exceptions.ServiceUnavailableException,
client.exceptions.TooManyRequestsException,
client.exceptions.UnauthorizedException,
) as e:
print(e)
# Exceptions.exceptions type checking example
from mypy_boto3_kafka.client import Exceptions
def handle_error(exc: Exceptions.BadRequestException) -> None:
...
Methods#
batch_associate_scram_secret#
Associates one or more Scram Secrets with an Amazon MSK cluster.
Type annotations and code completion for boto3.client("kafka").batch_associate_scram_secret
method.
boto3 documentation
# batch_associate_scram_secret method definition
def batch_associate_scram_secret(
self,
*,
ClusterArn: str,
SecretArnList: Sequence[str],
) -> BatchAssociateScramSecretResponseTypeDef: # (1)
...
# batch_associate_scram_secret method usage example with argument unpacking
kwargs: BatchAssociateScramSecretRequestRequestTypeDef = { # (1)
"ClusterArn": ...,
"SecretArnList": ...,
}
parent.batch_associate_scram_secret(**kwargs)
batch_disassociate_scram_secret#
Disassociates one or more Scram Secrets from an Amazon MSK cluster.
Type annotations and code completion for boto3.client("kafka").batch_disassociate_scram_secret
method.
boto3 documentation
# batch_disassociate_scram_secret method definition
def batch_disassociate_scram_secret(
self,
*,
ClusterArn: str,
SecretArnList: Sequence[str],
) -> BatchDisassociateScramSecretResponseTypeDef: # (1)
...
# batch_disassociate_scram_secret method usage example with argument unpacking
kwargs: BatchDisassociateScramSecretRequestRequestTypeDef = { # (1)
"ClusterArn": ...,
"SecretArnList": ...,
}
parent.batch_disassociate_scram_secret(**kwargs)
can_paginate#
Check if an operation can be paginated.
Type annotations and code completion for boto3.client("kafka").can_paginate
method.
boto3 documentation
# can_paginate method definition
def can_paginate(
self,
operation_name: str,
) -> bool:
...
close#
Closes underlying endpoint connections.
Type annotations and code completion for boto3.client("kafka").close
method.
boto3 documentation
# close method definition
def close(
self,
) -> None:
...
create_cluster#
Creates a new MSK cluster.
Type annotations and code completion for boto3.client("kafka").create_cluster
method.
boto3 documentation
# create_cluster method definition
def create_cluster(
self,
*,
BrokerNodeGroupInfo: BrokerNodeGroupInfoTypeDef, # (1)
ClusterName: str,
KafkaVersion: str,
NumberOfBrokerNodes: int,
ClientAuthentication: ClientAuthenticationTypeDef = ..., # (2)
ConfigurationInfo: ConfigurationInfoTypeDef = ..., # (3)
EncryptionInfo: EncryptionInfoTypeDef = ..., # (4)
EnhancedMonitoring: EnhancedMonitoringType = ..., # (5)
OpenMonitoring: OpenMonitoringInfoTypeDef = ..., # (6)
LoggingInfo: LoggingInfoTypeDef = ..., # (7)
Tags: Mapping[str, str] = ...,
StorageMode: StorageModeType = ..., # (8)
) -> CreateClusterResponseTypeDef: # (9)
...
- See BrokerNodeGroupInfoTypeDef
- See ClientAuthenticationTypeDef
- See ConfigurationInfoTypeDef
- See EncryptionInfoTypeDef
- See EnhancedMonitoringType
- See OpenMonitoringInfoTypeDef
- See LoggingInfoTypeDef
- See StorageModeType
- See CreateClusterResponseTypeDef
# create_cluster method usage example with argument unpacking
kwargs: CreateClusterRequestRequestTypeDef = { # (1)
"BrokerNodeGroupInfo": ...,
"ClusterName": ...,
"KafkaVersion": ...,
"NumberOfBrokerNodes": ...,
}
parent.create_cluster(**kwargs)
create_cluster_v2#
Creates a new MSK cluster.
Type annotations and code completion for boto3.client("kafka").create_cluster_v2
method.
boto3 documentation
# create_cluster_v2 method definition
def create_cluster_v2(
self,
*,
ClusterName: str,
Tags: Mapping[str, str] = ...,
Provisioned: ProvisionedRequestTypeDef = ..., # (1)
Serverless: ServerlessRequestTypeDef = ..., # (2)
) -> CreateClusterV2ResponseTypeDef: # (3)
...
# create_cluster_v2 method usage example with argument unpacking
kwargs: CreateClusterV2RequestRequestTypeDef = { # (1)
"ClusterName": ...,
}
parent.create_cluster_v2(**kwargs)
create_configuration#
Creates a new MSK configuration.
Type annotations and code completion for boto3.client("kafka").create_configuration
method.
boto3 documentation
# create_configuration method definition
def create_configuration(
self,
*,
Name: str,
ServerProperties: Union[str, bytes, IO[Any], StreamingBody],
Description: str = ...,
KafkaVersions: Sequence[str] = ...,
) -> CreateConfigurationResponseTypeDef: # (1)
...
# create_configuration method usage example with argument unpacking
kwargs: CreateConfigurationRequestRequestTypeDef = { # (1)
"Name": ...,
"ServerProperties": ...,
}
parent.create_configuration(**kwargs)
create_vpc_connection#
Creates a new MSK VPC connection.
Type annotations and code completion for boto3.client("kafka").create_vpc_connection
method.
boto3 documentation
# create_vpc_connection method definition
def create_vpc_connection(
self,
*,
TargetClusterArn: str,
Authentication: str,
VpcId: str,
ClientSubnets: Sequence[str],
SecurityGroups: Sequence[str],
Tags: Mapping[str, str] = ...,
) -> CreateVpcConnectionResponseTypeDef: # (1)
...
# create_vpc_connection method usage example with argument unpacking
kwargs: CreateVpcConnectionRequestRequestTypeDef = { # (1)
"TargetClusterArn": ...,
"Authentication": ...,
"VpcId": ...,
"ClientSubnets": ...,
"SecurityGroups": ...,
}
parent.create_vpc_connection(**kwargs)
delete_cluster#
Deletes the MSK cluster specified by the Amazon Resource Name (ARN) in the request.
Type annotations and code completion for boto3.client("kafka").delete_cluster
method.
boto3 documentation
# delete_cluster method definition
def delete_cluster(
self,
*,
ClusterArn: str,
CurrentVersion: str = ...,
) -> DeleteClusterResponseTypeDef: # (1)
...
# delete_cluster method usage example with argument unpacking
kwargs: DeleteClusterRequestRequestTypeDef = { # (1)
"ClusterArn": ...,
}
parent.delete_cluster(**kwargs)
delete_cluster_policy#
Deletes the MSK cluster policy specified by the Amazon Resource Name (ARN) in the request.
Type annotations and code completion for boto3.client("kafka").delete_cluster_policy
method.
boto3 documentation
# delete_cluster_policy method definition
def delete_cluster_policy(
self,
*,
ClusterArn: str,
) -> Dict[str, Any]:
...
# delete_cluster_policy method usage example with argument unpacking
kwargs: DeleteClusterPolicyRequestRequestTypeDef = { # (1)
"ClusterArn": ...,
}
parent.delete_cluster_policy(**kwargs)
delete_configuration#
Deletes an MSK Configuration.
Type annotations and code completion for boto3.client("kafka").delete_configuration
method.
boto3 documentation
# delete_configuration method definition
def delete_configuration(
self,
*,
Arn: str,
) -> DeleteConfigurationResponseTypeDef: # (1)
...
# delete_configuration method usage example with argument unpacking
kwargs: DeleteConfigurationRequestRequestTypeDef = { # (1)
"Arn": ...,
}
parent.delete_configuration(**kwargs)
delete_vpc_connection#
Deletes a MSK VPC connection.
Type annotations and code completion for boto3.client("kafka").delete_vpc_connection
method.
boto3 documentation
# delete_vpc_connection method definition
def delete_vpc_connection(
self,
*,
Arn: str,
) -> DeleteVpcConnectionResponseTypeDef: # (1)
...
# delete_vpc_connection method usage example with argument unpacking
kwargs: DeleteVpcConnectionRequestRequestTypeDef = { # (1)
"Arn": ...,
}
parent.delete_vpc_connection(**kwargs)
describe_cluster#
Returns a description of the MSK cluster whose Amazon Resource Name (ARN) is specified in the request.
Type annotations and code completion for boto3.client("kafka").describe_cluster
method.
boto3 documentation
# describe_cluster method definition
def describe_cluster(
self,
*,
ClusterArn: str,
) -> DescribeClusterResponseTypeDef: # (1)
...
# describe_cluster method usage example with argument unpacking
kwargs: DescribeClusterRequestRequestTypeDef = { # (1)
"ClusterArn": ...,
}
parent.describe_cluster(**kwargs)
describe_cluster_operation#
Returns a description of the cluster operation specified by the ARN.
Type annotations and code completion for boto3.client("kafka").describe_cluster_operation
method.
boto3 documentation
# describe_cluster_operation method definition
def describe_cluster_operation(
self,
*,
ClusterOperationArn: str,
) -> DescribeClusterOperationResponseTypeDef: # (1)
...
# describe_cluster_operation method usage example with argument unpacking
kwargs: DescribeClusterOperationRequestRequestTypeDef = { # (1)
"ClusterOperationArn": ...,
}
parent.describe_cluster_operation(**kwargs)
describe_cluster_operation_v2#
Returns a description of the cluster operation specified by the ARN.
Type annotations and code completion for boto3.client("kafka").describe_cluster_operation_v2
method.
boto3 documentation
# describe_cluster_operation_v2 method definition
def describe_cluster_operation_v2(
self,
*,
ClusterOperationArn: str,
) -> DescribeClusterOperationV2ResponseTypeDef: # (1)
...
# describe_cluster_operation_v2 method usage example with argument unpacking
kwargs: DescribeClusterOperationV2RequestRequestTypeDef = { # (1)
"ClusterOperationArn": ...,
}
parent.describe_cluster_operation_v2(**kwargs)
describe_cluster_v2#
Returns a description of the MSK cluster whose Amazon Resource Name (ARN) is specified in the request.
Type annotations and code completion for boto3.client("kafka").describe_cluster_v2
method.
boto3 documentation
# describe_cluster_v2 method definition
def describe_cluster_v2(
self,
*,
ClusterArn: str,
) -> DescribeClusterV2ResponseTypeDef: # (1)
...
# describe_cluster_v2 method usage example with argument unpacking
kwargs: DescribeClusterV2RequestRequestTypeDef = { # (1)
"ClusterArn": ...,
}
parent.describe_cluster_v2(**kwargs)
describe_configuration#
Returns a description of this MSK configuration.
Type annotations and code completion for boto3.client("kafka").describe_configuration
method.
boto3 documentation
# describe_configuration method definition
def describe_configuration(
self,
*,
Arn: str,
) -> DescribeConfigurationResponseTypeDef: # (1)
...
# describe_configuration method usage example with argument unpacking
kwargs: DescribeConfigurationRequestRequestTypeDef = { # (1)
"Arn": ...,
}
parent.describe_configuration(**kwargs)
describe_configuration_revision#
Returns a description of this revision of the configuration.
Type annotations and code completion for boto3.client("kafka").describe_configuration_revision
method.
boto3 documentation
# describe_configuration_revision method definition
def describe_configuration_revision(
self,
*,
Arn: str,
Revision: int,
) -> DescribeConfigurationRevisionResponseTypeDef: # (1)
...
# describe_configuration_revision method usage example with argument unpacking
kwargs: DescribeConfigurationRevisionRequestRequestTypeDef = { # (1)
"Arn": ...,
"Revision": ...,
}
parent.describe_configuration_revision(**kwargs)
describe_vpc_connection#
Returns a description of this MSK VPC connection.
Type annotations and code completion for boto3.client("kafka").describe_vpc_connection
method.
boto3 documentation
# describe_vpc_connection method definition
def describe_vpc_connection(
self,
*,
Arn: str,
) -> DescribeVpcConnectionResponseTypeDef: # (1)
...
# describe_vpc_connection method usage example with argument unpacking
kwargs: DescribeVpcConnectionRequestRequestTypeDef = { # (1)
"Arn": ...,
}
parent.describe_vpc_connection(**kwargs)
generate_presigned_url#
Generate a presigned url given a client, its method, and arguments.
Type annotations and code completion for boto3.client("kafka").generate_presigned_url
method.
boto3 documentation
# generate_presigned_url method definition
def generate_presigned_url(
self,
ClientMethod: str,
Params: Mapping[str, Any] = ...,
ExpiresIn: int = 3600,
HttpMethod: str = ...,
) -> str:
...
get_bootstrap_brokers#
A list of brokers that a client application can use to bootstrap.
Type annotations and code completion for boto3.client("kafka").get_bootstrap_brokers
method.
boto3 documentation
# get_bootstrap_brokers method definition
def get_bootstrap_brokers(
self,
*,
ClusterArn: str,
) -> GetBootstrapBrokersResponseTypeDef: # (1)
...
# get_bootstrap_brokers method usage example with argument unpacking
kwargs: GetBootstrapBrokersRequestRequestTypeDef = { # (1)
"ClusterArn": ...,
}
parent.get_bootstrap_brokers(**kwargs)
get_cluster_policy#
Get the MSK cluster policy specified by the Amazon Resource Name (ARN) in the request.
Type annotations and code completion for boto3.client("kafka").get_cluster_policy
method.
boto3 documentation
# get_cluster_policy method definition
def get_cluster_policy(
self,
*,
ClusterArn: str,
) -> GetClusterPolicyResponseTypeDef: # (1)
...
# get_cluster_policy method usage example with argument unpacking
kwargs: GetClusterPolicyRequestRequestTypeDef = { # (1)
"ClusterArn": ...,
}
parent.get_cluster_policy(**kwargs)
get_compatible_kafka_versions#
Gets the Apache Kafka versions to which you can update the MSK cluster.
Type annotations and code completion for boto3.client("kafka").get_compatible_kafka_versions
method.
boto3 documentation
# get_compatible_kafka_versions method definition
def get_compatible_kafka_versions(
self,
*,
ClusterArn: str = ...,
) -> GetCompatibleKafkaVersionsResponseTypeDef: # (1)
...
# get_compatible_kafka_versions method usage example with argument unpacking
kwargs: GetCompatibleKafkaVersionsRequestRequestTypeDef = { # (1)
"ClusterArn": ...,
}
parent.get_compatible_kafka_versions(**kwargs)
list_client_vpc_connections#
Returns a list of all the VPC connections in this Region.
Type annotations and code completion for boto3.client("kafka").list_client_vpc_connections
method.
boto3 documentation
# list_client_vpc_connections method definition
def list_client_vpc_connections(
self,
*,
ClusterArn: str,
MaxResults: int = ...,
NextToken: str = ...,
) -> ListClientVpcConnectionsResponseTypeDef: # (1)
...
# list_client_vpc_connections method usage example with argument unpacking
kwargs: ListClientVpcConnectionsRequestRequestTypeDef = { # (1)
"ClusterArn": ...,
}
parent.list_client_vpc_connections(**kwargs)
list_cluster_operations#
Returns a list of all the operations that have been performed on the specified MSK cluster.
Type annotations and code completion for boto3.client("kafka").list_cluster_operations
method.
boto3 documentation
# list_cluster_operations method definition
def list_cluster_operations(
self,
*,
ClusterArn: str,
MaxResults: int = ...,
NextToken: str = ...,
) -> ListClusterOperationsResponseTypeDef: # (1)
...
# list_cluster_operations method usage example with argument unpacking
kwargs: ListClusterOperationsRequestRequestTypeDef = { # (1)
"ClusterArn": ...,
}
parent.list_cluster_operations(**kwargs)
list_cluster_operations_v2#
Returns a list of all the operations that have been performed on the specified MSK cluster.
Type annotations and code completion for boto3.client("kafka").list_cluster_operations_v2
method.
boto3 documentation
# list_cluster_operations_v2 method definition
def list_cluster_operations_v2(
self,
*,
ClusterArn: str,
MaxResults: int = ...,
NextToken: str = ...,
) -> ListClusterOperationsV2ResponseTypeDef: # (1)
...
# list_cluster_operations_v2 method usage example with argument unpacking
kwargs: ListClusterOperationsV2RequestRequestTypeDef = { # (1)
"ClusterArn": ...,
}
parent.list_cluster_operations_v2(**kwargs)
list_clusters#
Returns a list of all the MSK clusters in the current Region.
Type annotations and code completion for boto3.client("kafka").list_clusters
method.
boto3 documentation
# list_clusters method definition
def list_clusters(
self,
*,
ClusterNameFilter: str = ...,
MaxResults: int = ...,
NextToken: str = ...,
) -> ListClustersResponseTypeDef: # (1)
...
# list_clusters method usage example with argument unpacking
kwargs: ListClustersRequestRequestTypeDef = { # (1)
"ClusterNameFilter": ...,
}
parent.list_clusters(**kwargs)
list_clusters_v2#
Returns a list of all the MSK clusters in the current Region.
Type annotations and code completion for boto3.client("kafka").list_clusters_v2
method.
boto3 documentation
# list_clusters_v2 method definition
def list_clusters_v2(
self,
*,
ClusterNameFilter: str = ...,
ClusterTypeFilter: str = ...,
MaxResults: int = ...,
NextToken: str = ...,
) -> ListClustersV2ResponseTypeDef: # (1)
...
# list_clusters_v2 method usage example with argument unpacking
kwargs: ListClustersV2RequestRequestTypeDef = { # (1)
"ClusterNameFilter": ...,
}
parent.list_clusters_v2(**kwargs)
list_configuration_revisions#
Returns a list of all the MSK configurations in this Region.
Type annotations and code completion for boto3.client("kafka").list_configuration_revisions
method.
boto3 documentation
# list_configuration_revisions method definition
def list_configuration_revisions(
self,
*,
Arn: str,
MaxResults: int = ...,
NextToken: str = ...,
) -> ListConfigurationRevisionsResponseTypeDef: # (1)
...
# list_configuration_revisions method usage example with argument unpacking
kwargs: ListConfigurationRevisionsRequestRequestTypeDef = { # (1)
"Arn": ...,
}
parent.list_configuration_revisions(**kwargs)