GetDevice - Amazon Braket

GetDevice

Retrieves the devices available in Amazon Braket.

Note

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.

Request Syntax

GET /device/deviceArn HTTP/1.1

URI Request Parameters

The request uses the following URI parameters.

deviceArn

The ARN of the device to retrieve.

Length Constraints: Minimum length of 1. Maximum length of 256.

Required: Yes

Request Body

The request does not have a request body.

Response Syntax

HTTP/1.1 200 Content-type: application/json { "deviceArn": "string", "deviceCapabilities": "string", "deviceName": "string", "deviceQueueInfo": [ { "queue": "string", "queuePriority": "string", "queueSize": "string" } ], "deviceStatus": "string", "deviceType": "string", "providerName": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

deviceArn

The ARN of the device.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 256.

deviceCapabilities

Details about the capabilities of the device.

Type: String

deviceName

The name of the device.

Type: String

deviceQueueInfo

The number of quantum tasks and hybrid jobs currently queued on the device.

Type: Array of DeviceQueueInfo objects

deviceStatus

The status of the device.

Type: String

Valid Values: ONLINE | OFFLINE | RETIRED

deviceType

The type of the device.

Type: String

Valid Values: QPU | SIMULATOR

providerName

The name of the partner company for the device.

Type: String

Errors

For information about the errors that are common to all actions, see Common Errors.

AccessDeniedException

You do not have sufficient permissions to perform this action.

HTTP Status Code: 403

InternalServiceException

The request failed because of an unknown error.

HTTP Status Code: 500

ResourceNotFoundException

The specified resource was not found.

HTTP Status Code: 404

ThrottlingException

The API throttling rate limit is exceeded.

HTTP Status Code: 429

ValidationException

The input request failed to satisfy constraints expected by Amazon Braket.

HTTP Status Code: 400

Examples

Example

To set AWS_EXECUTION_ENV environment variable to configure user-agent when using the AWS CLI SDK:

% export AWS_EXECUTION_ENV="aws-cli BraketSchemas/1.8.0" # Or for single execution % AWS_EXECUTION_ENV="aws-cli BraketSchemas/1.8.0" aws braket <cmd> [options]

Example

To set AWS_EXECUTION_ENV environment variable to configure user-agent when using the Boto3:

import boto3 import botocore client = boto3.client("braket", config=botocore.client.Config(user_agent_extra="BraketSchemas/1.8.0"))

Example

To set AWS_EXECUTION_ENV environment variable to configure user-agent when using the JavaScript/TypeScript (SDK v2):

import Braket from 'aws-sdk/clients/braket'; const client = new Braket({ region: 'us-west-2', credentials: AWS_CREDENTIALS, customUserAgent: 'BraketSchemas/1.8.0' });

Example

To set AWS_EXECUTION_ENV environment variable to configure user-agent when using the JavaScript/TypeScript (SDK v3):

import { Braket } from '@aws-sdk/client-braket'; const client = new Braket({ region: 'us-west-2', credentials: AWS_CREDENTIALS, customUserAgent: 'BraketSchemas/1.8.0' });

Example

To set AWS_EXECUTION_ENV environment variable to configure user-agent when using the Go SDK:

os.Setenv("AWS_EXECUTION_ENV", "BraketGo BraketSchemas/1.8.0") mySession := session.Must(session.NewSession()) svc := braket.New(mySession)

Example

To set AWS_EXECUTION_ENV environment variable to configure user-agent when using the Java SDK:

ClientConfiguration config = new ClientConfiguration(); config.setUserAgentSuffix("BraketSchemas/1.8.0"); BraketClient braketClient = BraketClientBuilder.standard().withClientConfiguration(config).build();

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: