O recurso ALIYUN::ApiGateway::App cria um aplicativo. Antes de chamar uma API de terceiros, crie um aplicativo e use-o como identidade para a chamada à API.
Sintaxe
{
"Type": "ALIYUN::ApiGateway::App",
"Properties": {
"Description": String,
"Tags": List,
"AppName": String,
"AppSecret": String,
"AppCode": String,
"AppKey": String
}
}
Propriedades
|
Propriedade |
Tipo |
Obrigatória |
Editável |
Descrição |
Restrição |
|
AppName |
String |
Sim |
Sim |
Nome do aplicativo. |
O nome deve ser globalmente único. Adicione um identificador especial para garantir essa unicidade. O nome deve ter entre 4 e 15 caracteres e pode conter letras, dígitos e sublinhados (_). Deve começar com uma letra. |
|
AppCode |
String |
Não |
Não |
AppCode do aplicativo. |
Nenhuma. |
|
AppKey |
String |
Não |
Não |
Chave do aplicativo. |
Usada para chamar uma API. |
|
AppSecret |
String |
Não |
Não |
Senha do aplicativo. |
Nenhuma. |
|
Description |
String |
Não |
Sim |
Descrição do aplicativo. |
A descrição pode ter até 180 caracteres. |
|
Tags |
List |
Não |
Sim |
Tags do aplicativo. |
É possível adicionar até 20 tags ao aplicativo. |
Sintaxe de Tags
"Tags": [
{
"Value": String,
"Key": String
}
]
Propriedades de Tags
|
Propriedade |
Tipo |
Obrigatória |
Editável |
Descrição |
Restrição |
|
Key |
String |
Sim |
Não |
Chave da tag. |
A chave da tag deve ter entre 1 e 128 caracteres e não pode conter |
|
Value |
String |
Não |
Não |
Valor da tag. |
O valor da tag pode ter até 128 caracteres e não pode conter |
Valores de retorno
Fn::GetAtt
AppKey: a chave do aplicativo.
AppSecret: o segredo do aplicativo.
AppId: o ID do aplicativo.
Tags: as tags do aplicativo.
AppCode: o AppCode do aplicativo.
Exemplos
Formato YAML
ROSTemplateFormatVersion: '2015-09-01'
Parameters: {}
Resources:
APP:
Type: ALIYUN::ApiGateway::App
Properties:
Description: Test Create App
AppName: DemoApp
Outputs:
AppId:
Description: The id of the created APP
Value:
Fn::GetAtt:
- APP
- AppId
AppKey:
Description: The key of the APP
Value:
Fn::GetAtt:
- APP
- AppKey
AppSecret:
Description: The secret of the APP
Value:
Fn::GetAtt:
- APP
- AppSecret
Formato JSON
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
},
"Resources": {
"APP": {
"Type": "ALIYUN::ApiGateway::App",
"Properties": {
"Description": "Test Create App",
"AppName": "DemoApp"
}
}
},
"Outputs": {
"AppId": {
"Description": "The id of the created APP",
"Value": {
"Fn::GetAtt": [
"APP",
"AppId"
]
}
},
"AppKey": {
"Description": "The key of the APP",
"Value": {
"Fn::GetAtt": [
"APP",
"AppKey"
]
}
},
"AppSecret": {
"Description": "The secret of the APP",
"Value": {
"Fn::GetAtt": [
"APP",
"AppSecret"
]
}
}
}
}