Skip to content

get_device

get_device(
    device_arn: DeviceArn, *, config_overrides: Optional[BraketClientConfig] = None
) -> GetDeviceResponse

Retrieves the devices available in Amazon Braket.

For backwards compatibility with older versions of BraketSchemas, OpenQASM information is omitted from GetDevice API calls. To get this information the user-agent needs to present a recent version of the BraketSchemas (1.8.0 or later). The Braket SDK automatically reports this for you. If you do not see OpenQASM results in the GetDevice response when using a Braket SDK, you may need to set AWS_EXECUTION_ENV environment variable to configure user-agent. See the code examples provided below for how to do this for the AWS CLI, Boto3, and the Go, Java, and JavaScript/TypeScript SDKs.

Parameters:

  • device_arn (DeviceArn) –

    The ARN of the device to retrieve.

Raises:

Source code in docs_src/capo_braket/_services/braket.py
def get_device(
    self,
    device_arn: "capo_braket.types.device_arn.DeviceArn",
    *,
    config_overrides: Optional[BraketClientConfig] = None,
) -> "capo_braket.types.get_device_response.GetDeviceResponse":
    """<p>Retrieves the devices available in Amazon Braket.</p> <note> <p>For backwards compatibility with older versions of BraketSchemas, OpenQASM information is omitted from GetDevice API calls. To get this information the user-agent needs to present a recent version of the BraketSchemas (1.8.0 or later). The Braket SDK automatically reports this for you. If you do not see OpenQASM results in the GetDevice response when using a Braket SDK, you may need to set AWS_EXECUTION_ENV environment variable to configure user-agent. See the code examples provided below for how to do this for the AWS CLI, Boto3, and the Go, Java, and JavaScript/TypeScript SDKs.</p> </note>

    Args:
        device_arn: <p>The ARN of the device to retrieve.</p>

    Raises:
        capo_braket.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this action.</p>
        capo_braket.errors.internal_service_exception.InternalServiceException: <p>The request failed because of an unknown error.</p>
        capo_braket.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_braket.errors.throttling_exception.ThrottlingException: <p>The API throttling rate limit is exceeded.</p>
        capo_braket.errors.validation_exception.ValidationException: <p>The input request failed to satisfy constraints expected by Amazon Braket.</p>
        capo_braket.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_braket.types.get_device_request.GetDeviceRequest]",
    ) -> OperationResponse[
        "capo_braket.types.get_device_response.GetDeviceResponse"
    ]:
        import capo_braket._operations.braket.get_device

        output, http_response = (
            capo_braket._operations.braket.get_device.get_device(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetDevice")
    )
    input_: capo_braket.types.get_device_request.GetDeviceRequest = {
        "device_arn": device_arn
    }

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