Skip to content

stop_run

stop_run(
    arn: AmazonResourceName,
    *,
    config_overrides: Optional[DeviceFarmClientConfig] = None,
) -> StopRunResult

Initiates a stop request for the current test run. AWS Device Farm immediately stops the run on devices where tests have not started. You are not billed for these devices. On devices where tests have started executing, setup suite and teardown suite tests run to completion on those devices. You are billed for setup, teardown, and any tests that were in progress or already completed.

Parameters:

  • arn (AmazonResourceName) –

    Represents the Amazon Resource Name (ARN) of the Device Farm run to stop.

Raises:

Examples:

To stop a test run The following example stops a specific test run.

>>> client.stop_run(arn='arn:aws:devicefarm:us-west-2:123456789101:run:EXAMPLE-GUID-123-456')
Source code in docs_src/capo_device_farm/_services/device_farm.py
def stop_run(
    self,
    arn: "capo_device_farm.types.amazon_resource_name.AmazonResourceName",
    *,
    config_overrides: Optional[DeviceFarmClientConfig] = None,
) -> "capo_device_farm.types.stop_run_result.StopRunResult":
    """<p>Initiates a stop request for the current test run. AWS Device Farm immediately stops the run on devices where tests have not started. You are not billed for these devices. On devices where tests have started executing, setup suite and teardown suite tests run to completion on those devices. You are billed for setup, teardown, and any tests that were in progress or already completed.</p>

    Args:
        arn: <p>Represents the Amazon Resource Name (ARN) of the Device Farm run to stop.</p>

    Raises:
        capo_device_farm.errors.argument_exception.ArgumentException: <p>An invalid argument was specified.</p>
        capo_device_farm.errors.limit_exceeded_exception.LimitExceededException: <p>A limit was exceeded.</p>
        capo_device_farm.errors.not_found_exception.NotFoundException: <p>The specified entity was not found.</p>
        capo_device_farm.errors.service_account_exception.ServiceAccountException: <p>There was a problem with the service account.</p>
        capo_device_farm.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To stop a test run
        The following example stops a specific test run.

        >>> client.stop_run(arn='arn:aws:devicefarm:us-west-2:123456789101:run:EXAMPLE-GUID-123-456')
    """

    def _handler(
        req: "OperationRequest[capo_device_farm.types.stop_run_request.StopRunRequest]",
    ) -> OperationResponse["capo_device_farm.types.stop_run_result.StopRunResult"]:
        import capo_device_farm._operations.device_farm_20150623.stop_run

        output, http_response = (
            capo_device_farm._operations.device_farm_20150623.stop_run.stop_run(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_device_farm.types.stop_run_result.StopRunResult",
    ) -> dict[str, Any]:
        import capo_device_farm.types.stop_run_result

        return capo_device_farm.types.stop_run_result.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StopRun", redact_output=_redact_output)
    )
    input_: capo_device_farm.types.stop_run_request.StopRunRequest = {"arn": arn}

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