Skip to content

update_connector async

update_connector(
    connector_arn: __string,
    current_version: __string,
    *,
    config_overrides: Optional[AsyncKafkaConnectClientConfig] = None,
    capacity: Optional[CapacityUpdate] = None,
    connector_configuration: Optional[ConnectorConfigurationUpdate] = None,
    skip_health_validation: Optional[__boolean] = None,
    plugins: Optional[__listOfPluginUpdate] = None,
    worker_configuration: Optional[WorkerConfigurationUpdate] = None,
    use_default_worker_configuration: Optional[__boolean] = None,
) -> UpdateConnectorResponse

Updates the specified connector. In the request body, you can update either the connector's worker setting or its connector configuration, but not both in the same request. To update the worker setting, specify one or more of capacity, plugins, workerConfiguration, or useDefaultWorkerConfiguration. To update the connector configuration, specify only connectorConfiguration.

Parameters:

  • capacity (Optional[CapacityUpdate], default: None ) –

    The target capacity.

  • connector_configuration (Optional[ConnectorConfigurationUpdate], default: None ) –

    A map of keys to values that represent the configuration for the connector.

  • skip_health_validation (Optional[__boolean], default: None ) –

    Specifies whether the update bypasses connector-level and task-level health checks. If true, the update skips the health checks. The update stays in effect even if the connector or its tasks are unhealthy, and Amazon MSK Connect doesn't roll it back. If false or not specified, the health checks run. If they fail, MSK Connect automatically rolls the connector back to its previous configuration, and the update doesn't take effect. To update a connector that is in the PAUSED state, you must set this parameter to true.

  • connector_arn (__string) –

    The Amazon Resource Name (ARN) of the connector that you want to update.

  • current_version (__string) –

    The current version of the connector that you want to update.

  • plugins (Optional[__listOfPluginUpdate], default: None ) –

    Amazon MSK Connect does not currently support specifying multiple plugins as a list. To use more than one plugin for your connector, you can create a single custom plugin using a ZIP file that bundles multiple plugins together.

    Specifies which plugin to use for the connector. You must specify a single-element list containing one customPlugin object. If you don't specify this parameter, the connector keeps its current plugin.

  • worker_configuration (Optional[WorkerConfigurationUpdate], default: None ) –

    The worker configuration to use with the connector. Specify the Amazon Resource Name (ARN) and the revision of the worker configuration. You can't specify both workerConfiguration and useDefaultWorkerConfiguration in the same request. If you specify neither parameter, the connector keeps its current worker configuration.

  • use_default_worker_configuration (Optional[__boolean], default: None ) –

    Specifies whether to switch the connector to the default worker configuration that Amazon MSK Connect provides. If true, the connector stops using its custom worker configuration and uses the default worker configuration instead. If false or not specified, the connector keeps its current worker configuration. You can't specify both useDefaultWorkerConfiguration and workerConfiguration in the same request.

Raises:

  • BadRequestException –

    HTTP Status Code 400: Bad request due to incorrect input. Correct your request and then retry it.

  • ForbiddenException –

    HTTP Status Code 403: Access forbidden. Correct your credentials and then retry your request.

  • InternalServerErrorException –

    HTTP Status Code 500: Unexpected internal server error. Retrying your request might resolve the issue.

  • NotFoundException –

    HTTP Status Code 404: Resource not found due to incorrect input. Correct your request and then retry it.

  • ServiceUnavailableException –

    HTTP Status Code 503: Service Unavailable. Retrying your request in some time might resolve the issue.

  • TooManyRequestsException –

    HTTP Status Code 429: Limit exceeded. Resource limit reached.

  • UnauthorizedException –

    HTTP Status Code 401: Unauthorized request. The provided credentials couldn't be validated.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_kafkaconnect/_services/async_kafka_connect.py
async def update_connector(
    self,
    connector_arn: "capo_kafkaconnect.types.__string.__string",
    current_version: "capo_kafkaconnect.types.__string.__string",
    *,
    config_overrides: Optional[AsyncKafkaConnectClientConfig] = None,
    capacity: Optional[
        "capo_kafkaconnect.types.capacity_update.CapacityUpdate"
    ] = None,
    connector_configuration: Optional[
        "capo_kafkaconnect.types.connector_configuration_update.ConnectorConfigurationUpdate"
    ] = None,
    skip_health_validation: Optional[
        "capo_kafkaconnect.types.__boolean.__boolean"
    ] = None,
    plugins: Optional[
        "capo_kafkaconnect.types.__list_of_plugin_update.__listOfPluginUpdate"
    ] = None,
    worker_configuration: Optional[
        "capo_kafkaconnect.types.worker_configuration_update.WorkerConfigurationUpdate"
    ] = None,
    use_default_worker_configuration: Optional[
        "capo_kafkaconnect.types.__boolean.__boolean"
    ] = None,
) -> "capo_kafkaconnect.types.update_connector_response.UpdateConnectorResponse":
    """<p>Updates the specified connector. In the request body, you can update either the connector's worker setting or its connector configuration, but not both in the same request. To update the worker setting, specify one or more of <code>capacity</code>, <code>plugins</code>, <code>workerConfiguration</code>, or <code>useDefaultWorkerConfiguration</code>. To update the connector configuration, specify only <code>connectorConfiguration</code>.</p>

    Args:
        capacity: <p>The target capacity.</p>
        connector_configuration: <p>A map of keys to values that represent the configuration for the connector.</p>
        skip_health_validation: <p>Specifies whether the update bypasses connector-level and task-level health checks. If <code>true</code>, the update skips the health checks. The update stays in effect even if the connector or its tasks are unhealthy, and Amazon MSK Connect doesn't roll it back. If <code>false</code> or not specified, the health checks run. If they fail, MSK Connect automatically rolls the connector back to its previous configuration, and the update doesn't take effect. To update a connector that is in the <code>PAUSED</code> state, you must set this parameter to <code>true</code>.</p>
        connector_arn: <p>The Amazon Resource Name (ARN) of the connector that you want to update.</p>
        current_version: <p>The current version of the connector that you want to update.</p>
        plugins: <important> <p>Amazon MSK Connect does not currently support specifying multiple plugins as a list. To use more than one plugin for your connector, you can create a single custom plugin using a ZIP file that bundles multiple plugins together.</p> </important> <p>Specifies which plugin to use for the connector. You must specify a single-element list containing one <code>customPlugin</code> object. If you don't specify this parameter, the connector keeps its current plugin.</p>
        worker_configuration: <p>The worker configuration to use with the connector. Specify the Amazon Resource Name (ARN) and the revision of the worker configuration. You can't specify both <code>workerConfiguration</code> and <code>useDefaultWorkerConfiguration</code> in the same request. If you specify neither parameter, the connector keeps its current worker configuration.</p>
        use_default_worker_configuration: <p>Specifies whether to switch the connector to the default worker configuration that Amazon MSK Connect provides. If <code>true</code>, the connector stops using its custom worker configuration and uses the default worker configuration instead. If <code>false</code> or not specified, the connector keeps its current worker configuration. You can't specify both <code>useDefaultWorkerConfiguration</code> and <code>workerConfiguration</code> in the same request.</p>

    Raises:
        capo_kafkaconnect.errors.bad_request_exception.BadRequestException: <p>HTTP Status Code 400: Bad request due to incorrect input. Correct your request and then retry it.</p>
        capo_kafkaconnect.errors.forbidden_exception.ForbiddenException: <p>HTTP Status Code 403: Access forbidden. Correct your credentials and then retry your request.</p>
        capo_kafkaconnect.errors.internal_server_error_exception.InternalServerErrorException: <p>HTTP Status Code 500: Unexpected internal server error. Retrying your request might resolve the issue.</p>
        capo_kafkaconnect.errors.not_found_exception.NotFoundException: <p>HTTP Status Code 404: Resource not found due to incorrect input. Correct your request and then retry it.</p>
        capo_kafkaconnect.errors.service_unavailable_exception.ServiceUnavailableException: <p>HTTP Status Code 503: Service Unavailable. Retrying your request in some time might resolve the issue.</p>
        capo_kafkaconnect.errors.too_many_requests_exception.TooManyRequestsException: <p>HTTP Status Code 429: Limit exceeded. Resource limit reached.</p>
        capo_kafkaconnect.errors.unauthorized_exception.UnauthorizedException: <p>HTTP Status Code 401: Unauthorized request. The provided credentials couldn't be validated.</p>
        capo_kafkaconnect.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_kafkaconnect.types.update_connector_request.UpdateConnectorRequest]",
    ) -> AsyncOperationResponse[
        "capo_kafkaconnect.types.update_connector_response.UpdateConnectorResponse"
    ]:
        import capo_kafkaconnect._operations.kafka_connect.update_connector

        (
            output,
            http_response,
        ) = await capo_kafkaconnect._operations.kafka_connect.update_connector.async_update_connector(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_kafkaconnect.types.update_connector_request.UpdateConnectorRequest",
    ) -> dict[str, Any]:
        import capo_kafkaconnect.types.update_connector_request

        return capo_kafkaconnect.types.update_connector_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("UpdateConnector", redact_input=_redact_input),
    )
    input_: capo_kafkaconnect.types.update_connector_request.UpdateConnectorRequest = {
        "connector_arn": connector_arn,
        "current_version": current_version,
    }
    if capacity is not None:
        input_["capacity"] = capacity
    if connector_configuration is not None:
        input_["connector_configuration"] = connector_configuration
    if skip_health_validation is not None:
        input_["skip_health_validation"] = skip_health_validation
    if plugins is not None:
        input_["plugins"] = plugins
    if worker_configuration is not None:
        input_["worker_configuration"] = worker_configuration
    if use_default_worker_configuration is not None:
        input_["use_default_worker_configuration"] = (
            use_default_worker_configuration
        )

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