Skip to content

list_health_events async

list_health_events(
    monitor_name: ResourceName,
    *,
    config_overrides: Optional[AsyncInternetMonitorClientConfig] = None,
    start_time: Optional[datetime] = None,
    end_time: Optional[datetime] = None,
    next_token: Optional[str] = None,
    max_results: Optional[MaxResults] = None,
    event_status: Optional[HealthEventStatus] = None,
    linked_account_id: Optional[AccountId] = None,
) -> ListHealthEventsOutput

Lists all health events for a monitor in Amazon CloudWatch Internet Monitor. Returns information for health events including the event start and end times, and the status.

Health events that have start times during the time frame that is requested are not included in the list of health events.

Parameters:

  • monitor_name (ResourceName) –

    The name of the monitor.

  • start_time (Optional[datetime], default: None ) –

    The time when a health event started.

  • end_time (Optional[datetime], default: None ) –

    The time when a health event ended. If the health event is still ongoing, then the end time is not set.

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

    The token for the next set of results. You receive this token from a previous call.

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

    The number of health event objects that you want to return with this call.

  • event_status (Optional[HealthEventStatus], default: None ) –

    The status of a health event.

  • linked_account_id (Optional[AccountId], default: None ) –

    The account ID for an account that you've set up cross-account sharing for in Amazon CloudWatch Internet Monitor. You configure cross-account sharing by using Amazon CloudWatch Observability Access Manager. For more information, see Internet Monitor cross-account observability in the Amazon CloudWatch Internet Monitor User Guide.

Raises:

Source code in docs_src/capo_internetmonitor/_services/async_internet_monitor.py
async def list_health_events(
    self,
    monitor_name: "capo_internetmonitor.types.resource_name.ResourceName",
    *,
    config_overrides: Optional[AsyncInternetMonitorClientConfig] = None,
    start_time: Optional[datetime.datetime] = None,
    end_time: Optional[datetime.datetime] = None,
    next_token: Optional[str] = None,
    max_results: Optional[
        "capo_internetmonitor.types.max_results.MaxResults"
    ] = None,
    event_status: Optional[
        "capo_internetmonitor.types.health_event_status.HealthEventStatus"
    ] = None,
    linked_account_id: Optional[
        "capo_internetmonitor.types.account_id.AccountId"
    ] = None,
) -> "capo_internetmonitor.types.list_health_events_output.ListHealthEventsOutput":
    """<p>Lists all health events for a monitor in Amazon CloudWatch Internet Monitor. Returns information for health events including the event start and end times, and the status.</p> <note> <p>Health events that have start times during the time frame that is requested are not included in the list of health events.</p> </note>

    Args:
        monitor_name: <p>The name of the monitor.</p>
        start_time: <p>The time when a health event started.</p>
        end_time: <p>The time when a health event ended. If the health event is still ongoing, then the end time is not set.</p>
        next_token: <p>The token for the next set of results. You receive this token from a previous call.</p>
        max_results: <p>The number of health event objects that you want to return with this call. </p>
        event_status: <p>The status of a health event.</p>
        linked_account_id: <p>The account ID for an account that you've set up cross-account sharing for in Amazon CloudWatch Internet Monitor. You configure cross-account sharing by using Amazon CloudWatch Observability Access Manager. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cwim-cross-account.html">Internet Monitor cross-account observability</a> in the Amazon CloudWatch Internet Monitor User Guide.</p>

    Raises:
        capo_internetmonitor.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient permission to perform this action.</p>
        capo_internetmonitor.errors.internal_server_exception.InternalServerException: <p>An internal error occurred.</p>
        capo_internetmonitor.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_internetmonitor.errors.validation_exception.ValidationException: <p>Invalid request.</p>
        capo_internetmonitor.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_internetmonitor.types.list_health_events_input.ListHealthEventsInput]",
    ) -> AsyncOperationResponse[
        "capo_internetmonitor.types.list_health_events_output.ListHealthEventsOutput"
    ]:
        import capo_internetmonitor._operations.internet_monitor20210603.list_health_events

        (
            output,
            http_response,
        ) = await capo_internetmonitor._operations.internet_monitor20210603.list_health_events.async_list_health_events(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListHealthEvents")
    )
    input_: capo_internetmonitor.types.list_health_events_input.ListHealthEventsInput = {
        "monitor_name": monitor_name
    }
    if start_time is not None:
        input_["start_time"] = start_time
    if end_time is not None:
        input_["end_time"] = end_time
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if event_status is not None:
        input_["event_status"] = event_status
    if linked_account_id is not None:
        input_["linked_account_id"] = linked_account_id

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output