Skip to content

list_system_events async

list_system_events(
    system_arn: Arn,
    *,
    config_overrides: Optional[Asyncresiliencehubv2ClientConfig] = None,
    event_types: Optional[SystemEventTypeList] = None,
    start_time: Optional[datetime] = None,
    end_time: Optional[datetime] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> ListSystemEventsResponse

Lists events for a system.

Parameters:

Raises:

Source code in docs_src/capo_resiliencehubv2/_services/async_resiliencehubv2.py
async def list_system_events(
    self,
    system_arn: "capo_resiliencehubv2.types.arn.Arn",
    *,
    config_overrides: Optional[Asyncresiliencehubv2ClientConfig] = None,
    event_types: Optional[
        "capo_resiliencehubv2.types.system_event_type_list.SystemEventTypeList"
    ] = None,
    start_time: Optional[datetime.datetime] = None,
    end_time: Optional[datetime.datetime] = None,
    max_results: Optional[
        "capo_resiliencehubv2.types.max_results.MaxResults"
    ] = None,
    next_token: Optional["capo_resiliencehubv2.types.next_token.NextToken"] = None,
) -> "capo_resiliencehubv2.types.list_system_events_response.ListSystemEventsResponse":
    """<p>Lists events for a system.</p>

    Args:
        event_types: <p>The type of events to include in the results.</p>
        start_time: <p>The start time for filtering events.</p>
        end_time: <p>The end time for filtering events.</p>

    Raises:
        capo_resiliencehubv2.errors.access_denied_exception.AccessDeniedException: <p>Access denied — caller lacks required permissions.</p>
        capo_resiliencehubv2.errors.internal_server_exception.InternalServerException: <p>Internal service error.</p>
        capo_resiliencehubv2.errors.resource_not_found_exception.ResourceNotFoundException: <p>Resource not found.</p>
        capo_resiliencehubv2.errors.validation_exception.ValidationException: <p>Validation error — invalid input parameters.</p>
        capo_resiliencehubv2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_resiliencehubv2.types.list_system_events_request.ListSystemEventsRequest]",
    ) -> AsyncOperationResponse[
        "capo_resiliencehubv2.types.list_system_events_response.ListSystemEventsResponse"
    ]:
        import capo_resiliencehubv2._operations.ngrh_service_core.list_system_events

        (
            output,
            http_response,
        ) = await capo_resiliencehubv2._operations.ngrh_service_core.list_system_events.async_list_system_events(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListSystemEvents")
    )
    input_: capo_resiliencehubv2.types.list_system_events_request.ListSystemEventsRequest = {
        "system_arn": system_arn
    }
    if event_types is not None:
        input_["event_types"] = event_types
    if start_time is not None:
        input_["start_time"] = start_time
    if end_time is not None:
        input_["end_time"] = end_time
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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