调用EnableFlowRule接口开启流控规则。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | EnableFlowRule |
系统规定参数。取值:EnableFlowRule。 |
RuleId | Long | 是 | 123 |
流控规则ID。 |
AhasRegionId | String | 否 | cn-hangzhou |
地域 |
返回数据
示例
请求示例
http(s)://[Endpoint]/?Action=EnableFlowRule
&RuleId=123
&<公共请求参数>
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<EnableFlowRuleResponse>
<Message>null</Message>
<RequestId>3FEEAD12-CE22-4EDE-A729-CE94EC070610</RequestId>
<Data>
<RefResource>handleServiceB</RefResource>
<ClusterFallbackThreshold>30</ClusterFallbackThreshold>
<Namespace>default</Namespace>
<LimitOrigin>default</LimitOrigin>
<StatDurationMs>5000</StatDurationMs>
<ClusterThresholdType>0</ClusterThresholdType>
<RuleId>123</RuleId>
<RelationStrategy>0</RelationStrategy>
<AppName>ahas-demo</AppName>
<Resource>handleServiceA</Resource>
<MaxQueueingTimeMs>2000</MaxQueueingTimeMs>
<ClusterEstimatedMaxQps>3000</ClusterEstimatedMaxQps>
<ControlBehavior>0</ControlBehavior>
<WarmUpPeriodSec>30</WarmUpPeriodSec>
<ClusterFallbackStrategy>1</ClusterFallbackStrategy>
<Threshold>50</Threshold>
<ClusterMode>true</ClusterMode>
<Enable>true</Enable>
</Data>
<Code>200</Code>
<Success>true</Success>
</EnableFlowRuleResponse>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"Message" : "null",
"RequestId" : "3FEEAD12-CE22-4EDE-A729-CE94EC070610",
"Data" : {
"RefResource" : "handleServiceB",
"ClusterFallbackThreshold" : 30,
"Namespace" : "default",
"LimitOrigin" : "default",
"StatDurationMs" : 5000,
"ClusterThresholdType" : 0,
"RuleId" : 123,
"RelationStrategy" : 0,
"AppName" : "ahas-demo",
"Resource" : "handleServiceA",
"MaxQueueingTimeMs" : 2000,
"ClusterEstimatedMaxQps" : 3000,
"ControlBehavior" : 0,
"WarmUpPeriodSec" : 30,
"ClusterFallbackStrategy" : 1,
"Threshold" : 50,
"ClusterMode" : true,
"Enable" : true
},
"Code" : "200",
"Success" : true
}
错误码
访问错误中心查看更多错误码。