Skip to content

describe_maintenance_window_tasks

describe_maintenance_window_tasks(
    window_id: MaintenanceWindowId,
    *,
    config_overrides: Optional[SSMClientConfig] = None,
    filters: Optional[MaintenanceWindowFilterList] = None,
    max_results: Optional[MaintenanceWindowMaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> DescribeMaintenanceWindowTasksResult

Lists the tasks in a maintenance window.

For maintenance window tasks without a specified target, you can't supply values for --max-errors and --max-concurrency. Instead, the system inserts a placeholder value of 1, which may be reported in the response to this command. These values don't affect the running of your task and can be ignored.

Parameters:

  • window_id (MaintenanceWindowId) –

    The ID of the maintenance window whose tasks should be retrieved.

  • filters (Optional[MaintenanceWindowFilterList], default: None ) –

    Optional filters used to narrow down the scope of the returned tasks. The supported filter keys are WindowTaskId, TaskArn, Priority, and TaskType.

  • max_results (Optional[MaintenanceWindowMaxResults], default: None ) –

    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.

  • next_token (Optional[NextToken], default: None ) –

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

Raises:

  • DoesNotExistException –

    Error returned when the ID specified for a resource, such as a maintenance window or patch baseline, doesn't exist.

    For information about resource quotas in Amazon Web Services Systems Manager, see Systems Manager service quotas in the Amazon Web Services General Reference.

  • InternalServerError –

    An error occurred on the server side.

  • UnknownServiceError –

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

Source code in docs_src/capo_ssm/_services/ssm.py
def describe_maintenance_window_tasks(
    self,
    window_id: "capo_ssm.types.maintenance_window_id.MaintenanceWindowId",
    *,
    config_overrides: Optional[SSMClientConfig] = None,
    filters: Optional[
        "capo_ssm.types.maintenance_window_filter_list.MaintenanceWindowFilterList"
    ] = None,
    max_results: Optional[
        "capo_ssm.types.maintenance_window_max_results.MaintenanceWindowMaxResults"
    ] = None,
    next_token: Optional["capo_ssm.types.next_token.NextToken"] = None,
) -> "capo_ssm.types.describe_maintenance_window_tasks_result.DescribeMaintenanceWindowTasksResult":
    """<p>Lists the tasks in a maintenance window.</p> <note> <p>For maintenance window tasks without a specified target, you can't supply values for <code>--max-errors</code> and <code>--max-concurrency</code>. Instead, the system inserts a placeholder value of <code>1</code>, which may be reported in the response to this command. These values don't affect the running of your task and can be ignored.</p> </note>

    Args:
        window_id: <p>The ID of the maintenance window whose tasks should be retrieved.</p>
        filters: <p>Optional filters used to narrow down the scope of the returned tasks. The supported filter keys are <code>WindowTaskId</code>, <code>TaskArn</code>, <code>Priority</code>, and <code>TaskType</code>.</p>
        max_results: <p>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.</p>
        next_token: <p>The token for the next set of items to return. (You received this token from a previous call.)</p>

    Raises:
        capo_ssm.errors.does_not_exist_exception.DoesNotExistException: <p>Error returned when the ID specified for a resource, such as a maintenance window or patch baseline, doesn't exist.</p> <p>For information about resource quotas in Amazon Web Services Systems Manager, see <a href="https://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm">Systems Manager service quotas</a> in the <i>Amazon Web Services General Reference</i>.</p>
        capo_ssm.errors.internal_server_error.InternalServerError: <p>An error occurred on the server side.</p>
        capo_ssm.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_ssm.types.describe_maintenance_window_tasks_request.DescribeMaintenanceWindowTasksRequest]",
    ) -> OperationResponse[
        "capo_ssm.types.describe_maintenance_window_tasks_result.DescribeMaintenanceWindowTasksResult"
    ]:
        import capo_ssm._operations.amazon_ssm.describe_maintenance_window_tasks

        output, http_response = (
            capo_ssm._operations.amazon_ssm.describe_maintenance_window_tasks.describe_maintenance_window_tasks(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_ssm.types.describe_maintenance_window_tasks_result.DescribeMaintenanceWindowTasksResult",
    ) -> dict[str, Any]:
        import capo_ssm.types.describe_maintenance_window_tasks_result

        return capo_ssm.types.describe_maintenance_window_tasks_result.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "DescribeMaintenanceWindowTasks", redact_output=_redact_output
        ),
    )
    input_: capo_ssm.types.describe_maintenance_window_tasks_request.DescribeMaintenanceWindowTasksRequest = {
        "window_id": window_id
    }
    if filters is not None:
        input_["filters"] = filters
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output