Cria uma política de limitação personalizada para o API Gateway.
Sintaxe
{
"Type": "ALIYUN::ApiGateway::TrafficControl",
"Properties": {
"TrafficControlName": String,
"Description": String,
"UserDefault": String,
"AppDefault": String,
"TrafficControlUnit": String,
"Special": List,
"ApiDefault": Integer
}
}
Propriedades
|
Propriedade |
Tipo |
Obrigatória |
Editável |
Descrição |
Restrição |
|
ApiDefault |
Integer |
Sim |
Sim |
Valor padrão de limitação por API. |
Nenhuma. |
|
TrafficControlName |
String |
Sim |
Sim |
Nome da política de limitação. |
De 4 a 50 caracteres. Aceita letras, dígitos e sublinhados (_). Não pode começar com sublinhado. |
|
TrafficControlUnit |
String |
Sim |
Sim |
Unidade de tempo da política de limitação. |
Valores válidos:
|
|
AppDefault |
String |
Não |
Sim |
Valor padrão de limitação por aplicativo. |
Nenhuma. |
|
Description |
String |
Não |
Sim |
Descrição da política de limitação. |
Nenhuma. |
|
Special |
List |
Não |
Sim |
Políticas especiais de limitação a adicionar. |
Nenhuma. |
|
UserDefault |
String |
Não |
Sim |
Valor padrão de limitação por usuário. |
Nenhuma. |
Sintaxe de Special
"Special": {
"SpecialType" : String,
"SpecialKey" : String,
"TrafficValue" : Integer
}
Propriedades de Special
|
Propriedade |
Tipo |
Obrigatória |
Editável |
Descrição |
Restrição |
|
SpecialKey |
String |
Sim |
Não |
ID do aplicativo ou ID da conta Alibaba Cloud, dependendo do valor de SpecialType. |
Nenhuma. |
|
SpecialType |
String |
Sim |
Não |
Tipo da política especial de limitação. |
Valores válidos:
|
|
TrafficValue |
Integer |
Sim |
Não |
Valor de limitação para o destino especificado. |
Nenhuma. |
Valores de retorno
Fn::GetAtt
TrafficControlId: ID da política de limitação.
Exemplos
Substitua os valores de parâmetros mascarados pelos valores reais.
Formato YAML
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
AppId:
Type: String
Description: The ID of the application in the special throttling policy.
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
Formato JSON
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"AppId": {
"Type": "String",
"Description": "The ID of the application in the special throttling policy."
}
},
"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
}
]
}
}
}
}