Skip to content

update_maintenance_start_time async

update_maintenance_start_time(
    gateway_arn: GatewayARN,
    *,
    config_overrides: Optional[AsyncStorageGatewayClientConfig] = None,
    hour_of_day: Optional[HourOfDay] = None,
    minute_of_hour: Optional[MinuteOfHour] = None,
    day_of_week: Optional[DayOfWeek] = None,
    day_of_month: Optional[DayOfMonth] = None,
    software_update_preferences: Optional[SoftwareUpdatePreferences] = None,
) -> UpdateMaintenanceStartTimeOutput

Updates a gateway's maintenance window schedule, with settings for monthly or weekly cadence, specific day and time to begin maintenance, and which types of updates to apply. Time configuration uses the gateway's time zone. You can pass values for a complete maintenance schedule, or update policy, or both. Previous values will persist for whichever setting you choose not to modify. If an incomplete or invalid maintenance schedule is passed, the entire request will be rejected with an error and no changes will occur.

A complete maintenance schedule must include values for both MinuteOfHour and HourOfDay, and either DayOfMonth or DayOfWeek.

We recommend keeping maintenance updates turned on, except in specific use cases where the brief disruptions caused by updating the gateway could critically impact your deployment.

Parameters:

  • hour_of_day (Optional[HourOfDay], default: None ) –

    The hour component of the maintenance start time represented as hh, where hh is the hour (00 to 23). The hour of the day is in the time zone of the gateway.

  • minute_of_hour (Optional[MinuteOfHour], default: None ) –

    The minute component of the maintenance start time represented as mm, where mm is the minute (00 to 59). The minute of the hour is in the time zone of the gateway.

  • day_of_week (Optional[DayOfWeek], default: None ) –

    The day of the week component of the maintenance start time week represented as an ordinal number from 0 to 6, where 0 represents Sunday and 6 represents Saturday.

  • day_of_month (Optional[DayOfMonth], default: None ) –

    The day of the month component of the maintenance start time represented as an ordinal number from 1 to 28, where 1 represents the first day of the month. It is not possible to set the maintenance schedule to start on days 29 through 31.

  • software_update_preferences (Optional[SoftwareUpdatePreferences], default: None ) –

    A set of variables indicating the software update preferences for the gateway.

    Includes AutomaticUpdatePolicy field with the following inputs:

    ALL_VERSIONS - Enables regular gateway maintenance updates.

    EMERGENCY_VERSIONS_ONLY - Disables regular gateway maintenance updates. The gateway will still receive emergency version updates on rare occasions if necessary to remedy highly critical security or durability issues. You will be notified before an emergency version update is applied. These updates are applied during your gateway's scheduled maintenance window.

Raises:

  • InternalServerError –

    An internal server error has occurred during the request. For more information, see the error and message fields.

  • InvalidGatewayRequestException –

    An exception occurred because an invalid gateway request was issued to the service. For more information, see the error and message fields.

  • UnknownServiceError –

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

Examples:

To update a gateway's maintenance start time Updates a gateway's weekly maintenance start time information, including day and time of the week. The maintenance time is in your gateway's time zone.

>>> await client.update_maintenance_start_time(gateway_arn='arn:aws:storagegateway:us-east-1:111122223333:gateway/sgw-12A3456B', hour_of_day=0, minute_of_hour=30, day_of_week=2)
Source code in docs_src/capo_storage_gateway/_services/async_storage_gateway.py
async def update_maintenance_start_time(
    self,
    gateway_arn: "capo_storage_gateway.types.gateway_arn.GatewayARN",
    *,
    config_overrides: Optional[AsyncStorageGatewayClientConfig] = None,
    hour_of_day: Optional[
        "capo_storage_gateway.types.hour_of_day.HourOfDay"
    ] = None,
    minute_of_hour: Optional[
        "capo_storage_gateway.types.minute_of_hour.MinuteOfHour"
    ] = None,
    day_of_week: Optional[
        "capo_storage_gateway.types.day_of_week.DayOfWeek"
    ] = None,
    day_of_month: Optional[
        "capo_storage_gateway.types.day_of_month.DayOfMonth"
    ] = None,
    software_update_preferences: Optional[
        "capo_storage_gateway.types.software_update_preferences.SoftwareUpdatePreferences"
    ] = None,
) -> "capo_storage_gateway.types.update_maintenance_start_time_output.UpdateMaintenanceStartTimeOutput":
    """<p>Updates a gateway's maintenance window schedule, with settings for monthly or weekly cadence, specific day and time to begin maintenance, and which types of updates to apply. Time configuration uses the gateway's time zone. You can pass values for a complete maintenance schedule, or update policy, or both. Previous values will persist for whichever setting you choose not to modify. If an incomplete or invalid maintenance schedule is passed, the entire request will be rejected with an error and no changes will occur.</p> <p>A complete maintenance schedule must include values for <i>both</i> <code>MinuteOfHour</code> and <code>HourOfDay</code>, and <i>either</i> <code>DayOfMonth</code> <i>or</i> <code>DayOfWeek</code>.</p> <note> <p>We recommend keeping maintenance updates turned on, except in specific use cases where the brief disruptions caused by updating the gateway could critically impact your deployment.</p> </note>

    Args:
        hour_of_day: <p>The hour component of the maintenance start time represented as <i>hh</i>, where <i>hh</i> is the hour (00 to 23). The hour of the day is in the time zone of the gateway.</p>
        minute_of_hour: <p>The minute component of the maintenance start time represented as <i>mm</i>, where <i>mm</i> is the minute (00 to 59). The minute of the hour is in the time zone of the gateway.</p>
        day_of_week: <p>The day of the week component of the maintenance start time week represented as an ordinal number from 0 to 6, where 0 represents Sunday and 6 represents Saturday.</p>
        day_of_month: <p>The day of the month component of the maintenance start time represented as an ordinal number from 1 to 28, where 1 represents the first day of the month. It is not possible to set the maintenance schedule to start on days 29 through 31.</p>
        software_update_preferences: <p>A set of variables indicating the software update preferences for the gateway.</p> <p>Includes <code>AutomaticUpdatePolicy</code> field with the following inputs:</p> <p> <code>ALL_VERSIONS</code> - Enables regular gateway maintenance updates.</p> <p> <code>EMERGENCY_VERSIONS_ONLY</code> - Disables regular gateway maintenance updates. The gateway will still receive emergency version updates on rare occasions if necessary to remedy highly critical security or durability issues. You will be notified before an emergency version update is applied. These updates are applied during your gateway's scheduled maintenance window.</p>

    Raises:
        capo_storage_gateway.errors.internal_server_error.InternalServerError: <p>An internal server error has occurred during the request. For more information, see the error and message fields.</p>
        capo_storage_gateway.errors.invalid_gateway_request_exception.InvalidGatewayRequestException: <p>An exception occurred because an invalid gateway request was issued to the service. For more information, see the error and message fields.</p>
        capo_storage_gateway.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To update a gateway's maintenance start time
        Updates a gateway's weekly maintenance start time information, including day and time of the week. The maintenance time is in your gateway's time zone.

        >>> await client.update_maintenance_start_time(gateway_arn='arn:aws:storagegateway:us-east-1:111122223333:gateway/sgw-12A3456B', hour_of_day=0, minute_of_hour=30, day_of_week=2)
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_storage_gateway.types.update_maintenance_start_time_input.UpdateMaintenanceStartTimeInput]",
    ) -> AsyncOperationResponse[
        "capo_storage_gateway.types.update_maintenance_start_time_output.UpdateMaintenanceStartTimeOutput"
    ]:
        import capo_storage_gateway._operations.storage_gateway_20130630.update_maintenance_start_time

        (
            output,
            http_response,
        ) = await capo_storage_gateway._operations.storage_gateway_20130630.update_maintenance_start_time.async_update_maintenance_start_time(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateMaintenanceStartTime")
    )
    input_: capo_storage_gateway.types.update_maintenance_start_time_input.UpdateMaintenanceStartTimeInput = {
        "gateway_arn": gateway_arn
    }
    if hour_of_day is not None:
        input_["hour_of_day"] = hour_of_day
    if minute_of_hour is not None:
        input_["minute_of_hour"] = minute_of_hour
    if day_of_week is not None:
        input_["day_of_week"] = day_of_week
    if day_of_month is not None:
        input_["day_of_month"] = day_of_month
    if software_update_preferences is not None:
        input_["software_update_preferences"] = software_update_preferences

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