CreateSpendingLimit - Amazon Braket

CreateSpendingLimit

Creates a spending limit for a specified quantum device. Spending limits help you control costs by setting maximum amounts that can be spent on quantum computing tasks within a specified time period. Simulators do not support spending limits.

Request Syntax

POST /spending-limit HTTP/1.1 Content-type: application/json { "clientToken": "string", "deviceArn": "string", "spendingLimit": "string", "tags": { "string" : "string" }, "timePeriod": { "endAt": number, "startAt": number } }

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request accepts the following data in JSON format.

clientToken

A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, Amazon Braket ignores the request, but does not return an error.

Type: String

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

Required: Yes

deviceArn

The Amazon Resource Name (ARN) of the quantum device to apply the spending limit to.

Type: String

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

Required: Yes

spendingLimit

The maximum amount that can be spent on the specified device, in USD.

Type: String

Length Constraints: Minimum length of 1.

Pattern: \d+(\.\d{1,2})?

Required: Yes

tags

The tags to apply to the spending limit. Each tag consists of a key and an optional value.

Type: String to string map

Required: No

timePeriod

The time period during which the spending limit is active, including start and end dates.

Type: TimePeriod object

Required: No

Response Syntax

HTTP/1.1 201 Content-type: application/json { "spendingLimitArn": "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.

spendingLimitArn

The Amazon Resource Name (ARN) of the created spending limit.

Type: String

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

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

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

DeviceRetiredException

The specified device has been retired.

HTTP Status Code: 410

InternalServiceException

The request failed because of an unknown error.

HTTP Status Code: 500

ThrottlingException

The API throttling rate limit is exceeded.

HTTP Status Code: 429

ValidationException

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

programSetValidationFailures

The validation failures in the program set submitted in the request.

reason

The reason for validation failure.

HTTP Status Code: 400

See Also

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