CreateJob - Amazon Braket

CreateJob

Creates an Amazon Braket hybrid job.

Request Syntax

POST /job HTTP/1.1 Content-type: application/json { "algorithmSpecification": { "containerImage": { "uri": "string" }, "scriptModeConfig": { "compressionType": "string", "entryPoint": "string", "s3Uri": "string" } }, "associations": [ { "arn": "string", "type": "string" } ], "checkpointConfig": { "localPath": "string", "s3Uri": "string" }, "clientToken": "string", "deviceConfig": { "device": "string" }, "hyperParameters": { "string" : "string" }, "inputDataConfig": [ { "channelName": "string", "contentType": "string", "dataSource": { "s3DataSource": { "s3Uri": "string" } } } ], "instanceConfig": { "instanceCount": number, "instanceType": "string", "volumeSizeInGb": number }, "jobName": "string", "outputDataConfig": { "kmsKeyId": "string", "s3Path": "string" }, "roleArn": "string", "stoppingCondition": { "maxRuntimeInSeconds": number }, "tags": { "string" : "string" } }

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request accepts the following data in JSON format.

algorithmSpecification

Definition of the Amazon Braket job to be created. Specifies the container image the job uses and information about the Python scripts used for entry and training.

Type: AlgorithmSpecification object

Required: Yes

associations

The list of Amazon Braket resources associated with the hybrid job.

Type: Array of Association objects

Array Members: Minimum number of 0 items. Maximum number of 1 item.

Required: No

checkpointConfig

Information about the output locations for hybrid job checkpoint data.

Type: JobCheckpointConfig object

Required: No

clientToken

The client token associated with this request that guarantees that the request is idempotent.

Type: String

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

Required: Yes

deviceConfig

The quantum processing unit (QPU) or simulator used to create an Amazon Braket hybrid job.

Type: DeviceConfig object

Required: Yes

hyperParameters

Algorithm-specific parameters used by an Amazon Braket hybrid job that influence the quality of the training job. The values are set with a map of JSON key:value pairs, where the key is the name of the hyperparameter and the value is the value of the hyperparameter.

Type: String to string map

Map Entries: Minimum number of 0 items. Maximum number of 100 items.

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

Value Length Constraints: Minimum length of 1. Maximum length of 2500.

Value Pattern: ^.*$

Required: No

inputDataConfig

A list of parameters that specify the name and type of input data and where it is located.

Type: Array of InputFileConfig objects

Array Members: Minimum number of 0 items. Maximum number of 20 items.

Required: No

instanceConfig

Configuration of the resource instances to use while running the hybrid job on Amazon Braket.

Type: InstanceConfig object

Required: Yes

jobName

The name of the Amazon Braket hybrid job.

Type: String

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

Pattern: ^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,50}$

Required: Yes

outputDataConfig

The path to the S3 location where you want to store hybrid job artifacts and the encryption key used to store them.

Type: JobOutputDataConfig object

Required: Yes

roleArn

The Amazon Resource Name (ARN) of an IAM role that Amazon Braket can assume to perform tasks on behalf of a user. It can access user resources, run an Amazon Braket job container on behalf of user, and output results and hybrid job details to the users' s3 buckets.

Type: String

Pattern: ^arn:aws[a-z\-]*:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+$

Required: Yes

stoppingCondition

The user-defined criteria that specifies when a hybrid job stops running.

Type: JobStoppingCondition object

Required: No

tags

Tags to be added to the hybrid job you're creating.

Type: String to string map

Required: No

Response Syntax

HTTP/1.1 201 Content-type: application/json { "jobArn": "string" }

Response Elements

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

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

jobArn

The ARN of the Amazon Braket hybrid job created.

Type: String

Pattern: ^arn:aws[a-z\-]*:braket:[a-z0-9\-]+:[0-9]{12}:job/.*$

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

ConflictException

An error occurred due to a conflict.

HTTP Status Code: 409

DeviceOfflineException

The specified device is currently offline.

HTTP Status Code: 424

DeviceRetiredException

The specified device has been retired.

HTTP Status Code: 410

InternalServiceException

The request failed because of an unknown error.

HTTP Status Code: 500

ServiceQuotaExceededException

The request failed because a service quota is exceeded.

HTTP Status Code: 402

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

See Also

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