Skip to content

update_broker_type async

update_broker_type(
    cluster_arn: __string,
    *,
    config_overrides: Optional[AsyncKafkaClientConfig] = None,
    current_version: Optional[__string] = None,
    target_instance_type: Optional[__string] = None,
    topic_reassignment: Optional[TopicReassignment] = None,
) -> UpdateBrokerTypeResponse

Updates EC2 instance type.

Parameters:

  • cluster_arn (__string) –

    The Amazon Resource Name (ARN) that uniquely identifies the cluster.

  • current_version (Optional[__string], default: None ) –

    The cluster version that you want to change. After this operation completes successfully, the cluster will have a new version.

  • target_instance_type (Optional[__string], default: None ) –

    The type of Amazon EC2 instances to use for Kafka brokers. For in-place upgrades to Express, use the composite format to initiate mixed mode, the Express instance type to complete the upgrade, or the Standard instance type to rollback.

  • topic_reassignment (Optional[TopicReassignment], default: None ) –

    Controls automatic topic reassignment when entering mixed broker mode. When set to AUTO, MSK automatically reassigns all topics to the target broker type after adding new brokers. When set to MANUAL (default), customers manage topic reassignment using the StartTopicReassignment API. Only valid when targetInstanceType is a composite mixed-mode value. Must be set to MANUAL before completing the upgrade or rolling back.

Raises:

Source code in docs_src/capo_kafka/_services/async_kafka.py
async def update_broker_type(
    self,
    cluster_arn: "capo_kafka.types.__string.__string",
    *,
    config_overrides: Optional[AsyncKafkaClientConfig] = None,
    current_version: Optional["capo_kafka.types.__string.__string"] = None,
    target_instance_type: Optional["capo_kafka.types.__string.__string"] = None,
    topic_reassignment: Optional[
        "capo_kafka.types.topic_reassignment.TopicReassignment"
    ] = None,
) -> "capo_kafka.types.update_broker_type_response.UpdateBrokerTypeResponse":
    """<p>Updates EC2 instance type.</p>

    Args:
        cluster_arn: <p>The Amazon Resource Name (ARN) that uniquely identifies the cluster.</p>
        current_version: <p>The cluster version that you want to change. After this operation completes successfully, the cluster will have a new version.</p>
        target_instance_type: <p>The type of Amazon EC2 instances to use for Kafka brokers. For in-place upgrades to Express, use the composite format to initiate mixed mode, the Express instance type to complete the upgrade, or the Standard instance type to rollback.</p>
        topic_reassignment: <p>Controls automatic topic reassignment when entering mixed broker mode. When set to AUTO, MSK automatically reassigns all topics to the target broker type after adding new brokers. When set to MANUAL (default), customers manage topic reassignment using the StartTopicReassignment API. Only valid when targetInstanceType is a composite mixed-mode value. Must be set to MANUAL before completing the upgrade or rolling back.</p>

    Raises:
        capo_kafka.errors.bad_request_exception.BadRequestException: <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.not_found_exception.NotFoundException: <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.update_broker_type_request.UpdateBrokerTypeRequest]",
    ) -> AsyncOperationResponse[
        "capo_kafka.types.update_broker_type_response.UpdateBrokerTypeResponse"
    ]:
        import capo_kafka._operations.kafka.update_broker_type

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateBrokerType")
    )
    input_: capo_kafka.types.update_broker_type_request.UpdateBrokerTypeRequest = {
        "cluster_arn": cluster_arn
    }
    if current_version is not None:
        input_["current_version"] = current_version
    if target_instance_type is not None:
        input_["target_instance_type"] = target_instance_type
    if topic_reassignment is not None:
        input_["topic_reassignment"] = topic_reassignment

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