Skip to content

delete_test_sources

delete_test_sources(
    test_id: TestId,
    service_arn: Arn,
    test_sources: TestSourceInputList,
    *,
    config_overrides: Optional[resiliencehubv2ClientConfig] = None,
) -> DeleteTestSourcesResponse

Removes monitoring sources from a test. The operation is transactional and idempotent — removing a source that is not attached is a no-op.

Parameters:

  • test_id (TestId) –

    The identifier of the test to remove sources from.

  • service_arn (Arn) –

    The ARN of the service the test belongs to.

  • test_sources (TestSourceInputList) –

    The monitoring sources to remove.

Raises:

Source code in docs_src/capo_resiliencehubv2/_services/resiliencehubv2.py
def delete_test_sources(
    self,
    test_id: "capo_resiliencehubv2.types.test_id.TestId",
    service_arn: "capo_resiliencehubv2.types.arn.Arn",
    test_sources: "capo_resiliencehubv2.types.test_source_input_list.TestSourceInputList",
    *,
    config_overrides: Optional[resiliencehubv2ClientConfig] = None,
) -> "capo_resiliencehubv2.types.delete_test_sources_response.DeleteTestSourcesResponse":
    """<p>Removes monitoring sources from a test. The operation is transactional and idempotent — removing a source that is not attached is a no-op.</p>

    Args:
        test_id: <p>The identifier of the test to remove sources from.</p>
        service_arn: <p>The ARN of the service the test belongs to.</p>
        test_sources: <p>The monitoring sources to remove.</p>

    Raises:
        capo_resiliencehubv2.errors.access_denied_exception.AccessDeniedException: <p>Access denied — caller lacks required permissions.</p>
        capo_resiliencehubv2.errors.conflict_exception.ConflictException: <p>Conflict — resource already exists.</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.delete_test_sources_request.DeleteTestSourcesRequest]",
    ) -> OperationResponse[
        "capo_resiliencehubv2.types.delete_test_sources_response.DeleteTestSourcesResponse"
    ]:
        import capo_resiliencehubv2._operations.ngrh_service_core.delete_test_sources

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteTestSources")
    )
    input_: capo_resiliencehubv2.types.delete_test_sources_request.DeleteTestSourcesRequest = {
        "test_id": test_id,
        "service_arn": service_arn,
        "test_sources": test_sources,
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output