Cria um serviço no Cloud-native API Gateway.
Sintaxe
{
"Type": "ALIYUN::APIG::Service",
"Properties": {
"Addresses": List,
"GatewayId": String,
"ServiceName": String,
"SourceType": String,
"GroupName": String,
"ResourceGroupId": String,
"Namespace": String,
"Qualifier": String,
"AiServiceConfig": Map
}
}
Propriedades
|
Propriedade |
Tipo |
Obrigatório |
Editável |
Descrição |
Restrição |
|
Addresses |
List |
Não |
Sim |
Endereços do serviço. |
Especifique até 10 endereços IP ou nomes de domínio. |
|
GatewayId |
String |
Sim |
Não |
ID da instância do Cloud-native API Gateway. |
Nenhuma. |
|
GroupName |
String |
Não |
Não |
Nome do grupo de serviços. |
Obrigatório quando SourceType for MSE_NACOS. |
|
ResourceGroupId |
String |
Não |
Sim |
ID do grupo de recursos. |
Nenhuma. |
|
Namespace |
String |
Não |
Não |
Namespace do serviço. |
Obrigatório quando SourceType for K8s ou MSE_NACOS. |
|
Qualifier |
String |
Não |
Não |
Versão ou alias da função. |
Nenhuma. |
|
AiServiceConfig |
Map |
Não |
Não |
Configurações do serviço de IA. |
Para obter mais informações, consulte Propriedades de AiServiceConfig. |
|
ServiceName |
String |
Não |
Não |
Nome do serviço. |
Nenhuma. |
|
SourceType |
String |
Não |
Não |
Tipo de source do serviço. |
Defina o valor como DNS. |
Sintaxe de AiServiceConfig
"AiServiceConfig": {
"Provider": String,
"Address": String,
"Protocols": List,
"ApiKeys": List,
"EnableHealthCheck": Boolean
}
Propriedades de AiServiceConfig
|
Propriedade |
Tipo |
Obrigatório |
Editável |
Descrição |
Restrição |
|
Provider |
String |
Não |
Sim |
Provedor do modelo de linguagem grande (LLM). |
Nenhuma. |
|
Address |
String |
Não |
Sim |
Endereço do serviço. |
Nenhuma. |
|
Protocols |
List |
Não |
Sim |
Protocolos do LLM. |
Nenhuma. |
|
ApiKeys |
List |
Não |
Sim |
Chaves de API. |
Nenhuma. |
|
EnableHealthCheck |
Boolean |
Não |
Sim |
Indica se as verificações de integridade devem ser ativadas. |
Nenhuma. |
Valores de retorno
Fn::GetAtt
Addresses: endereços do serviço.
ServiceName: nome do serviço.
GatewayId: ID da instância do Cloud-native API Gateway.
ServiceId: ID do serviço.
AiServiceConfig: configurações do serviço de IA.
GroupName: nome do grupo de serviços.
Qualifier: versão ou alias da função.
ResourceGroupId: ID do grupo de recursos.
Namespace: namespace do serviço.
Exemplos
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
GatewayId:
Type: String
Description:
en: The ID of the Cloud Native API Gateway.
Required: true
AssociationProperty: ALIYUN::APIG::Gateway::GatewayId
Resources:
ExtensionResource:
Type: ALIYUN::APIG::Service
Properties:
GatewayId:
Ref: GatewayId
SourceType: DNS
ServiceName: test1
Addresses:
- ros.test:80
- ros.test:801
Outputs:
Addresses:
Description: Service Address List.
Value:
Fn::GetAtt:
- ExtensionResource
- Addresses
ServiceName:
Description: The name of the service.
Value:
Fn::GetAtt:
- ExtensionResource
- ServiceName
SourceType:
Description: Service source type.
Value:
Fn::GetAtt:
- ExtensionResource
- SourceType
GatewayId:
Description: The ID of the Cloud Native API Gateway.
Value:
Fn::GetAtt:
- ExtensionResource
- GatewayId
ServiceId:
Description: The ID of the service.
Value:
Fn::GetAtt:
- ExtensionResource
- ServiceId
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"GatewayId": {
"Type": "String",
"Description": {
"en": "The ID of the Cloud Native API Gateway."
},
"Required": true,
"AssociationProperty":"ALIYUN::APIG::Gateway::GatewayId"
}
},
"Resources": {
"ExtensionResource": {
"Type": "ALIYUN::APIG::Service",
"Properties": {
"GatewayId": {
"Ref": "GatewayId"
},
"SourceType": "DNS",
"ServiceName": "test1",
"Addresses": [
"ros.test:80",
"ros.test:801"
]
}
}
},
"Outputs": {
"Addresses": {
"Description": "Service Address List.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"Addresses"
]
}
},
"ServiceName": {
"Description": "The name of the service.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"ServiceName"
]
}
},
"SourceType": {
"Description": "Service source type.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"SourceType"
]
}
},
"GatewayId": {
"Description": "The ID of the Cloud Native API Gateway.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"GatewayId"
]
}
},
"ServiceId": {
"Description": "The ID of the service.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"ServiceId"
]
}
}
}
}