describeMaintenanceWindowExecutions method

Future<DescribeMaintenanceWindowExecutionsResult> describeMaintenanceWindowExecutions({
  1. required String windowId,
  2. List<MaintenanceWindowFilter>? filters,
  3. int? maxResults,
  4. String? nextToken,
})

Lists the executions of a maintenance window. This includes information about when the maintenance window was scheduled to be active, and information about tasks registered and run with the maintenance window.

May throw InternalServerError.

Parameter windowId : The ID of the maintenance window whose executions should be retrieved.

Parameter filters : Each entry in the array is a structure containing:

  • Key. A string between 1 and 128 characters. Supported keys include ExecutedBefore and ExecutedAfter.
  • Values. An array of strings, each between 1 and 256 characters. Supported values are date/time strings in a valid ISO 8601 date/time format, such as 2024-11-04T05:00:00Z.

Parameter maxResults : 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.

Parameter nextToken : The token for the next set of items to return. (You received this token from a previous call.)

Implementation

Future<DescribeMaintenanceWindowExecutionsResult>
    describeMaintenanceWindowExecutions({
  required String windowId,
  List<MaintenanceWindowFilter>? filters,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    10,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonSSM.DescribeMaintenanceWindowExecutions'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'WindowId': windowId,
      if (filters != null) 'Filters': filters,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return DescribeMaintenanceWindowExecutionsResult.fromJson(
      jsonResponse.body);
}