2018/10/09 - Amazon Simple Systems Manager (SSM) - 3 new 4 updated api methods
Changes Adds StartDate, EndDate, and ScheduleTimezone to CreateMaintenanceWindow and UpdateMaintenanceWindow; Adds NextExecutionTime to GetMaintenanceWindow and DescribeMaintenanceWindows; Adds CancelMaintenanceWindowExecution, DescribeMaintenanceWindowSchedule and DescribeMaintenanceWindowsForTarget APIs.
Retrieves information about upcoming executions of a Maintenance Window.
See also: AWS API Documentation
Request Syntax
client.describe_maintenance_window_schedule( WindowId='string', Targets=[ { 'Key': 'string', 'Values': [ 'string', ] }, ], ResourceType='INSTANCE', Filters=[ { 'Key': 'string', 'Values': [ 'string', ] }, ], MaxResults=123, NextToken='string' )
string
The ID of the Maintenance Window to retrieve information about.
list
The instance ID or key/value pair to retrieve information about.
(dict) --
An array of search criteria that targets instances using a Key,Value combination that you specify. Targets is required if you don't provide one or more instance IDs in the call.
Key (string) --
User-defined criteria for sending commands that target instances that meet the criteria. Key can be tag:<Amazon EC2 tag> or InstanceIds. For more information about how to send commands that target instances using Key,Value parameters, see Targeting Multiple Instances in the AWS Systems Manager User Guide .
Values (list) --
User-defined criteria that maps to Key. For example, if you specified tag:ServerRole, you could specify value:WebServer to execute a command on instances that include Amazon EC2 tags of ServerRole,WebServer. For more information about how to send commands that target instances using Key,Value parameters, see Sending Commands to a Fleet in the AWS Systems Manager User Guide .
(string) --
string
The type of resource you want to retrieve information about. For example, "INSTANCE".
list
Filters used to limit the range of results. For example, you can limit Maintenance Window executions to only those scheduled before or after a certain date and time.
(dict) --
Defines a filter used in Patch Manager APIs.
Key (string) --
The key for the filter.
Values (list) --
The value for the filter.
(string) --
integer
The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.
string
The token for the next set of items to return. (You received this token from a previous call.)
dict
Response Syntax
{ 'ScheduledWindowExecutions': [ { 'WindowId': 'string', 'Name': 'string', 'ExecutionTime': 'string' }, ], 'NextToken': 'string' }
Response Structure
(dict) --
ScheduledWindowExecutions (list) --
Information about Maintenance Window executions scheduled for the specified time range.
(dict) --
Information about a scheduled execution for a Maintenance Window.
WindowId (string) --
The ID of the Maintenance Window to be run.
Name (string) --
The name of the Maintenance Window to be run.
ExecutionTime (string) --
The time, in ISO-8601 Extended format, that the Maintenance Window is scheduled to be run.
NextToken (string) --
The token for the next set of items to return. (You use this token in the next call.)
Retrieves information about the Maintenance Windows targets or tasks that an instance is associated with.
See also: AWS API Documentation
Request Syntax
client.describe_maintenance_windows_for_target( Targets=[ { 'Key': 'string', 'Values': [ 'string', ] }, ], ResourceType='INSTANCE', MaxResults=123, NextToken='string' )
list
[REQUIRED]
The instance ID or key/value pair to retrieve information about.
(dict) --
An array of search criteria that targets instances using a Key,Value combination that you specify. Targets is required if you don't provide one or more instance IDs in the call.
Key (string) --
User-defined criteria for sending commands that target instances that meet the criteria. Key can be tag:<Amazon EC2 tag> or InstanceIds. For more information about how to send commands that target instances using Key,Value parameters, see Targeting Multiple Instances in the AWS Systems Manager User Guide .
Values (list) --
User-defined criteria that maps to Key. For example, if you specified tag:ServerRole, you could specify value:WebServer to execute a command on instances that include Amazon EC2 tags of ServerRole,WebServer. For more information about how to send commands that target instances using Key,Value parameters, see Sending Commands to a Fleet in the AWS Systems Manager User Guide .
(string) --
string
[REQUIRED]
The type of resource you want to retrieve information about. For example, "INSTANCE".
integer
The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.
string
The token for the next set of items to return. (You received this token from a previous call.)
dict
Response Syntax
{ 'WindowIdentities': [ { 'WindowId': 'string', 'Name': 'string' }, ], 'NextToken': 'string' }
Response Structure
(dict) --
WindowIdentities (list) --
Information about the Maintenance Window targets and tasks an instance is associated with.
(dict) --
The Maintenance Window to which the specified target belongs.
WindowId (string) --
The ID of the Maintenance Window.
Name (string) --
The name of the Maintenance Window.
NextToken (string) --
The token for the next set of items to return. (You use this token in the next call.)
Stops a Maintenance Window execution that is already in progress and cancels any tasks in the window that have not already starting running. (Tasks already in progress will continue to completion.)
See also: AWS API Documentation
Request Syntax
client.cancel_maintenance_window_execution( WindowExecutionId='string' )
string
[REQUIRED]
The ID of the Maintenance Window execution to stop.
dict
Response Syntax
{ 'WindowExecutionId': 'string' }
Response Structure
(dict) --
WindowExecutionId (string) --
The ID of the Maintenance Window execution that has been stopped.
{'EndDate': 'string', 'ScheduleTimezone': 'string', 'StartDate': 'string'}
Creates a new Maintenance Window.
See also: AWS API Documentation
Request Syntax
client.create_maintenance_window( Name='string', Description='string', StartDate='string', EndDate='string', Schedule='string', ScheduleTimezone='string', Duration=123, Cutoff=123, AllowUnassociatedTargets=True|False, ClientToken='string' )
string
[REQUIRED]
The name of the Maintenance Window.
string
An optional description for the Maintenance Window. We recommend specifying a description to help you organize your Maintenance Windows.
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.
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.
string
[REQUIRED]
The schedule of the Maintenance Window in the form of a cron or rate expression.
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", "etc/UTC", or "Asia/Seoul". For more information, see the Time Zone Database on the IANA website.
integer
[REQUIRED]
The duration of the Maintenance Window in hours.
integer
[REQUIRED]
The number of hours before the end of the Maintenance Window that Systems Manager stops scheduling new tasks for execution.
boolean
[REQUIRED]
Enables a Maintenance Window task to execute on managed instances, even if you have not registered those instances as targets. If enabled, then you must specify the unregistered instances (by instance ID) when you register a task with the Maintenance Window
If you don't enable this option, then you must specify previously-registered targets when you register a task with the Maintenance Window.
string
User-provided idempotency token.
This field is autopopulated if not provided.
dict
Response Syntax
{ 'WindowId': 'string' }
Response Structure
(dict) --
WindowId (string) --
The ID of the created Maintenance Window.
{'WindowIdentities': {'EndDate': 'string', 'NextExecutionTime': 'string', 'Schedule': 'string', 'ScheduleTimezone': 'string', 'StartDate': 'string'}}
Retrieves the Maintenance Windows in an AWS account.
See also: AWS API Documentation
Request Syntax
client.describe_maintenance_windows( Filters=[ { 'Key': 'string', 'Values': [ 'string', ] }, ], MaxResults=123, NextToken='string' )
list
Optional filters used to narrow down the scope of the returned Maintenance Windows. Supported filter keys are Name and Enabled.
(dict) --
Filter used in the request. Supported filter keys are Name and Enabled.
Key (string) --
The name of the filter.
Values (list) --
The filter values.
(string) --
integer
The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.
string
The token for the next set of items to return. (You received this token from a previous call.)
dict
Response Syntax
{ 'WindowIdentities': [ { 'WindowId': 'string', 'Name': 'string', 'Description': 'string', 'Enabled': True|False, 'Duration': 123, 'Cutoff': 123, 'Schedule': 'string', 'ScheduleTimezone': 'string', 'EndDate': 'string', 'StartDate': 'string', 'NextExecutionTime': 'string' }, ], 'NextToken': 'string' }
Response Structure
(dict) --
WindowIdentities (list) --
Information about the Maintenance Windows.
(dict) --
Information about the Maintenance Window.
WindowId (string) --
The ID of the Maintenance Window.
Name (string) --
The name of the Maintenance Window.
Description (string) --
A description of the Maintenance Window.
Enabled (boolean) --
Whether the Maintenance Window is enabled.
Duration (integer) --
The duration of the Maintenance Window in hours.
Cutoff (integer) --
The number of hours before the end of the Maintenance Window that Systems Manager stops scheduling new tasks for execution.
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.
EndDate (string) --
The date and time, in ISO-8601 Extended format, for when the Maintenance Window is scheduled to become inactive.
StartDate (string) --
The date and time, in ISO-8601 Extended format, for when the Maintenance Window is scheduled to become active.
NextExecutionTime (string) --
The next time the Maintenance Window will actually run, taking into account any specified times for the Maintenance Window to become active or inactive.
NextToken (string) --
The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.
{'EndDate': 'string', 'NextExecutionTime': 'string', 'ScheduleTimezone': 'string', 'StartDate': 'string'}
Retrieves a Maintenance Window.
See also: AWS API Documentation
Request Syntax
client.get_maintenance_window( WindowId='string' )
string
[REQUIRED]
The ID of the desired Maintenance Window.
dict
Response Syntax
{ 'WindowId': 'string', 'Name': 'string', 'Description': 'string', 'StartDate': 'string', 'EndDate': 'string', 'Schedule': 'string', 'ScheduleTimezone': 'string', 'NextExecutionTime': 'string', 'Duration': 123, 'Cutoff': 123, 'AllowUnassociatedTargets': True|False, 'Enabled': True|False, 'CreatedDate': datetime(2015, 1, 1), 'ModifiedDate': datetime(2015, 1, 1) }
Response Structure
(dict) --
WindowId (string) --
The ID of the created Maintenance Window.
Name (string) --
The name of the Maintenance Window.
Description (string) --
The description of the Maintenance Window.
StartDate (string) --
The date and time, in ISO-8601 Extended format, for when the Maintenance Window is scheduled to become active. The Maintenance Window will not 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 will not 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", "etc/UTC", or "Asia/Seoul". For more information, see the Time Zone Database on the IANA website.
NextExecutionTime (string) --
The next time the Maintenance Window will actually run, taking into account any specified times for the Maintenance Window to become active or inactive.
Duration (integer) --
The duration of the Maintenance Window in hours.
Cutoff (integer) --
The number of hours before the end of the Maintenance Window that 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 Windows is enabled.
CreatedDate (datetime) --
The date the Maintenance Window was created.
ModifiedDate (datetime) --
The date the Maintenance Window was last modified.
{'EndDate': 'string', 'ScheduleTimezone': 'string', 'StartDate': 'string'}
Updates an existing Maintenance Window. Only specified parameters are modified.
See also: AWS API Documentation
Request Syntax
client.update_maintenance_window( WindowId='string', Name='string', Description='string', StartDate='string', EndDate='string', Schedule='string', ScheduleTimezone='string', Duration=123, Cutoff=123, AllowUnassociatedTargets=True|False, Enabled=True|False, Replace=True|False )
string
[REQUIRED]
The ID of the Maintenance Window to update.
string
The name of the Maintenance Window.
string
An optional description for the update request.
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", "etc/UTC", or "Asia/Seoul". For more information, see the Time Zone Database on the IANA website.
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.
string
The schedule of the Maintenance Window in the form of a cron or rate expression.
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", "etc/UTC", or "Asia/Seoul". For more information, see the Time Zone Database on the IANA website.
integer
The duration of the Maintenance Window in hours.
integer
The number of hours before the end of the Maintenance Window that Systems Manager stops scheduling new tasks for execution.
boolean
Whether targets must be registered with the Maintenance Window before tasks can be defined for those targets.
boolean
Whether the Maintenance Window is enabled.
boolean
If True, then all fields that are required by the CreateMaintenanceWindow action are also required for this API request. Optional fields that are not specified are set to null.
dict
Response Syntax
{ 'WindowId': 'string', 'Name': 'string', 'Description': 'string', 'StartDate': 'string', 'EndDate': 'string', 'Schedule': 'string', 'ScheduleTimezone': 'string', '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 will not 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 will not 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", "etc/UTC", or "Asia/Seoul". For more information, see the Time Zone Database on the IANA website.
Duration (integer) --
The duration of the Maintenance Window in hours.
Cutoff (integer) --
The number of hours before the end of the Maintenance Window that 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.