Skip to content

start_topic_reassignment async

start_topic_reassignment(
    cluster_arn: __string,
    *,
    config_overrides: Optional[AsyncKafkaClientConfig] = None,
    client_token: Optional[__stringMin1Max64] = None,
    target_instance_type: Optional[__stringMin1Max256] = None,
    topics_to_exclude: Optional[__listOf__stringMin1Max256] = None,
    topics_to_include: Optional[__listOf__stringMin1Max256] = None,
) -> StartTopicReassignmentResponse

Initiates topic partition reassignment between broker types in a mixed-mode cluster.

Parameters:

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

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you retry a request with the same client token within 24 hours, the API returns the original response without creating a duplicate operation.

  • cluster_arn (__string) –

    The Amazon Resource Name (ARN) of the cluster.

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

    Instance type of the target brokers. Must exist in the cluster. Use Express instance type (e.g., express.m7g.large) for Standard-to-Express migration. Use Standard instance type (e.g., kafka.m7g.large) to move topics back to Standard.

  • topics_to_exclude (Optional[__listOf__stringMin1Max256], default: None ) –

    Regex patterns for topics to exclude from reassignment. Evaluated after include patterns.

  • topics_to_include (Optional[__listOf__stringMin1Max256], default: None ) –

    Regex patterns for topics to reassign. Use ['.*'] for all topics. Max 10 patterns.

Raises:

Source code in docs_src/capo_kafka/_services/async_kafka.py
async def start_topic_reassignment(
    self,
    cluster_arn: "capo_kafka.types.__string.__string",
    *,
    config_overrides: Optional[AsyncKafkaClientConfig] = None,
    client_token: Optional[
        "capo_kafka.types.__string_min1_max64.__stringMin1Max64"
    ] = None,
    target_instance_type: Optional[
        "capo_kafka.types.__string_min1_max256.__stringMin1Max256"
    ] = None,
    topics_to_exclude: Optional[
        "capo_kafka.types.__list_of__string_min1_max256.__listOf__stringMin1Max256"
    ] = None,
    topics_to_include: Optional[
        "capo_kafka.types.__list_of__string_min1_max256.__listOf__stringMin1Max256"
    ] = None,
) -> "capo_kafka.types.start_topic_reassignment_response.StartTopicReassignmentResponse":
    """<p>Initiates topic partition reassignment between broker types in a mixed-mode cluster.</p>

    Args:
        client_token: <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you retry a request with the same client token within 24 hours, the API returns the original response without creating a duplicate operation.</p>
        cluster_arn: <p>The Amazon Resource Name (ARN) of the cluster.</p>
        target_instance_type: <p>Instance type of the target brokers. Must exist in the cluster. Use Express instance type (e.g., express.m7g.large) for Standard-to-Express migration. Use Standard instance type (e.g., kafka.m7g.large) to move topics back to Standard.</p>
        topics_to_exclude: <p>Regex patterns for topics to exclude from reassignment. Evaluated after include patterns.</p>
        topics_to_include: <p>Regex patterns for topics to reassign. Use ['.*'] for all topics. Max 10 patterns.</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.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.start_topic_reassignment_request.StartTopicReassignmentRequest]",
    ) -> AsyncOperationResponse[
        "capo_kafka.types.start_topic_reassignment_response.StartTopicReassignmentResponse"
    ]:
        import capo_kafka._operations.kafka.start_topic_reassignment

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartTopicReassignment")
    )
    input_: capo_kafka.types.start_topic_reassignment_request.StartTopicReassignmentRequest = {
        "cluster_arn": cluster_arn
    }
    if client_token is not None:
        input_["client_token"] = client_token
    if target_instance_type is not None:
        input_["target_instance_type"] = target_instance_type
    if topics_to_exclude is not None:
        input_["topics_to_exclude"] = topics_to_exclude
    if topics_to_include is not None:
        input_["topics_to_include"] = topics_to_include

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