Skip to content

put_agent_upgrade_settings async

put_agent_upgrade_settings(
    appliance_arn: ApplianceArn,
    enable_auto_upgrade: bool,
    *,
    config_overrides: Optional[AsyncBackupExternalClientConfig] = None,
    start_hour_utc: Optional[HourOfDayUtc] = None,
    end_hour_utc: Optional[HourOfDayUtc] = None,
) -> PutAgentUpgradeSettingsOutput

Configures per-appliance daily auto-upgrade settings. When EnableAutoUpgrade is true, StartHourUtc and EndHourUtc are required and define the daily UTC window during which the appliance may be upgraded automatically. The upgrade fires once daily at a random time within the configured window. Validation rules: - If EnableAutoUpgrade=true, StartHourUtc and EndHourUtc MUST both be provided. - If EnableAutoUpgrade=false, StartHourUtc and EndHourUtc are ignored. - Wrap-around is supported (e.g., StartHourUtc=22, EndHourUtc=4 means 10pm-4am UTC). - Window must be ≥1 hour (StartHourUtc != EndHourUtc).

Parameters:

  • appliance_arn (ApplianceArn) –

    The Amazon Resource Name (ARN) of the appliance.

  • enable_auto_upgrade (bool) –

    Specifies whether automatic agent upgrades are enabled for the appliance.

Raises:

Source code in docs_src/capo_backup_external/_services/async_backup_external.py
async def put_agent_upgrade_settings(
    self,
    appliance_arn: "capo_backup_external.types.appliance_arn.ApplianceArn",
    enable_auto_upgrade: bool,
    *,
    config_overrides: Optional[AsyncBackupExternalClientConfig] = None,
    start_hour_utc: Optional[
        "capo_backup_external.types.hour_of_day_utc.HourOfDayUtc"
    ] = None,
    end_hour_utc: Optional[
        "capo_backup_external.types.hour_of_day_utc.HourOfDayUtc"
    ] = None,
) -> "capo_backup_external.types.put_agent_upgrade_settings_output.PutAgentUpgradeSettingsOutput":
    """Configures per-appliance daily auto-upgrade settings. When `EnableAutoUpgrade` is true, `StartHourUtc` and `EndHourUtc` are required and define the daily UTC window during which the appliance may be upgraded automatically. The upgrade fires once daily at a random time within the configured window. Validation rules: - If EnableAutoUpgrade=true, StartHourUtc and EndHourUtc MUST both be provided. - If EnableAutoUpgrade=false, StartHourUtc and EndHourUtc are ignored. - Wrap-around is supported (e.g., StartHourUtc=22, EndHourUtc=4 means 10pm-4am UTC). - Window must be ≥1 hour (StartHourUtc != EndHourUtc).

    Args:
        appliance_arn: The Amazon Resource Name (ARN) of the appliance.
        enable_auto_upgrade: Specifies whether automatic agent upgrades are enabled for the appliance.

    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.put_agent_upgrade_settings_input.PutAgentUpgradeSettingsInput]",
    ) -> AsyncOperationResponse[
        "capo_backup_external.types.put_agent_upgrade_settings_output.PutAgentUpgradeSettingsOutput"
    ]:
        import capo_backup_external._operations.backup_external.put_agent_upgrade_settings

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutAgentUpgradeSettings")
    )
    input_: capo_backup_external.types.put_agent_upgrade_settings_input.PutAgentUpgradeSettingsInput = {
        "appliance_arn": appliance_arn,
        "enable_auto_upgrade": enable_auto_upgrade,
    }
    if start_hour_utc is not None:
        input_["start_hour_utc"] = start_hour_utc
    if end_hour_utc is not None:
        input_["end_hour_utc"] = end_hour_utc

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