Skip to content

describe_maintenance_windows

describe_maintenance_windows(
    *,
    config_overrides: Optional[SSMClientConfig] = None,
    filters: Optional[MaintenanceWindowFilterList] = None,
    max_results: Optional[MaintenanceWindowMaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> DescribeMaintenanceWindowsResult

Retrieves the maintenance windows in an Amazon Web Services account.

Parameters:

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

    Optional filters used to narrow down the scope of the returned maintenance windows. Supported filter keys are Name and Enabled. For example, Name=MyMaintenanceWindow and Enabled=True.

  • 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:

Source code in docs_src/capo_ssm/_services/ssm.py
def describe_maintenance_windows(
    self,
    *,
    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_windows_result.DescribeMaintenanceWindowsResult":
    """<p>Retrieves the maintenance windows in an Amazon Web Services account.</p>

    Args:
        filters: <p>Optional filters used to narrow down the scope of the returned maintenance windows. Supported filter keys are <code>Name</code> and <code>Enabled</code>. For example, <code>Name=MyMaintenanceWindow</code> and <code>Enabled=True</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.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_windows_request.DescribeMaintenanceWindowsRequest]",
    ) -> OperationResponse[
        "capo_ssm.types.describe_maintenance_windows_result.DescribeMaintenanceWindowsResult"
    ]:
        import capo_ssm._operations.amazon_ssm.describe_maintenance_windows

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

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

        return capo_ssm.types.describe_maintenance_windows_result.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "DescribeMaintenanceWindows", redact_output=_redact_output
        ),
    )
    input_: capo_ssm.types.describe_maintenance_windows_request.DescribeMaintenanceWindowsRequest = {}
    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