Skip to content

KafkaClient#

Index > Kafka > 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)
    ...
  1. See BatchAssociateScramSecretResponseTypeDef
# batch_associate_scram_secret method usage example with argument unpacking

kwargs: BatchAssociateScramSecretRequestRequestTypeDef = {  # (1)
    "ClusterArn": ...,
    "SecretArnList": ...,
}

parent.batch_associate_scram_secret(**kwargs)
  1. See BatchAssociateScramSecretRequestRequestTypeDef

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)
    ...
  1. See BatchDisassociateScramSecretResponseTypeDef
# batch_disassociate_scram_secret method usage example with argument unpacking

kwargs: BatchDisassociateScramSecretRequestRequestTypeDef = {  # (1)
    "ClusterArn": ...,
    "SecretArnList": ...,
}

parent.batch_disassociate_scram_secret(**kwargs)
  1. See BatchDisassociateScramSecretRequestRequestTypeDef

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: Union[BrokerNodeGroupInfoTypeDef, BrokerNodeGroupInfoExtraOutputTypeDef],  # (1)
    ClusterName: str,
    KafkaVersion: str,
    NumberOfBrokerNodes: int,
    ClientAuthentication: Union[ClientAuthenticationTypeDef, ClientAuthenticationExtraOutputTypeDef] = ...,  # (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)
    ...
  1. See BrokerNodeGroupInfoTypeDef BrokerNodeGroupInfoExtraOutputTypeDef
  2. See ClientAuthenticationTypeDef ClientAuthenticationExtraOutputTypeDef
  3. See ConfigurationInfoTypeDef
  4. See EncryptionInfoTypeDef
  5. See EnhancedMonitoringType
  6. See OpenMonitoringInfoTypeDef
  7. See LoggingInfoTypeDef
  8. See StorageModeType
  9. See CreateClusterResponseTypeDef
# create_cluster method usage example with argument unpacking

kwargs: CreateClusterRequestRequestTypeDef = {  # (1)
    "BrokerNodeGroupInfo": ...,
    "ClusterName": ...,
    "KafkaVersion": ...,
    "NumberOfBrokerNodes": ...,
}

parent.create_cluster(**kwargs)
  1. See CreateClusterRequestRequestTypeDef

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)
    ...
  1. See ProvisionedRequestTypeDef
  2. See ServerlessRequestTypeDef
  3. See CreateClusterV2ResponseTypeDef
# create_cluster_v2 method usage example with argument unpacking

kwargs: CreateClusterV2RequestRequestTypeDef = {  # (1)
    "ClusterName": ...,
}

parent.create_cluster_v2(**kwargs)
  1. See CreateClusterV2RequestRequestTypeDef

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)
    ...
  1. See CreateConfigurationResponseTypeDef
# create_configuration method usage example with argument unpacking

kwargs: CreateConfigurationRequestRequestTypeDef = {  # (1)
    "Name": ...,
    "ServerProperties": ...,
}

parent.create_configuration(**kwargs)
  1. See CreateConfigurationRequestRequestTypeDef

create_replicator#

Creates the replicator.

Type annotations and code completion for boto3.client("kafka").create_replicator method. boto3 documentation

# create_replicator method definition

def create_replicator(
    self,
    *,
    KafkaClusters: Sequence[KafkaClusterTypeDef],  # (1)
    ReplicationInfoList: Sequence[ReplicationInfoTypeDef],  # (2)
    ReplicatorName: str,
    ServiceExecutionRoleArn: str,
    Description: str = ...,
    Tags: Mapping[str, str] = ...,
) -> CreateReplicatorResponseTypeDef:  # (3)
    ...
  1. See KafkaClusterTypeDef
  2. See ReplicationInfoTypeDef
  3. See CreateReplicatorResponseTypeDef
# create_replicator method usage example with argument unpacking

kwargs: CreateReplicatorRequestRequestTypeDef = {  # (1)
    "KafkaClusters": ...,
    "ReplicationInfoList": ...,
    "ReplicatorName": ...,
    "ServiceExecutionRoleArn": ...,
}

parent.create_replicator(**kwargs)
  1. See