ALIYUN::ApiGateway::TrafficControlBinding类型用于设置API的用户自定义流控。
语法
{
"Type": "ALIYUN::ApiGateway::TrafficControlBinding",
"Properties": {
"ApiIds": List,
"TrafficControlId": String,
"StageName": String,
"GroupId": String
}
}
属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
ApiIds | List | 是 | 是 | 要操作的API编号 | 最多支持100个 |
GroupId | String | 是 | 是 | 要操作的API所属分组ID | 无 |
StageName | String | 是 | 是 | 要操作的API环境 | 取值:
|
TrafficControlId | String | 是 | 是 | 要操作的流控策略ID | 无 |
返回值
Fn::GetAtt
无。
示例
YAML
格式
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
TrafficControlId:
Type: String
Description: 流控策略ID
GroupId:
Type: String
Description: 操作的分组
ApiId:
Type: String
Description: 绑定的API
Resources:
TrafficControlBinding:
Type: ALIYUN::ApiGateway::TrafficControlBinding
Properties:
TrafficControlId:
Ref: TrafficControlId
GroupId:
Ref: GroupId
ApiIds:
- Ref: ApiId
StageName: RELEASE
JSON
格式
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"TrafficControlId": {
"Type": "String",
"Description": "流控策略ID"
},
"GroupId": {
"Type": "String",
"Description": "操作的分组"
},
"ApiId": {
"Type": "String",
"Description": "绑定的API"
}
},
"Resources": {
"TrafficControlBinding": {
"Type": "ALIYUN::ApiGateway::TrafficControlBinding",
"Properties": {
"TrafficControlId": {
"Ref": "TrafficControlId"
},
"GroupId": {
"Ref": "GroupId"
},
"ApiIds": [
{
"Ref": "ApiId"
}
],
"StageName": "RELEASE"
}
}
}
}