The ALIYUN::MSE::GatewayRoute resource is used to add a gateway route.
Syntax
{
"Type": "ALIYUN::MSE::GatewayRoute",
"Properties": {
"DomainIdList": List,
"GatewayUniqueId": String,
"Name": String,
"Description": String,
"DestinationType": String,
"DomainId": Integer,
"DirectResponseJSON": Map,
"FallbackServices": List,
"Fallback": Boolean,
"GatewayId": Integer,
"Policies": String,
"Predicates": Map,
"RouteType": String,
"RouteOrder": Integer,
"RedirectJSON": Map,
"Services": List
}
}Properties
Property | Type | Required | Update allowed | Description | Constraints |
DomainIdList | List | Yes | Yes | The list of domain IDs. | None |
GatewayUniqueId | String | Yes | No | The unique ID of the gateway. | None |
Name | String | Yes | Yes | The name of the route. | None |
Description | String | No | Yes | The description of the route. | None |
DestinationType | String | No | Yes | The type of the destination service. | Valid values:
|
DomainId | Integer | No | Yes | The ID of the domain. | None |
DirectResponseJSON | Map | No | Yes | The configurations for a mock response. | For more information, see DirectResponseJSON properties. |
FallbackServices | List | No | Yes | The fallback services. | For more information, see FallbackServices properties. |
Fallback | Boolean | No | Yes | Specifies whether to enable the fallback service. | None |
GatewayId | Integer | No | Yes | The ID of the gateway. | None |
Policies | String | No | Yes | The routing policy, in a JSON string format. | None |
Predicates | Map | No | Yes | The matching rules. | For more information, see Predicates properties. |
RouteType | String | No | Yes | The type of the route. | Valid values:
|
RouteOrder | Integer | No | Yes | The order of the route. | A smaller value indicates a higher priority. |
RedirectJSON | Map | No | Yes | The redirection configurations. | For more information, see RedirectJSON properties. |
Services | List | No | Yes | The list of services. | Specify this parameter when the destination is a single service, multiple services, or used for tag-based routing. For more information, see Services properties. |
Services syntax
"Services": [
{
"AgreementType": String,
"GroupName": String,
"ServicePort": Integer,
"Percent": Integer,
"Version": String,
"SourceType": String,
"HttpDubboTranscoder": Map,
"Namespace": String,
"Name": String,
"ServiceId": Integer
}
]Services properties
Property | Type | Required | Update allowed | Description | Constraints |
AgreementType | String | No | No | The protocol type. | None |
GroupName | String | No | No | The name of the service group. | None |
HttpDubboTranscoder | Map | No | No | The Dubbo protocol transformer. | For more information, see HttpDubboTranscoder properties. |
Namespace | String | No | No | The namespace where the service resides. | None |
Name | String | No | No | The name of the service. | None |
Percent | Integer | No | No | The percentage of traffic to be routed to the current service or service version. | Specify this parameter only when you use multiple services or tag-based routing. |
ServicePort | Integer | No | Yes | The service port. | None |
SourceType | String | No | No | The source type. | None |
ServiceId | Integer | No | No | The service ID. | None |
Version | String | No | No | The service version. | Specify this parameter only when you use tag-based routing. |
HttpDubboTranscoder syntax
"HttpDubboTranscoder": {
"DubboServiceName": String,
"MothedMapList": List,
"DubboServiceGroup": String,
"DubboServiceVersion": String
}HttpDubboTranscoder properties
Property | Type | Required | Update allowed | Description | Constraints |
DubboServiceName | String | No | No | The name of the Dubbo service. | None |
DubboServiceGroup | String | No | No | The service group. | None |
DubboServiceVersion | String | No | No | The version of the Dubbo service. | None |
MothedMapList | List | No | No | The list of Dubbo forwarding rules. | For more information, see MothedMapList properties. |
MothedMapList syntax
"MothedMapList": [
{
"DubboMothedName": String,
"Mothedpath": String,
"PassThroughList": List,
"HttpMothed": String,
"ParamMapsList": List,
"PassThroughAllHeaders": String
}
]MothedMapList properties
Property | Type | Required | Update allowed | Description | Constraints |
DubboMothedName | String | No | No | The name of the Dubbo method. | None |
HttpMothed | String | No | No | The HTTP method. | The supported HTTP methods. Valid values:
|
Mothedpath | String | No | No | The path to match for the method. | None |
PassThroughList | List | No | No | The list of headers to pass through. | None |
ParamMapsList | List | No | No | The list of parameter mappings. | For more information, see ParamMapsList properties. |
PassThroughAllHeaders | String | No | No | The header pass-through type. | The enumeration of pass-through types.
|
ParamMapsList syntax
"ParamMapsList": [
{
"MappingType": String,
"ExtractKeySpec": String,
"ExtractKey": String
}
]ParamMapsList properties
Property | Type | Required | Update allowed | Description | Constraints |
ExtractKeySpec | String | No | No | The position of the request parameter. | Valid values:
|
ExtractKey | String | No | No | The key used to extract the request parameter. | None |
MappingType | String | No | No | The type of the backend parameter. | None |
RedirectJSON syntax
"RedirectJSON": {
"Path": String,
"Host": String,
"Code": Integer
}RedirectJSON properties
Property | Type | Required | Update allowed | Description | Constraints |
Code | Integer | No | No | The return code. | None |
Host | String | No | No | The hostname for redirection. | None |
Path | String | No | No | The path for redirection. | None |
DirectResponseJSON syntax
"DirectResponseJSON": {
"Body": String,
"Code": Integer
}DirectResponseJSON properties
Property | Type | Required | Update allowed | Description | Constraints |
Body | String | No | No | The mock return value. | None |
Code | Integer | No | No | The mock return code. | None |
FallbackServices syntax
"FallbackServices": [
{
"AgreementType": String,
"GroupName": String,
"ServicePort": Integer,
"Percent": Integer,
"Version": String,
"SourceType": String,
"Namespace": String,
"Name": String,
"ServiceId": Integer
}
]FallbackServices properties
Property | Type | Required | Update allowed | Description | Constraints |
AgreementType | String | No | No | The protocol type. | None |
GroupName | String | No | No | The name of the service group. | None |
Namespace | String | No | No | The namespace where the service resides. | None |
Name | String | No | No | The name. | None |
Percent | Integer | No | No | The percentage of traffic to be routed to the current service or service version. | Specify this parameter only when you use multiple services or tag-based routing. |
ServicePort | Integer | No | No | The service port. | None |
SourceType | String | No | No | The source type. | None |
ServiceId | Integer | No | No | The service ID. | None |
Version | String | No | No | The service version. | None |
Predicates syntax
"Predicates": {
"HeaderPredicates": List,
"MethodPredicates": List,
"QueryPredicates": List,
"PathPredicates": Map
}Predicates properties
Property | Type | Required | Update allowed | Description | Constraints |
HeaderPredicates | List | No | No | The request header matching rules. | For more information, see HeaderPredicates properties. |
MethodPredicates | List | No | No | The method matching rules. | {'Length': {'Max': 20}} |
PathPredicates | Map | No | No | The path matching rules. | For more information, see PathPredicates properties. |
QueryPredicates | List | No | No | The URL parameter matching rules. | For more information, see QueryPredicates properties. |
HeaderPredicates syntax
"HeaderPredicates": [
{
"Type": String,
"Value": String,
"Key": String
}
]HeaderPredicates properties
Property | Type | Required | Update allowed | Description | Constraints |
Key | String | No | No | The key of the request header. | None |
Type | String | No | No | The matching type. | None |
Value | String | No | No | The corresponding value. | None |
QueryPredicates syntax
"QueryPredicates": [
{
"Type": String,
"Value": String,
"Key": String
}
]QueryPredicates properties
Property | Type | Required | Update allowed | Description | Constraints |
Key | String | No | No | The parameter name. | None |
Type | String | No | No | The matching type. | None |
Value | String | No | No | The value to match. | None |
PathPredicates syntax
"PathPredicates": {
"Path": String,
"Type": String,
"IgnoreCase": Boolean
}PathPredicates properties
Property | Type | Required | Update allowed | Description | Constraints |
IgnoreCase | Boolean | No | No | None Specifies whether to ignore case when matching paths. | None |
Path | String | No | No | The path. | None |
Type | String | No | No | The path matching type. | Valid values:
|
Return values
Fn::GetAtt
RouteId: The ID of the route.
Examples
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
Name:
Required: true
Type: String
Description:
en: The name of the route.
DomainIdList:
AssociationProperty: List[Parameter]
AssociationPropertyMetadata:
Parameter:
Default: Null
Required: false
Type: String
Description:
en: The domain ID in JSON format.
Required: true
Type: Json
Description:
en: The list of domain IDs in JSON format.
GatewayUniqueId:
Required: true
Type: String
Description:
en: The unique ID of the gateway.
Resources:
GatewayRoute:
Type: ALIYUN::MSE::GatewayRoute
Properties:
Name:
Ref: Name
DomainIdList:
Ref: DomainIdList
GatewayUniqueId:
Ref: GatewayUniqueId
Outputs:
RouteId:
Description: The ID of the route.
Value:
Fn::GetAtt:
- GatewayRoute
- RouteId
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"Name": {
"Required": true,
"Type": "String",
"Description": {
"en": "The name of the route."
}
},
"DomainIdList": {
"AssociationProperty": "List[Parameter]",
"AssociationPropertyMetadata": {
"Parameter": {
"Default": null,
"Required": false,
"Type": "String",
"Description": {
"en": "The domain ID in JSON format."
}
}
},
"Required": true,
"Type": "Json",
"Description": {
"en": "The list of domain IDs in JSON format."
}
},
"GatewayUniqueId": {
"Required": true,
"Type": "String",
"Description": {
"en": "The unique ID of the gateway."
}
}
},
"Resources": {
"GatewayRoute": {
"Type": "ALIYUN::MSE::GatewayRoute",
"Properties": {
"Name": {
"Ref": "Name"
},
"DomainIdList": {
"Ref": "DomainIdList"
},
"GatewayUniqueId": {
"Ref": "GatewayUniqueId"
}
}
}
},
"Outputs": {
"RouteId": {
"Description": "The ID of the route.",
"Value": {
"Fn::GetAtt": [
"GatewayRoute",
"RouteId"
]
}
}
}
}