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]
The complete set of rate limits for this gateway. This operation replaces all existing rate limits in a single request. If the operation fails, no rate limits are changed.
(dict) –
A rate limit definition within a batch put request. If you provide a
rateLimitId, the service uses it for upsert matching against existing rate limits.rateLimitId (string) –
The unique identifier of the rate limit. If provided, the service uses it for upsert matching against existing rate limits.
description (string) –
An optional human-readable description for this rate limit. If not provided, the rate limit is created without a description.
dimensionKeys (list) – [REQUIRED]
The ordered list of dimension key names that define the scope of this rate 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.<claim>where<claim>is a JWT claim name (for example,$.context.jwt.sub). Validated server-side to enforce allowed prefixes and patterns.
entries (list) – [REQUIRED]
The list of rule entries that map dimension values to rate configurations.
(dict) –
A single rule entry within a rate limit that maps dimension values to rate configurations. Each entry defines the rate limits for a specific combination of dimension values.
dimensions (dict) – [REQUIRED]
A map of dimension names to dimension values for this rule entry. Keys must match the parent rate limit’s dimension keys. Values may use
*as a wildcard, but only in trailing positions based on the dimension keys 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.<claim>where<claim>is a JWT claim name (for example,$.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) –
The request rate limit configuration. Specifies the maximum number of requests allowed per time period.
(dict) –
Contains the rate configuration for a rate limit metric, specifying the allowed rate and time period.
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]
The time period for the rate limit. Valid values:
second—Measures the rate limit over a one-second window.minute—Measures the rate limit over a one-minute window.
tokens (list) –
The token rate limit configuration. Specifies the maximum number of tokens allowed per time period.
(dict) –
Contains the rate configuration for a rate limit metric, specifying the allowed rate and time period.
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]
The time period for the rate limit. Valid values:
second—Measures the rate limit over a one-second window.minute—Measures the rate limit over a one-minute window.
connections (list) –
The connection rate limit configuration. Specifies the maximum number of concurrent connections allowed.
(dict) –
Contains the rate configuration for a rate limit metric, specifying the allowed rate and time period.
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]
The time period for the rate limit. Valid values:
second—Measures the rate limit over a one-second window.minute—Measures the rate limit over a one-minute window.
- 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) –
Contains detailed information about a gateway rate limit, including its configuration and current status.
rateLimitId (string) –
The unique identifier of the rate limit.
gatewayIdentifier (string) –
The unique identifier of the gateway.
description (string) –
The human-readable description of the rate limit.
dimensionKeys (list) –
The ordered list of dimension key names that define the scope of this rate 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.<claim>where<claim>is a JWT claim name (for example,$.context.jwt.sub). Validated server-side to enforce allowed prefixes and patterns.
entries (list) –
The list of rule entries that map dimension values to rate configurations.
(dict) –
A single rule entry within a rate limit that maps dimension values to rate configurations. Each entry defines the rate limits for a specific combination of dimension values.
dimensions (dict) –
A map of dimension names to dimension values for this rule entry. Keys must match the parent rate limit’s dimension keys. Values may use
*as a wildcard, but only in trailing positions based on the dimension keys 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.<claim>where<claim>is a JWT claim name (for example,$.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) –
The request rate limit configuration. Specifies the maximum number of requests allowed per time period.
(dict) –
Contains the rate configuration for a rate limit metric, specifying the allowed rate and time period.
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) –
The time period for the rate limit. Valid values:
second—Measures the rate limit over a one-second window.minute—Measures the rate limit over a one-minute window.
tokens (list) –
The token rate limit configuration. Specifies the maximum number of tokens allowed per time period.
(dict) –
Contains the rate configuration for a rate limit metric, specifying the allowed rate and time period.
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) –
The time period for the rate limit. Valid values:
second—Measures the rate limit over a one-second window.minute—Measures the rate limit over a one-minute window.
connections (list) –
The connection rate limit configuration. Specifies the maximum number of concurrent connections allowed.
(dict) –
Contains the rate configuration for a rate limit metric, specifying the allowed rate and time period.
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) –
The time period for the rate limit. Valid values:
second—Measures the rate limit over a one-second window.minute—Measures the rate limit over a one-minute window.
status (string) –
The current status of the rate 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