Skip to content

list_test_sources async

list_test_sources(
    test_id: TestId,
    service_arn: Arn,
    *,
    config_overrides: Optional[Asyncresiliencehubv2ClientConfig] = None,
    type: Optional[TestSourceType] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> ListTestSourcesResponse

Lists the monitoring sources attached to a test, optionally filtered by type.

Parameters:

  • test_id (TestId) –

    The identifier of the test to list sources for.

  • service_arn (Arn) –

    The ARN of the service the test belongs to.

  • type (Optional[TestSourceType], default: None ) –

    Filter sources by type.

Raises:

Source code in docs_src/capo_resiliencehubv2/_services/async_resiliencehubv2.py
async def list_test_sources(
    self,
    test_id: "capo_resiliencehubv2.types.test_id.TestId",
    service_arn: "capo_resiliencehubv2.types.arn.Arn",
    *,
    config_overrides: Optional[Asyncresiliencehubv2ClientConfig] = None,
    type: Optional[
        "capo_resiliencehubv2.types.test_source_type.TestSourceType"
    ] = 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_sources_response.ListTestSourcesResponse"
):
    """<p>Lists the monitoring sources attached to a test, optionally filtered by type.</p>

    Args:
        test_id: <p>The identifier of the test to list sources for.</p>
        service_arn: <p>The ARN of the service the test belongs to.</p>
        type: <p>Filter sources by type.</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_test_sources_request.ListTestSourcesRequest]",
    ) -> AsyncOperationResponse[
        "capo_resiliencehubv2.types.list_test_sources_response.ListTestSourcesResponse"
    ]:
        import capo_resiliencehubv2._operations.ngrh_service_core.list_test_sources

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListTestSources")
    )
    input_: capo_resiliencehubv2.types.list_test_sources_request.ListTestSourcesRequest = {
        "test_id": test_id,
        "service_arn": service_arn,
    }
    if type is not None:
        input_["type"] = type
    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