Kafka / Client / create_topic
create_topic¶
- Kafka.Client.create_topic(**kwargs)¶
Creates a topic in the specified MSK cluster.
See also: AWS API Documentation
Request Syntax
response = client.create_topic( ClusterArn='string', TopicName='string', PartitionCount=123, ReplicationFactor=123, Configs='string' )
- Parameters:
ClusterArn (string) –
[REQUIRED]
The Amazon Resource Name (ARN) that uniquely identifies the cluster.
TopicName (string) –
[REQUIRED]
The name of the topic to create.
PartitionCount (integer) –
[REQUIRED]
The number of partitions for the topic.
ReplicationFactor (integer) –
[REQUIRED]
The replication factor for the topic.
Configs (string) – Topic configurations encoded as a Base64 string.
- Return type:
dict
- Returns:
Response Syntax
{ 'TopicArn': 'string', 'TopicName': 'string', 'Status': 'CREATING'|'UPDATING'|'DELETING'|'ACTIVE' }
Response Structure
(dict) –
200 response
TopicArn (string) –
The Amazon Resource Name (ARN) of the topic.
TopicName (string) –
The name of the topic that was created.
Status (string) –
The status of the topic creation.
Exceptions
Kafka.Client.exceptions.BadRequestExceptionKafka.Client.exceptions.InternalServerErrorExceptionKafka.Client.exceptions.UnauthorizedExceptionKafka.Client.exceptions.ForbiddenExceptionKafka.Client.exceptions.ServiceUnavailableExceptionKafka.Client.exceptions.TooManyRequestsExceptionKafka.Client.exceptions.ConflictExceptionKafka.Client.exceptions.TopicExistsExceptionKafka.Client.exceptions.ClusterConnectivityExceptionKafka.Client.exceptions.KafkaTimeoutExceptionKafka.Client.exceptions.UnknownTopicOrPartitionExceptionKafka.Client.exceptions.ControllerMovedExceptionKafka.Client.exceptions.NotControllerExceptionKafka.Client.exceptions.ReassignmentInProgressExceptionKafka.Client.exceptions.GroupSubscribedToTopicExceptionKafka.Client.exceptions.KafkaRequestException