Skip to content

list_test_run_source_events

list_test_run_source_events(
    test_run_id: TestRunId,
    service_arn: Arn,
    source_arn: TestRunSourceArn,
    *,
    config_overrides: Optional[resiliencehubv2ClientConfig] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> ListTestRunSourceEventsResponse

Lists the state-change events observed for a test run monitoring source. Events are returned for one source per call, in chronological order.

Parameters:

  • test_run_id (TestRunId) –

    The identifier of the test run to list source events for.

  • service_arn (Arn) –

    The ARN of the service the test run belongs to.

  • source_arn (TestRunSourceArn) –

    The ARN of the monitoring source to list events for, such as the ARN of a CloudWatch alarm. If the source was not monitored during the test run, the response is an empty list.

Raises:

Source code in docs_src/capo_resiliencehubv2/_services/resiliencehubv2.py
def list_test_run_source_events(
    self,
    test_run_id: "capo_resiliencehubv2.types.test_run_id.TestRunId",
    service_arn: "capo_resiliencehubv2.types.arn.Arn",
    source_arn: "capo_resiliencehubv2.types.test_run_source_arn.TestRunSourceArn",
    *,
    config_overrides: Optional[resiliencehubv2ClientConfig] = 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_test_run_source_events_response.ListTestRunSourceEventsResponse":
    """<p>Lists the state-change events observed for a test run monitoring source. Events are returned for one source per call, in chronological order.</p>

    Args:
        test_run_id: <p>The identifier of the test run to list source events for.</p>
        service_arn: <p>The ARN of the service the test run belongs to.</p>
        source_arn: <p>The ARN of the monitoring source to list events for, such as the ARN of a CloudWatch alarm. If the source was not monitored during the test run, the response is an empty list.</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.
    """

    def _handler(
        req: "OperationRequest[capo_resiliencehubv2.types.list_test_run_source_events_request.ListTestRunSourceEventsRequest]",
    ) -> OperationResponse[
        "capo_resiliencehubv2.types.list_test_run_source_events_response.ListTestRunSourceEventsResponse"
    ]:
        import capo_resiliencehubv2._operations.ngrh_service_core.list_test_run_source_events

        output, http_response = (
            capo_resiliencehubv2._operations.ngrh_service_core.list_test_run_source_events.list_test_run_source_events(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListTestRunSourceEvents")
    )
    input_: capo_resiliencehubv2.types.list_test_run_source_events_request.ListTestRunSourceEventsRequest = {
        "test_run_id": test_run_id,
        "service_arn": service_arn,
        "source_arn": source_arn,
    }
    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