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
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.
client = boto3.client("kafka")
try:
do_something(client)
except (
client.BadRequestException,
client.ClientError,
client.ConflictException,
client.ForbiddenException,
client.InternalServerErrorException,
client.NotFoundException,
client.ServiceUnavailableException,
client.TooManyRequestsException,
client.UnauthorizedException,
) as e:
print(e)
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
def batch_associate_scram_secret(
self,
*,
ClusterArn: str,
SecretArnList: Sequence[str],
) -> BatchAssociateScramSecretResponseTypeDef: # (1)
...
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
def batch_disassociate_scram_secret(
self,
*,
ClusterArn: str,
SecretArnList: Sequence[str],
) -> BatchDisassociateScramSecretResponseTypeDef: # (1)
...
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
close
Closes underlying endpoint connections.
Type annotations and code completion for boto3.client("kafka").close
method.
boto3 documentation
create_cluster
Creates a new MSK cluster.
Type annotations and code completion for boto3.client("kafka").create_cluster
method.
boto3 documentation
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
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
def create_cluster_v2(
self,
*,
ClusterName: str,
Tags: Mapping[str, str] = ...,
Provisioned: ProvisionedRequestTypeDef = ..., # (1)
Serverless: ServerlessRequestTypeDef = ..., # (2)
) -> CreateClusterV2ResponseTypeDef: # (3)
...
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
def create_configuration(
self,
*,
Name: str,
ServerProperties: Union[str, bytes, IO[Any], StreamingBody],
Description: str = ...,
KafkaVersions: Sequence[str] = ...,
) -> CreateConfigurationResponseTypeDef: # (1)
...
kwargs: CreateConfigurationRequestRequestTypeDef = { # (1)
"Name": ...,
"ServerProperties": ...,
}
parent.create_configuration(**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
def delete_cluster(
self,
*,
ClusterArn: str,
CurrentVersion: str = ...,
) -> DeleteClusterResponseTypeDef: # (1)
...
kwargs: DeleteClusterRequestRequestTypeDef = { # (1)
"ClusterArn": ...,
}
parent.delete_cluster(**kwargs)
delete_configuration
Deletes an MSK Configuration.
Type annotations and code completion for boto3.client("kafka").delete_configuration
method.
boto3 documentation
def delete_configuration(
self,
*,
Arn: str,
) -> DeleteConfigurationResponseTypeDef: # (1)
...
kwargs: DeleteConfigurationRequestRequestTypeDef = { # (1)
"Arn": ...,
}
parent.delete_configuration(**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
def describe_cluster(
self,
*,
ClusterArn: str,
) -> DescribeClusterResponseTypeDef: # (1)
...
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
def describe_cluster_operation(
self,
*,
ClusterOperationArn: str,
) -> DescribeClusterOperationResponseTypeDef: # (1)
...
kwargs: DescribeClusterOperationRequestRequestTypeDef = { # (1)
"ClusterOperationArn": ...,
}
parent.describe_cluster_operation(**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
def describe_cluster_v2(
self,
*,
ClusterArn: str,
) -> DescribeClusterV2ResponseTypeDef: # (1)
...
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
def describe_configuration(
self,
*,
Arn: str,
) -> DescribeConfigurationResponseTypeDef: # (1)
...
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
def describe_configuration_revision(
self,
*,
Arn: str,
Revision: int,
) -> DescribeConfigurationRevisionResponseTypeDef: # (1)
...
kwargs: DescribeConfigurationRevisionRequestRequestTypeDef = { # (1)
"Arn": ...,
"Revision": ...,
}
parent.describe_configuration_revision(**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
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
def get_bootstrap_brokers(
self,
*,
ClusterArn: str,
) -> GetBootstrapBrokersResponseTypeDef: # (1)
...
kwargs: GetBootstrapBrokersRequestRequestTypeDef = { # (1)
"ClusterArn": ...,
}
parent.get_bootstrap_brokers(**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
def get_compatible_kafka_versions(
self,
*,
ClusterArn: str = ...,
) -> GetCompatibleKafkaVersionsResponseTypeDef: # (1)
...
kwargs: GetCompatibleKafkaVersionsRequestRequestTypeDef = { # (1)
"ClusterArn": ...,
}
parent.get_compatible_kafka_versions(**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
def list_cluster_operations(
self,
*,
ClusterArn: str,
MaxResults: int = ...,
NextToken: str = ...,
) -> ListClusterOperationsResponseTypeDef: # (1)
...
kwargs: ListClusterOperationsRequestRequestTypeDef = { # (1)
"ClusterArn": ...,
}
parent.list_cluster_operations(**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
def list_clusters(
self,
*,
ClusterNameFilter: str = ...,
MaxResults: int = ...,
NextToken: str = ...,
) -> ListClustersResponseTypeDef: # (1)
...
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
def list_clusters_v2(
self,
*,
ClusterNameFilter: str = ...,
ClusterTypeFilter: str = ...,
MaxResults: int = ...,
NextToken: str = ...,
) -> ListClustersV2ResponseTypeDef: # (1)
...
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
def list_configuration_revisions(
self,
*,
Arn: str,
MaxResults: int = ...,
NextToken: str = ...,
) -> ListConfigurationRevisionsResponseTypeDef: # (1)
...
kwargs: ListConfigurationRevisionsRequestRequestTypeDef = { # (1)
"Arn": ...,
}
parent.list_configuration_revisions(**kwargs)
list_configurations
Returns a list of all the MSK configurations in this Region.
Type annotations and code completion for boto3.client("kafka").list_configurations
method.
boto3 documentation
def list_configurations(
self,
*,
MaxResults: int = ...,
NextToken: str = ...,
) -> ListConfigurationsResponseTypeDef: # (1)
...
kwargs: ListConfigurationsRequestRequestTypeDef = { # (1)
"MaxResults": ...,
}
parent.list_configurations(**kwargs)
list_kafka_versions
Returns a list of Apache Kafka versions.
Type annotations and code completion for boto3.client("kafka").list_kafka_versions
method.
boto3 documentation
def list_kafka_versions(
self,
*,
MaxResults: int = ...,
NextToken: str = ...,
) -> ListKafkaVersionsResponseTypeDef: # (1)
...
kwargs: ListKafkaVersionsRequestRequestTypeDef = { # (1)
"MaxResults": ...,
}
parent.list_kafka_versions(**kwargs)
list_nodes
Returns a list of the broker nodes in the cluster.
Type annotations and code completion for boto3.client("kafka").list_nodes
method.
boto3 documentation
def list_nodes(
self,
*,
ClusterArn: str,
MaxResults: int = ...,
NextToken: str = ...,
) -> ListNodesResponseTypeDef: # (1)
...
kwargs: ListNodesRequestRequestTypeDef = { # (1)
"ClusterArn": ...,
}
parent.list_nodes(**kwargs)
list_scram_secrets
Returns a list of the Scram Secrets associated with an Amazon MSK cluster.
Type annotations and code completion for boto3.client("kafka").list_scram_secrets
method.
boto3 documentation
def list_scram_secrets(
self,
*,
ClusterArn: str,
MaxResults: int = ...,
NextToken: str = ...,
) -> ListScramSecretsResponseTypeDef: # (1)
...
kwargs: ListScramSecretsRequestRequestTypeDef = { # (1)
"ClusterArn": ...,
}
parent.list_scram_secrets(**kwargs)
list_tags_for_resource
Returns a list of the tags associated with the specified resource.
Type annotations and code completion for boto3.client("kafka").list_tags_for_resource
method.
boto3 documentation
def list_tags_for_resource(
self,
*,
ResourceArn: str,
) -> ListTagsForResourceResponseTypeDef: # (1)
...
kwargs: ListTagsForResourceRequestRequestTypeDef = { # (1)
"ResourceArn": ...,
}
parent.list_tags_for_resource(**kwargs)
reboot_broker
Reboots brokers.
Type annotations and code completion for boto3.client("kafka").reboot_broker
method.
boto3 documentation
def reboot_broker(
self,
*,
BrokerIds: Sequence[str],
ClusterArn: str,
) -> RebootBrokerResponseTypeDef: # (1)
...
kwargs: RebootBrokerRequestRequestTypeDef = { # (1)
"BrokerIds": ...,
"ClusterArn": ...,
}
parent.reboot_broker(**kwargs)
tag_resource
Adds tags to the specified MSK resource.
Type annotations and code completion for boto3.client("kafka").tag_resource
method.
boto3 documentation
def tag_resource(
self,
*,
ResourceArn: str,
Tags: Mapping[str, str],
) -> EmptyResponseMetadataTypeDef: # (1)
...
kwargs: TagResourceRequestRequestTypeDef = { # (1)
"ResourceArn": ...,
"Tags": ...,
}
parent.tag_resource(**kwargs)
untag_resource
Removes the tags associated with the keys that are provided in the query.
Type annotations and code completion for boto3.client("kafka").untag_resource
method.
boto3 documentation
def untag_resource(
self,
*,
ResourceArn: str,
TagKeys: Sequence[str],
) -> EmptyResponseMetadataTypeDef: # (1)
...
kwargs: UntagResourceRequestRequestTypeDef = { # (1)
"ResourceArn": ...,
"TagKeys": ...,
}
parent.untag_resource(**kwargs)
update_broker_count
Updates the number of broker nodes in the cluster.
Type annotations and code completion for boto3.client("kafka").update_broker_count
method.
boto3 documentation
def update_broker_count(
self,
*,
ClusterArn: str,
CurrentVersion: str,
TargetNumberOfBrokerNodes: int,
) -> UpdateBrokerCountResponseTypeDef: # (1)
...
kwargs: UpdateBrokerCountRequestRequestTypeDef = { # (1)
"ClusterArn": ...,
"CurrentVersion": ...,
"TargetNumberOfBrokerNodes": ...,
}
parent.update_broker_count(**kwargs)
update_broker_storage
Updates the EBS storage associated with MSK brokers.
Type annotations and code completion for boto3.client("kafka").update_broker_storage
method.
boto3 documentation
def update_broker_storage(
self,
*,
ClusterArn: str,
CurrentVersion: str,
TargetBrokerEBSVolumeInfo: Sequence[BrokerEBSVolumeInfoTypeDef], # (1)
) -> UpdateBrokerStorageResponseTypeDef: # (2)
...
kwargs: UpdateBrokerStorageRequestRequestTypeDef = { # (1)
"ClusterArn": ...,
"CurrentVersion": ...,
"TargetBrokerEBSVolumeInfo": ...,
}
parent.update_broker_storage(**kwargs)
update_broker_type
Updates EC2 instance type.
Type annotations and code completion for boto3.client("kafka").update_broker_type
method.
boto3 documentation
def update_broker_type(
self,
*,
ClusterArn: str,
CurrentVersion: str,
TargetInstanceType: str,
) -> UpdateBrokerTypeResponseTypeDef: # (1)
...
kwargs: UpdateBrokerTypeRequestRequestTypeDef = { # (1)
"ClusterArn": ...,
"CurrentVersion": ...,
"TargetInstanceType": ...,
}
parent.update_broker_type(**kwargs)
update_cluster_configuration
Updates the cluster with the configuration that is specified in the request body.
Type annotations and code completion for boto3.client("kafka").update_cluster_configuration
method.
boto3 documentation
def update_cluster_configuration(
self,
*,
ClusterArn: str,
ConfigurationInfo: ConfigurationInfoTypeDef, # (1)
CurrentVersion: str,
) -> UpdateClusterConfigurationResponseTypeDef: # (2)
...
kwargs: UpdateClusterConfigurationRequestRequestTypeDef = { # (1)
"ClusterArn": ...,
"ConfigurationInfo": ...,
"CurrentVersion": ...,
}
parent.update_cluster_configuration(**kwargs)
update_cluster_kafka_version
Updates the Apache Kafka version for the cluster.
Type annotations and code completion for boto3.client("kafka").update_cluster_kafka_version
method.
boto3 documentation
def update_cluster_kafka_version(
self,
*,
ClusterArn: str,
CurrentVersion: str,
TargetKafkaVersion: str,
ConfigurationInfo: ConfigurationInfoTypeDef = ..., # (1)
) -> UpdateClusterKafkaVersionResponseTypeDef: # (2)
...
kwargs: UpdateClusterKafkaVersionRequestRequestTypeDef = { # (1)
"ClusterArn": ...,
"CurrentVersion": ...,
"TargetKafkaVersion": ...,
}
parent.update_cluster_kafka_version(**kwargs)
update_configuration
Updates an MSK configuration.
Type annotations and code completion for boto3.client("kafka").update_configuration
method.
boto3 documentation
def update_configuration(
self,
*,
Arn: str,
ServerProperties: Union[str, bytes, IO[Any], StreamingBody],
Description: str = ...,
) -> UpdateConfigurationResponseTypeDef: # (1)
...
kwargs: UpdateConfigurationRequestRequestTypeDef = { # (1)
"Arn": ...,
"ServerProperties": ...,
}
parent.update_configuration(**kwargs)
update_connectivity
Updates the cluster's connectivity configuration.
Type annotations and code completion for boto3.client("kafka").update_connectivity
method.
boto3 documentation
def update_connectivity(
self,
*,
ClusterArn: str,
ConnectivityInfo: ConnectivityInfoTypeDef, # (1)
CurrentVersion: str,
) -> UpdateConnectivityResponseTypeDef: # (2)
...
kwargs: UpdateConnectivityRequestRequestTypeDef = { # (1)
"ClusterArn": ...,
"ConnectivityInfo": ...,
"CurrentVersion": ...,
}
parent.update_connectivity(**kwargs)
update_monitoring
Updates the monitoring settings for the cluster.
Type annotations and code completion for boto3.client("kafka").update_monitoring
method.
boto3 documentation
def update_monitoring(
self,
*,
ClusterArn: str,
CurrentVersion: str,
EnhancedMonitoring: EnhancedMonitoringType = ..., # (1)
OpenMonitoring: OpenMonitoringInfoTypeDef = ..., # (2)
LoggingInfo: LoggingInfoTypeDef = ..., # (3)
) -> UpdateMonitoringResponseTypeDef: # (4)
...
- See EnhancedMonitoringType
- See OpenMonitoringInfoTypeDef
- See LoggingInfoTypeDef
- See UpdateMonitoringResponseTypeDef
kwargs: UpdateMonitoringRequestRequestTypeDef = { # (1)
"ClusterArn": ...,
"CurrentVersion": ...,
}
parent.update_monitoring(**kwargs)
update_security
Updates the security settings for the cluster.
Type annotations and code completion for boto3.client("kafka").update_security
method.
boto3 documentation
def update_security(
self,
*,
ClusterArn: str,
CurrentVersion: str,
ClientAuthentication: ClientAuthenticationTypeDef = ..., # (1)
EncryptionInfo: EncryptionInfoTypeDef = ..., # (2)
) -> UpdateSecurityResponseTypeDef: # (3)
...
kwargs: UpdateSecurityRequestRequestTypeDef = { # (1)
"ClusterArn": ...,
"CurrentVersion": ...,
}
parent.update_security(**kwargs)
update_storage
Updates cluster broker volume size (or) sets cluster storage mode to TIERED.
Type annotations and code completion for boto3.client("kafka").update_storage
method.
boto3 documentation
def update_storage(
self,
*,
ClusterArn: str,
CurrentVersion: str,
ProvisionedThroughput: ProvisionedThroughputTypeDef = ..., # (1)
StorageMode: StorageModeType = ..., # (2)
VolumeSizeGB: int = ...,
) -> UpdateStorageResponseTypeDef: # (3)
...
kwargs: UpdateStorageRequestRequestTypeDef = { # (1)
"ClusterArn": ...,
"CurrentVersion": ...,
}
parent.update_storage(**kwargs)
get_paginator
Type annotations and code completion for boto3.client("kafka").get_paginator
method with overloads.
client.get_paginator("list_cluster_operations")
-> ListClusterOperationsPaginatorclient.get_paginator("list_clusters")
-> ListClustersPaginatorclient.get_paginator("list_clusters_v2")
-> ListClustersV2Paginatorclient.get_paginator("list_configuration_revisions")
-> ListConfigurationRevisionsPaginatorclient.get_paginator("list_configurations")
-> ListConfigurationsPaginatorclient.get_paginator("list_kafka_versions")
-> ListKafkaVersionsPaginatorclient.get_paginator("list_nodes")
-> ListNodesPaginatorclient.get_paginator("list_scram_secrets")
-> ListScramSecretsPaginator