Creates a hotspot parameter protection rule for HTTP requests.
Try it now
Test
RAM authorization
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 | The namespace | default |
AppName | string | Yes | The application name | spring-cloud-a |
Threshold | number | Yes | Threshold | 20 |
Enable | boolean | No | The rule status. Valid values:
| true |
Resource | string | Yes | The interface name: The application resources 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 of the token bucket algorithm. | 0 |
AppId | string | No | The application ID | hkhon1****@c3df23522****** |
ControlBehavior | integer | No | The flow control method. Valid values:
| 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 |
ParamItem | string | No | The parameter description, which is a JSON string containing the following key-value pairs:
| {"fieldName":"testKey","matchStrategy":2,"parseStrategy":2,"pattern":"testValue"} |
MetricType | integer | No | The threshold type. Valid values:
| 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. Valid values:
| 1 |
AcceptLanguage | string | No | The language in which you want the results to be displayed. Valid values: zh (default): Chinese. en: English | zh |
Response elements
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 | Interface name: the application resources 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 |
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 |
AppId | string | The application ID. | hkhon1****@c3df23522****** |
MetricType | integer | The threshold type. Valid values:
| 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 of the token bucket algorithm. | 0 |
ParamItem | string | The parameter description, which is a JSON string containing the following key-value pairs:
| {"fieldName":"testKey","matchStrategy":2,"parseStrategy":2,"pattern":"testValue"} |
Success | boolean | Indicates whether the request was successful. Valid values:
| 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.