All Products
Search
Document Center

Microservices Engine:CreateWebFlowRule

Last Updated:Jul 22, 2025

Creates a hot parameter protection rule for HTTP requests.

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 support 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

mse:CreateWebFlowRule

update

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

Namespace

string

No

Namespace

default

AppName

string

Yes

Application name

spring-cloud-a

Threshold

number

Yes

Threshold

20

Enable

boolean

No

The rule status

  • true (enabled)

  • false (disabled)

true

Resource

string

Yes

The name of the interface to which the rule applies. The interface name must be the same as the name on the interface details page in the console.

/flow

Burst

integer

No

The number of additional requests allowed for burst requests. The effect is equivalent to the maximum number of tokens for the token bucket algorithm.

0

AppId

string

No

Application ID

hkhon1****@c3df23522******

ControlBehavior

integer

No

The flow control method. Valid values:

  • 0 (fast failure)

  • 2 (wait in queue)

0

MaxQueueingTimeMs

integer

No

The timeout period. Unit: milliseconds. This parameter is required if the ControlBehavior parameter is set to 2.

200

ResourceMode

integer

Yes

Resource mode

  • 0 (resource name mode)

0

ParamItem

string

No

The parameter description item, which is a JSON string containing the following key-value pairs:

  • parseStrategy: the parameter property (0: client IP address, 1: remote host, 2: header, 3: URL parameter)

  • fieldName: the header name or URL parameter name. You must specify this key only if parseStrategy is set to 2 or 3

  • matchStrategy: the method to match the property value. You must specify this key only if parseStrategy is set to 2 or 3 and the property value is matched. Valid values: 0 (exact match), 2 (regular expression match), and 3 (substring match)

  • pattern: the match string. You must specify this key only if parseStrategy is set to 2 or 3 and the property value is matched

{"fieldName":"testKey","matchStrategy":2,"parseStrategy":2,"pattern":"testValue"}

MetricType

integer

No

The threshold type. Valid values:

  • 1 (number of requests)

1

StatIntervalMs

integer

No

The length of the time window. Unit: milliseconds. The default value is 1000, which indicates 1 second.

1000

RegionId

string

No

The region ID.

cn-hangzhou

ResourceType

integer

No

The resource type

  • 0 (custom interface)

  • 1 (WEB)

  • 2 (RPC)

1

AcceptLanguage

string

No

The language in which you want the results to be displayed. Valid values: zh (default): Chinese. en: English

zh

Response parameters

Parameter

Type

Description

Example

object

Message

string

The response message.

OK

RequestId

string

The request ID.

A73AC37C-C617-4E3A-8049-372CF49C****

Code

string

The response code.

200

Data

object

The response data.

Namespace

string

The namespace.

default

StatIntervalMs

integer

The length of the time window. Unit: milliseconds.

1000

Id

integer

The rule ID.

1

AppName

string

The application name.

spring-cloud-a

Resource

string

The name of the interface to which the rule applies. The interface name must be the same as that displayed on the API Details page in the console.

/flow

ControlBehavior

integer

The flow control method. Valid values:

  • 0 (fast failure)

  • 2 (wait in queue)

0

ReourceMode

integer

Resource mode

0 (resource name mode)

0

MaxQueueingTimeMs

integer

The timeout period for queuing when the ControlBehavior parameter is set to 2. Unit: milliseconds.

200

Threshold

number

The threshold.

20

Enable

boolean

The rule status. Valid values:

  • true (enabled)

  • false (disabled)

true

AppId

string

The application ID.

hkhon1****@c3df23522******

MetricType

integer

The threshold type. Valid values:

  • 1 (number of requests)

1

RegionId

string

The region ID.

cn-hangzhou

Burst

integer

The number of additional requests allowed for burst requests. The effect is equivalent to the maximum number of tokens for the token bucket algorithm.

0

ParamItem

string

The parameter description item, which is a JSON string containing the following key-value pairs:

  • parseStrategy: the parameter property (0: client IP address, 1: remote host, 2: header, 3: URL parameter)

  • fieldName: the header name or URL parameter name. You must specify this key only if parseStrategy is set to 2 or 3

  • matchStrategy: the method to match the property value. You must specify this key only if parseStrategy is set to 2 or 3 and the property value is matched. Valid values: 0 (exact match), 2 (regular expression match), and 3 (substring match)

  • pattern: the match string. You must specify this key only if parseStrategy is set to 2 or 3 and the property value is matched

{"fieldName":"testKey","matchStrategy":2,"parseStrategy":2,"pattern":"testValue"}

Success

boolean

Indicates whether the request was successful. Valid values:

  • true: The request was successful.

  • false: The request failed.

true

Examples

Success response

JSON format

{
  "Message": "OK",
  "RequestId": "A73AC37C-C617-4E3A-8049-372CF49C****",
  "Code": "200",
  "Data": {
    "Namespace": "default",
    "StatIntervalMs": 1000,
    "Id": 1,
    "AppName": "spring-cloud-a",
    "Resource": "/flow",
    "ControlBehavior": 0,
    "ReourceMode": 0,
    "MaxQueueingTimeMs": 200,
    "Threshold": 20,
    "Enable": true,
    "AppId": "hkhon1****@c3df23522******",
    "MetricType": 1,
    "RegionId": "cn-hangzhou",
    "Burst": 0,
    "ParamItem": "{\"fieldName\":\"testKey\",\"matchStrategy\":2,\"parseStrategy\":2,\"pattern\":\"testValue\"}"
  },
  "Success": true
}

Error codes

HTTP status code

Error code

Error message

Description

400 IllegalRequest Invalid request:%s Invalid request: %s
400 InvalidParameter Parameter error:%s Request parameter error: %s
500 InternalError Console error. Try again later:%s Console error. Try again later: %s
403 NoPermission You are not authorized to perform this operation:%s You do not have the permission to use this interface:%s
404 NotFound Not found:%s The resource does not exist:%s

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.