SSM / Client / update_maintenance_window

update_maintenance_window#

SSM.Client.update_maintenance_window(**kwargs)#

Updates an existing maintenance window. Only specified parameters are modified.

Note

The value you specify for Duration determines the specific end time for the maintenance window based on the time it begins. No maintenance window tasks are permitted to start after the resulting endtime minus the number of hours you specify for Cutoff. For example, if the maintenance window starts at 3 PM, the duration is three hours, and the value you specify for Cutoff is one hour, no maintenance window tasks can start after 5 PM.

See also: AWS API Documentation

Request Syntax

response = client.update_maintenance_window(
    WindowId='string',
    Name='string',
    Description='string',
    StartDate='string',
    EndDate='string',
    Schedule='string',
    ScheduleTimezone='string',
    ScheduleOffset=123,
    Duration=123,
    Cutoff=123,
    AllowUnassociatedTargets=True|False,
    Enabled=True|False,
    Replace=True|False
)
Parameters:
  • WindowId (string) –

    [REQUIRED]

    The ID of the maintenance window to update.

  • Name (string) – The name of the maintenance window.

  • Description (string) – An optional description for the update request.

  • StartDate (string) – The date and time, in ISO-8601 Extended format, for when you want the maintenance window to become active. StartDate allows you to delay activation of the maintenance window until the specified future date.

  • EndDate (string) – The date and time, in ISO-8601 Extended format, for when you want the maintenance window to become inactive. EndDate allows you to set a date and time in the future when the maintenance window will no longer run.

  • Schedule (string) – The schedule of the maintenance window in the form of a cron or rate expression.

  • ScheduleTimezone (string) – The time zone that the scheduled maintenance window executions are based on, in Internet Assigned Numbers Authority (IANA) format. For example: “America/Los_Angeles”, “UTC”, or “Asia/Seoul”. For more information, see the Time Zone Database on the IANA website.

  • ScheduleOffset (integer) –

    The number of days to wait after the date and time specified by a cron expression before running the maintenance window.

    For example, the following cron expression schedules a maintenance window to run the third Tuesday of every month at 11:30 PM.

    cron(30 23 ? * TUE#3 *)

    If the schedule offset is 2, the maintenance window won’t run until two days later.

  • Duration (integer) – The duration of the maintenance window in hours.

  • Cutoff (integer) – The number of hours before the end of the maintenance window that Amazon Web Services Systems Manager stops scheduling new tasks for execution.

  • AllowUnassociatedTargets (boolean) – Whether targets must be registered with the maintenance window before tasks can be defined for those targets.

  • Enabled (boolean) – Whether the maintenance window is enabled.

  • Replace (boolean) – If True, then all fields that are required by the CreateMaintenanceWindow operation are also required for this API request. Optional fields that aren’t specified are set to null.

Return type:

dict

Returns:

Response Syntax

{
    'WindowId': 'string',
    'Name': 'string',
    'Description': 'string',
    'StartDate': 'string',
    'EndDate': 'string',
    'Schedule': 'string',
    'ScheduleTimezone': 'string',
    'ScheduleOffset': 123,
    'Duration': 123,
    'Cutoff': 123,
    'AllowUnassociatedTargets': True|False,
    'Enabled': True|False
}

Response Structure

  • (dict) –

    • WindowId (string) –

      The ID of the created maintenance window.

    • Name (string) –

      The name of the maintenance window.

    • Description (string) –

      An optional description of the update.

    • StartDate (string) –

      The date and time, in ISO-8601 Extended format, for when the maintenance window is scheduled to become active. The maintenance window won’t run before this specified time.

    • EndDate (string) –

      The date and time, in ISO-8601 Extended format, for when the maintenance window is scheduled to become inactive. The maintenance window won’t run after this specified time.

    • Schedule (string) –

      The schedule of the maintenance window in the form of a cron or rate expression.

    • ScheduleTimezone (string) –

      The time zone that the scheduled maintenance window executions are based on, in Internet Assigned Numbers Authority (IANA) format. For example: “America/Los_Angeles”, “UTC”, or “Asia/Seoul”. For more information, see the Time Zone Database on the IANA website.

    • ScheduleOffset (integer) –

      The number of days to wait to run a maintenance window after the scheduled cron expression date and time.

    • Duration (integer) –

      The duration of the maintenance window in hours.

    • Cutoff (integer) –

      The number of hours before the end of the maintenance window that Amazon Web Services Systems Manager stops scheduling new tasks for execution.

    • AllowUnassociatedTargets (boolean) –

      Whether targets must be registered with the maintenance window before tasks can be defined for those targets.

    • Enabled (boolean) –

      Whether the maintenance window is enabled.

Exceptions

  • SSM.Client.exceptions.DoesNotExistException

  • SSM.Client.exceptions.InternalServerError