ALIYUN::ApiGateway::TrafficControl类型用于创建用户自定义的流控策略。
语法
{
"Type": "ALIYUN::ApiGateway::TrafficControl",
"Properties": {
"TrafficControlName": String,
"Description": String,
"UserDefault": String,
"AppDefault": String,
"TrafficControlUnit": String,
"Special": List,
"ApiDefault": Integer
}
}
属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
---|---|---|---|---|---|
TrafficControlName | String | 是 | 是 | 流控策略名称 | 长度为4~50个字符,不能以下划线(_)开头,可包含英文字符、中文字符、数字和下划线(_)。 |
TrafficControlUnit | String | 是 | 是 | 流控策略单位 | 取值:
|
ApiDefault | Integer | 是 | 是 | 每个API默认的流控值 | 无 |
Description | String | 否 | 是 | 流控描述信息 | 无 |
UserDefault | String | 否 | 是 | 每个用户默认的流控值 | 无 |
AppDefault | String | 否 | 是 | 每 App默认的流控值 | 无 |
Special | List | 否 | 是 | 设置用户自定义的特殊流控策略 | 无 |
Special 语法
"Special": {
"SpecialType" : String,
"SpecialKey" : String,
"TrafficValue" : Integer
}
Special 属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
---|---|---|---|---|---|
SpecialType | String | 是 | 否 | 特殊流控类型 | 取值:
|
SpecialKey | String | 是 | 否 | 根据SpecialType填写对应的AppId或者阿里云账号ID | 无 |
TrafficValue | Integer | 是 | 否 | 特殊流控值 | 无 |
返回值
Fn::GetAtt
TrafficControlId:用户自定义流控的ID。
示例
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"AppId": {
"Type": "String",
"Description": "特殊的APP ID"
}
},
"Resources": {
"TrafficControl": {
"Type": "ALIYUN::ApiGateway::TrafficControl",
"Properties": {
"TrafficControlName": "test_traffic_cont****",
"TrafficControlUnit": "MINUTE",
"ApiDefault": 400,
"UserDefault": 200,
"AppDefault": 100,
"Description": "demo2",
"Special": [
{
"SpecialType": "APP",
"SpecialKey": {
"Ref": "AppId"
},
"TrafficValue": 80
}
]
}
}
}
}