Skip to content

update_resource_target async

update_resource_target(
    arn: ResourceTargetArn,
    *,
    config_overrides: Optional[AsyncBackupExternalClientConfig] = None,
    name: Optional[ResourceName] = None,
    target_configuration: Optional[ResourceTargetConfiguration] = None,
    target_configuration_source: Optional[ResourceTargetConfigurationSource] = None,
) -> UpdateResourceTargetOutput

Updates the name or backup configuration of the specified resource target.

Parameters:

Raises:

Source code in docs_src/capo_backup_external/_services/async_backup_external.py
async def update_resource_target(
    self,
    arn: "capo_backup_external.types.resource_target_arn.ResourceTargetArn",
    *,
    config_overrides: Optional[AsyncBackupExternalClientConfig] = None,
    name: Optional["capo_backup_external.types.resource_name.ResourceName"] = None,
    target_configuration: Optional[
        "capo_backup_external.types.resource_target_configuration.ResourceTargetConfiguration"
    ] = None,
    target_configuration_source: Optional[
        "capo_backup_external.types.resource_target_configuration_source.ResourceTargetConfigurationSource"
    ] = None,
) -> "capo_backup_external.types.update_resource_target_output.UpdateResourceTargetOutput":
    """Updates the name or backup configuration of the specified resource target.

    Args:
        arn: The Amazon Resource Name (ARN) of the resource target.
        name: The name of the resource target.
        target_configuration: The backup configuration for the resource target.
        target_configuration_source: The source of the resource target's backup configuration.

    Raises:
        capo_backup_external.errors.access_denied_exception.AccessDeniedException: The request was denied because you do not have permission to perform the requested operation.
        capo_backup_external.errors.conflict_exception.ConflictException: The request conflicts with the current state of the specified resource.
        capo_backup_external.errors.internal_server_exception.InternalServerException: The request failed because of an internal server error.
        capo_backup_external.errors.resource_not_found_exception.ResourceNotFoundException: The specified resource was not found.
        capo_backup_external.errors.throttling_exception.ThrottlingException: The request was denied because the request rate is too high.
        capo_backup_external.errors.validation_exception.ValidationException: The request contains invalid parameters.
        capo_backup_external.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_backup_external.types.update_resource_target_input.UpdateResourceTargetInput]",
    ) -> AsyncOperationResponse[
        "capo_backup_external.types.update_resource_target_output.UpdateResourceTargetOutput"
    ]:
        import capo_backup_external._operations.backup_external.update_resource_target

        (
            output,
            http_response,
        ) = await capo_backup_external._operations.backup_external.update_resource_target.async_update_resource_target(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_backup_external.types.update_resource_target_input.UpdateResourceTargetInput",
    ) -> dict[str, Any]:
        import capo_backup_external.types.update_resource_target_input

        return capo_backup_external.types.update_resource_target_input.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("UpdateResourceTarget", redact_input=_redact_input),
    )
    input_: capo_backup_external.types.update_resource_target_input.UpdateResourceTargetInput = {
        "arn": arn
    }
    if name is not None:
        input_["name"] = name
    if target_configuration is not None:
        input_["target_configuration"] = target_configuration
    if target_configuration_source is not None:
        input_["target_configuration_source"] = target_configuration_source

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