Skip to content

create_cluster async

create_cluster(
    *,
    config_overrides: Optional[AsyncKafkaClientConfig] = None,
    broker_node_group_info: Optional[BrokerNodeGroupInfo] = None,
    rebalancing: Optional[Rebalancing] = None,
    client_authentication: Optional[ClientAuthentication] = None,
    cluster_name: Optional[__stringMin1Max64] = None,
    configuration_info: Optional[ConfigurationInfo] = None,
    encryption_info: Optional[EncryptionInfo] = None,
    enhanced_monitoring: Optional[EnhancedMonitoring] = None,
    open_monitoring: Optional[OpenMonitoringInfo] = None,
    kafka_version: Optional[__stringMin1Max128] = None,
    logging_info: Optional[LoggingInfo] = None,
    number_of_broker_nodes: Optional[__integerMin1Max15] = None,
    tags: Optional[__mapOf__string] = None,
    storage_mode: Optional[StorageMode] = None,
) -> CreateClusterResponse

Creates a new MSK cluster.

Parameters:

  • broker_node_group_info (Optional[BrokerNodeGroupInfo], default: None ) –

    Information about the broker nodes in the cluster.

  • rebalancing (Optional[Rebalancing], default: None ) –

    Specifies if intelligent rebalancing should be turned on for the new MSK Provisioned cluster with Express brokers. By default, intelligent rebalancing status is ACTIVE for all new clusters.

  • client_authentication (Optional[ClientAuthentication], default: None ) –

    Includes all client authentication related information.

  • cluster_name (Optional[__stringMin1Max64], default: None ) –

    The name of the cluster.

  • configuration_info (Optional[ConfigurationInfo], default: None ) –

    Represents the configuration that you want MSK to use for the brokers in a cluster.

  • encryption_info (Optional[EncryptionInfo], default: None ) –

    Includes all encryption-related information.

  • enhanced_monitoring (Optional[EnhancedMonitoring], default: None ) –

    Specifies the level of monitoring for the MSK cluster. The possible values are DEFAULT, PER_BROKER, PER_TOPIC_PER_BROKER, and PER_TOPIC_PER_PARTITION.

  • open_monitoring (Optional[OpenMonitoringInfo], default: None ) –

    The settings for open monitoring.

  • kafka_version (Optional[__stringMin1Max128], default: None ) –

    The version of Apache Kafka.

  • number_of_broker_nodes (Optional[__integerMin1Max15], default: None ) –

    The number of broker nodes in the cluster.

  • tags (Optional[__mapOf__string], default: None ) –

    Create tags when creating the cluster.

  • storage_mode (Optional[StorageMode], default: None ) –

    This controls storage mode for supported storage tiers.

Raises:

Source code in docs_src/capo_kafka/_services/async_kafka.py
async def create_cluster(
    self,
    *,
    config_overrides: Optional[AsyncKafkaClientConfig] = None,
    broker_node_group_info: Optional[
        "capo_kafka.types.broker_node_group_info.BrokerNodeGroupInfo"
    ] = None,
    rebalancing: Optional["capo_kafka.types.rebalancing.Rebalancing"] = None,
    client_authentication: Optional[
        "capo_kafka.types.client_authentication.ClientAuthentication"
    ] = None,
    cluster_name: Optional[
        "capo_kafka.types.__string_min1_max64.__stringMin1Max64"
    ] = None,
    configuration_info: Optional[
        "capo_kafka.types.configuration_info.ConfigurationInfo"
    ] = None,
    encryption_info: Optional[
        "capo_kafka.types.encryption_info.EncryptionInfo"
    ] = None,
    enhanced_monitoring: Optional[
        "capo_kafka.types.enhanced_monitoring.EnhancedMonitoring"
    ] = None,
    open_monitoring: Optional[
        "capo_kafka.types.open_monitoring_info.OpenMonitoringInfo"
    ] = None,
    kafka_version: Optional[
        "capo_kafka.types.__string_min1_max128.__stringMin1Max128"
    ] = None,
    logging_info: Optional["capo_kafka.types.logging_info.LoggingInfo"] = None,
    number_of_broker_nodes: Optional[
        "capo_kafka.types.__integer_min1_max15.__integerMin1Max15"
    ] = None,
    tags: Optional["capo_kafka.types.__map_of__string.__mapOf__string"] = None,
    storage_mode: Optional["capo_kafka.types.storage_mode.StorageMode"] = None,
) -> "capo_kafka.types.create_cluster_response.CreateClusterResponse":
    """<p>Creates a new MSK cluster.</p>

    Args:
        broker_node_group_info: <p>Information about the broker nodes in the cluster.</p>
        rebalancing: <p>Specifies if intelligent rebalancing should be turned on for the new MSK Provisioned cluster with Express brokers. By default, intelligent rebalancing status is ACTIVE for all new clusters.</p>
        client_authentication: <p>Includes all client authentication related information.</p>
        cluster_name: <p>The name of the cluster.</p>
        configuration_info: <p>Represents the configuration that you want MSK to use for the brokers in a cluster.</p>
        encryption_info: <p>Includes all encryption-related information.</p>
        enhanced_monitoring: <p>Specifies the level of monitoring for the MSK cluster. The possible values are DEFAULT, PER_BROKER, PER_TOPIC_PER_BROKER, and PER_TOPIC_PER_PARTITION.</p>
        open_monitoring: <p>The settings for open monitoring.</p>
        kafka_version: <p>The version of Apache Kafka.</p>
        number_of_broker_nodes: <p>The number of broker nodes in the cluster.</p>
        tags: <p>Create tags when creating the cluster.</p>
        storage_mode: <p>This controls storage mode for supported storage tiers.</p>

    Raises:
        capo_kafka.errors.bad_request_exception.BadRequestException: <p>Returns information about an error.</p>
        capo_kafka.errors.conflict_exception.ConflictException: <p>Returns information about an error.</p>
        capo_kafka.errors.forbidden_exception.ForbiddenException: <p>Returns information about an error.</p>
        capo_kafka.errors.internal_server_error_exception.InternalServerErrorException: <p>Returns information about an error.</p>
        capo_kafka.errors.service_unavailable_exception.ServiceUnavailableException: <p>Returns information about an error.</p>
        capo_kafka.errors.too_many_requests_exception.TooManyRequestsException: <p>Returns information about an error.</p>
        capo_kafka.errors.unauthorized_exception.UnauthorizedException: <p>Returns information about an error.</p>
        capo_kafka.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_kafka.types.create_cluster_request.CreateClusterRequest]",
    ) -> AsyncOperationResponse[
        "capo_kafka.types.create_cluster_response.CreateClusterResponse"
    ]:
        import capo_kafka._operations.kafka.create_cluster

        (
            output,
            http_response,
        ) = await capo_kafka._operations.kafka.create_cluster.async_create_cluster(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateCluster")
    )
    input_: capo_kafka.types.create_cluster_request.CreateClusterRequest = {}
    if broker_node_group_info is not None:
        input_["broker_node_group_info"] = broker_node_group_info
    if rebalancing is not None:
        input_["rebalancing"] = rebalancing
    if client_authentication is not None:
        input_["client_authentication"] = client_authentication
    if cluster_name is not None:
        input_["cluster_name"] = cluster_name
    if configuration_info is not None:
        input_["configuration_info"] = configuration_info
    if encryption_info is not None:
        input_["encryption_info"] = encryption_info
    if enhanced_monitoring is not None:
        input_["enhanced_monitoring"] = enhanced_monitoring
    if open_monitoring is not None:
        input_["open_monitoring"] = open_monitoring
    if kafka_version is not None:
        input_["kafka_version"] = kafka_version
    if logging_info is not None:
        input_["logging_info"] = logging_info
    if number_of_broker_nodes is not None:
        input_["number_of_broker_nodes"] = number_of_broker_nodes
    if tags is not None:
        input_["tags"] = tags
    if storage_mode is not None:
        input_["storage_mode"] = storage_mode

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output