ResetGatewayQuotaRule
Resets a quota rate limiting rule on a gateway.
Operation description
Resets a quota rate limiting rule on a gateway. This operation takes effect only for AI gateways with a version later than 2.1.19. The reset clears the historical usage of consumers on the rule.
Recommended call logic:
-
Perform a dry run to check for rule conflicts.
-
Set dryRun=true.
-
The response contains a conflict preview with conflictHash.
-
Submit the request after confirmation.
-
No conflict: dryRun=false, overwrite=false.
-
Conflict exists and overwrite confirmed: dryRun=false, overwrite=true, conflictHash=
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
apig:ResetGatewayQuotaRule |
none |
*Gateway
|
None | None |
Request syntax
POST /v1/gateways/{gatewayId}/quota-rules/{ruleId}/reset HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| gatewayId |
string |
No |
The unique identifier of the gateway. |
gw-123456 |
| ruleId |
string |
No |
The rule ID. |
qr-d8j7fpmm1hksxxxxxx |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
object |
No |
The request body. |
{'key': 'value'} |
| quotaLimit |
integer |
No |
The total available quota per period after the reset. |
1000 |
| windowAlignment |
string |
No |
The period type after the reset. Currently only calendar periods are supported, which means windowAlignment="calendar". |
calendar |
| periodType |
string |
No |
The period type. Valid values: day, week, or month. |
week |
| periodMultiplier |
integer |
No |
The period multiplier, indicating how many periods elapse before the quota resets. Returned when the rule uses a custom period. Minimum value: 1. Maximum value: 60. |
1 |
| timezone |
string |
No |
The time zone corresponding to the calendar period (UTC+x format). |
UTC+8 |
| dryRun |
boolean |
No |
Specifies whether to perform only a dry run without delivering the actual configuration. A dry run checks whether conflicting rules exist on the bound consumers. For example, a consumer that already has a calendar-day quota cannot have another calendar-day quota rule added. |
false |
| overwrite |
boolean |
No |
Specifies whether to allow overwriting on conflict. If overwriting is allowed, the conflicting entity (consumer) is unbound from the old rule and bound to the new rule. |
false |
| conflictHash |
string |
No |
The conflict snapshot hash, used to prevent concurrent dirty overwrites during confirmation. Obtain this value from the response data of a previous dryRun=true call. This parameter is not required in the following cases: no conflict exists, the request is a dry run (dryRun=true), or overwrite=false (overwrite not confirmed). When dryRun=false and overwrite=true, if this parameter is not provided or the value has expired and no longer matches, the backend returns accepted=false with a new conflict preview. You must perform a dry run again to confirm the new conflict. |
f8f44dc6cf369a017d56b7197eb4fb5ac4bbb6b09a92b9b41999541fxxxxxxxx |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| requestId |
string |
The unique identifier of the request. |
1234567890 |
| code |
string |
The status code or error code. |
200, 404, 500 |
| message |
string |
The message content. |
你好,世界! |
| data |
object |
The response data. |
{'key': 'value'} |
| ruleId |
string |
The rule ID. |
qr-d8j7fpmm1hks65xxxx |
| dryRun |
boolean |
Indicates whether this is a dry run. |
false |
| accepted |
boolean |
Indicates whether the write request semantics are accepted by the system. A value of false typically indicates a retryable scenario such as an unconfirmed conflict overwrite. |
true |
| conflictPreview |
object |
The conflict preview. |
|
| totalConflictCount |
integer |
20 |
|
| conflictHash |
string |
f8f44dc6cf369a017d56b7197eb4fb5ac4bbb6b09a92b9b41999541fxxxxxxxx |
|
| items |
array<object> |
||
|
object |
|||
| consumerId |
string |
cs-d82n1g6m1hkm3xxxxxxx |
|
| consumerName |
string |
consumer-a |
|
| conflictType |
string |
calendar |
|
| conflictPeriodType |
string |
week |
Examples
Success response
JSON format
{
"requestId": "1234567890",
"code": "200, 404, 500",
"message": "你好,世界!",
"data": {
"ruleId": "qr-d8j7fpmm1hks65xxxx",
"dryRun": false,
"accepted": true,
"conflictPreview": {
"totalConflictCount": 20,
"conflictHash": "f8f44dc6cf369a017d56b7197eb4fb5ac4bbb6b09a92b9b41999541fxxxxxxxx",
"items": [
{
"consumerId": "cs-d82n1g6m1hkm3xxxxxxx",
"consumerName": "consumer-a",
"conflictType": "calendar",
"conflictPeriodType": "week"
}
]
}
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.