BedrockAgentCoreControl / Client / batch_put_gateway_rate_limits
batch_put_gateway_rate_limits¶
- BedrockAgentCoreControl.Client.batch_put_gateway_rate_limits(**kwargs)¶
Atomically creates or updates multiple rate limits for a gateway. The operation updates existing limits with matching keys and creates new limits for new keys. If the operation fails, the service applies no changes. Retry the request after resolving the issue.
See also: AWS API Documentation
Request Syntax
response = client.batch_put_gateway_rate_limits( gatewayIdentifier='string', clientToken='string', rateLimits=[ { 'rateLimitId': 'string', 'description': 'string', 'dimensionKeys': [ 'string', ], 'entries': [ { 'dimensions': { 'string': 'string' }, 'requests': [ { 'rate': 123.0, 'period': 'second'|'minute' }, ], 'tokens': [ { 'rate': 123.0, 'period': 'second'|'minute' }, ], 'connections': [ { 'rate': 123.0, 'period': 'second'|'minute' }, ] }, ] }, ] )
- Parameters:
gatewayIdentifier (string) –
[REQUIRED]
The unique identifier of the gateway.
clientToken (string) –
A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If you don’t specify this field, a value is randomly generated for you. If this token matches a previous request, the service ignores the request, but doesn’t return an error. For more information, see Ensuring idempotency.
This field is autopopulated if not provided.
rateLimits (list) –
[REQUIRED]
Complete set of rate limits for this gateway. Replaces all existing limits atomically.
(dict) –
A limit definition within a BatchPut request (rateLimitId used for upsert matching)
rateLimitId (string) –
Optional — if provided, used for upsert matching against existing limits.
description (string) –
Optional human-readable description for this limit.
dimensionKeys (list) – [REQUIRED]
Ordered list of dimension key names defining the scope of a limit
(string) –
A dimension key specifying the scope dimension for rate limiting. Allowed values: “targetName”, “toolName”, “qualifiedModelId”, or context-path expressions: “$.context.iam.principal”, “$.context.iam.sourceIdentity”, “$.context.jwt.” where is a JWT claim name (e.g., “$.context.jwt.sub”). Validated server-side to enforce allowed prefixes and patterns.
entries (list) – [REQUIRED]
List of rule entries within a limit
(dict) –
A single rule entry within a limit, mapping dimension values to rate configurations
dimensions (dict) – [REQUIRED]
Map of dimension name to dimension value, matching the parent limit’s dimensionKeys. Keys must exactly match the dimensionKeys. Values may be “” as a wildcard. “” may only appear at trailing positions (based on dimensionKeys ordering).
(string) –
A dimension key specifying the scope dimension for rate limiting. Allowed values: “targetName”, “toolName”, “qualifiedModelId”, or context-path expressions: “$.context.iam.principal”, “$.context.iam.sourceIdentity”, “$.context.jwt.” where is a JWT claim name (e.g., “$.context.jwt.sub”). Validated server-side to enforce allowed prefixes and patterns.
(string) –
A dimension value in a rule entry (exact value or “*” wildcard)
requests (list) –
Request rate limits (RPS or RPM). Limited to 1 entry for now.
(dict) –
Rate configuration for a metric (requests or tokens)
rate (float) – [REQUIRED]
The rate value for the limit. For request limits, this is the number of requests allowed per period. For token limits, this is the number of tokens allowed per period. For connection limits, this is the number of concurrent connections allowed.
period (string) – [REQUIRED]
Time period for rate limiting
tokens (list) –
Token rate limits (TPM). Limited to 1 entry for now. — P1
(dict) –
Rate configuration for a metric (requests or tokens)
rate (float) – [REQUIRED]
The rate value for the limit. For request limits, this is the number of requests allowed per period. For token limits, this is the number of tokens allowed per period. For connection limits, this is the number of concurrent connections allowed.
period (string) – [REQUIRED]
Time period for rate limiting
connections (list) –
Connection rate limits (per second only). Limited to 1 entry for now. — P2
(dict) –
Rate configuration for a metric (requests or tokens)
rate (float) – [REQUIRED]
The rate value for the limit. For request limits, this is the number of requests allowed per period. For token limits, this is the number of tokens allowed per period. For connection limits, this is the number of concurrent connections allowed.
period (string) – [REQUIRED]
Time period for rate limiting
- Return type:
dict
- Returns:
Response Syntax
{ 'rateLimits': [ { 'rateLimitId': 'string', 'gatewayIdentifier': 'string', 'description': 'string', 'dimensionKeys': [ 'string', ], 'entries': [ { 'dimensions': { 'string': 'string' }, 'requests': [ { 'rate': 123.0, 'period': 'second'|'minute' }, ], 'tokens': [ { 'rate': 123.0, 'period': 'second'|'minute' }, ], 'connections': [ { 'rate': 123.0, 'period': 'second'|'minute' }, ] }, ], 'status': 'CREATING'|'ACTIVE'|'UPDATING'|'DELETING', 'createdAt': datetime(2015, 1, 1), 'updatedAt': datetime(2015, 1, 1) }, ] }
Response Structure
(dict) –
rateLimits (list) –
The resulting set of rate limits after the batch operation.
(dict) –
Shared fields for GatewayRateLimit responses
rateLimitId (string) –
Limit identifier. Optional on Create (system-generates if not provided by customer). Always present in responses.
gatewayIdentifier (string) –
The unique identifier of the gateway.
description (string) –
Optional human-readable description for this limit.
dimensionKeys (list) –
Ordered list of dimension key names defining the scope of a limit
(string) –
A dimension key specifying the scope dimension for rate limiting. Allowed values: “targetName”, “toolName”, “qualifiedModelId”, or context-path expressions: “$.context.iam.principal”, “$.context.iam.sourceIdentity”, “$.context.jwt.” where is a JWT claim name (e.g., “$.context.jwt.sub”). Validated server-side to enforce allowed prefixes and patterns.
entries (list) –
List of rule entries within a limit
(dict) –
A single rule entry within a limit, mapping dimension values to rate configurations
dimensions (dict) –
Map of dimension name to dimension value, matching the parent limit’s dimensionKeys. Keys must exactly match the dimensionKeys. Values may be “” as a wildcard. “” may only appear at trailing positions (based on dimensionKeys ordering).
(string) –
A dimension key specifying the scope dimension for rate limiting. Allowed values: “targetName”, “toolName”, “qualifiedModelId”, or context-path expressions: “$.context.iam.principal”, “$.context.iam.sourceIdentity”, “$.context.jwt.” where is a JWT claim name (e.g., “$.context.jwt.sub”). Validated server-side to enforce allowed prefixes and patterns.
(string) –
A dimension value in a rule entry (exact value or “*” wildcard)
requests (list) –
Request rate limits (RPS or RPM). Limited to 1 entry for now.
(dict) –
Rate configuration for a metric (requests or tokens)
rate (float) –
The rate value for the limit. For request limits, this is the number of requests allowed per period. For token limits, this is the number of tokens allowed per period. For connection limits, this is the number of concurrent connections allowed.
period (string) –
Time period for rate limiting
tokens (list) –
Token rate limits (TPM). Limited to 1 entry for now. — P1
(dict) –
Rate configuration for a metric (requests or tokens)
rate (float) –
The rate value for the limit. For request limits, this is the number of requests allowed per period. For token limits, this is the number of tokens allowed per period. For connection limits, this is the number of concurrent connections allowed.
period (string) –
Time period for rate limiting
connections (list) –
Connection rate limits (per second only). Limited to 1 entry for now. — P2
(dict) –
Rate configuration for a metric (requests or tokens)
rate (float) –
The rate value for the limit. For request limits, this is the number of requests allowed per period. For token limits, this is the number of tokens allowed per period. For connection limits, this is the number of concurrent connections allowed.
period (string) –
Time period for rate limiting
status (string) –
Status of a gateway limit
createdAt (datetime) –
The timestamp when the rate limit was created.
updatedAt (datetime) –
The timestamp when the rate limit was last updated.
Exceptions
BedrockAgentCoreControl.Client.exceptions.ServiceQuotaExceededExceptionBedrockAgentCoreControl.Client.exceptions.ConflictExceptionBedrockAgentCoreControl.Client.exceptions.ValidationExceptionBedrockAgentCoreControl.Client.exceptions.AccessDeniedExceptionBedrockAgentCoreControl.Client.exceptions.ResourceNotFoundExceptionBedrockAgentCoreControl.Client.exceptions.ThrottlingExceptionBedrockAgentCoreControl.Client.exceptions.InternalServerException