Skip to content

create_test_grid_url async

create_test_grid_url(
    project_arn: DeviceFarmArn,
    expires_in_seconds: TestGridUrlExpiresInSecondsInput,
    *,
    config_overrides: Optional[AsyncDeviceFarmClientConfig] = None,
) -> CreateTestGridUrlResult

Creates a signed, short-term URL that can be passed to a Selenium RemoteWebDriver constructor.

Parameters:

Raises:

Source code in docs_src/capo_device_farm/_services/async_device_farm.py
async def create_test_grid_url(
    self,
    project_arn: "capo_device_farm.types.device_farm_arn.DeviceFarmArn",
    expires_in_seconds: "capo_device_farm.types.test_grid_url_expires_in_seconds_input.TestGridUrlExpiresInSecondsInput",
    *,
    config_overrides: Optional[AsyncDeviceFarmClientConfig] = None,
) -> "capo_device_farm.types.create_test_grid_url_result.CreateTestGridUrlResult":
    """<p>Creates a signed, short-term URL that can be passed to a Selenium <code>RemoteWebDriver</code> constructor.</p>

    Args:
        project_arn: <p>ARN (from <a>CreateTestGridProject</a> or <a>ListTestGridProjects</a>) to associate with the short-term URL. </p>
        expires_in_seconds: <p>Lifetime, in seconds, of the URL.</p>

    Raises:
        capo_device_farm.errors.argument_exception.ArgumentException: <p>An invalid argument was specified.</p>
        capo_device_farm.errors.internal_service_exception.InternalServiceException: <p>An internal exception was raised in the service. Contact <a href="mailto:[email protected]">[email protected]</a> if you see this error. </p>
        capo_device_farm.errors.not_found_exception.NotFoundException: <p>The specified entity was not found.</p>
        capo_device_farm.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_device_farm.types.create_test_grid_url_request.CreateTestGridUrlRequest]",
    ) -> AsyncOperationResponse[
        "capo_device_farm.types.create_test_grid_url_result.CreateTestGridUrlResult"
    ]:
        import capo_device_farm._operations.device_farm_20150623.create_test_grid_url

        (
            output,
            http_response,
        ) = await capo_device_farm._operations.device_farm_20150623.create_test_grid_url.async_create_test_grid_url(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

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

        return capo_device_farm.types.create_test_grid_url_result.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateTestGridUrl", redact_output=_redact_output),
    )
    input_: capo_device_farm.types.create_test_grid_url_request.CreateTestGridUrlRequest = {
        "project_arn": project_arn,
        "expires_in_seconds": expires_in_seconds,
    }

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