Skip to content

stop_test_run async

stop_test_run(
    test_run_id: TestRunId,
    service_arn: Arn,
    *,
    config_overrides: Optional[Asyncresiliencehubv2ClientConfig] = None,
) -> StopTestRunResponse

Stops an in-progress test run.

Parameters:

  • test_run_id (TestRunId) –

    The identifier of the test run to stop.

  • service_arn (Arn) –

    The ARN of the service the test run belongs to.

Raises:

Source code in docs_src/capo_resiliencehubv2/_services/async_resiliencehubv2.py
async def stop_test_run(
    self,
    test_run_id: "capo_resiliencehubv2.types.test_run_id.TestRunId",
    service_arn: "capo_resiliencehubv2.types.arn.Arn",
    *,
    config_overrides: Optional[Asyncresiliencehubv2ClientConfig] = None,
) -> "capo_resiliencehubv2.types.stop_test_run_response.StopTestRunResponse":
    """<p>Stops an in-progress test run.</p>

    Args:
        test_run_id: <p>The identifier of the test run to stop.</p>
        service_arn: <p>The ARN of the service the test run belongs to.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_resiliencehubv2.types.stop_test_run_request.StopTestRunRequest]",
    ) -> AsyncOperationResponse[
        "capo_resiliencehubv2.types.stop_test_run_response.StopTestRunResponse"
    ]:
        import capo_resiliencehubv2._operations.ngrh_service_core.stop_test_run

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StopTestRun")
    )
    input_: capo_resiliencehubv2.types.stop_test_run_request.StopTestRunRequest = {
        "test_run_id": test_run_id,
        "service_arn": service_arn,
    }

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