ResetGatewayQuotaRule

Updated at:

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.

Note

Recommended call logic:

    1. Perform a dry run to check for rule conflicts.

    • Set dryRun=true.

    • The response contains a conflict preview with conflictHash.

    1. Submit the request after confirmation.

    • No conflict: dryRun=false, overwrite=false.

    • Conflict exists and overwrite confirmed: dryRun=false, overwrite=true, conflictHash=

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

apig:ResetGatewayQuotaRule

none

*Gateway

acs:apig:{#regionId}:{#accountId}:gateway/{#GatewayId}

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.