全部产品
Search
文档中心

资源编排:ALIYUN::ApiGateway::TrafficControlBinding

更新时间:Jun 14, 2024

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环境

取值:

  • TEST

  • PRE

  • RELEASE

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"
      }
    }
  }
}