Rules Engines - List By Front Door
列出 Front Door 中的所有规则引擎配置。
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/rulesEngines?api-version=2021-06-01
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
front
|
path | True |
string minLength: 5maxLength: 64 pattern: ^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$ |
全局唯一的 Front Door 的名称。 |
resource
|
path | True |
string minLength: 1maxLength: 80 pattern: ^[a-zA-Z0-9_\-\(\)\.]*[^\.]$ |
Azure 订阅中的资源组的名称。 |
subscription
|
path | True |
string |
唯一标识 Azure 订阅Microsoft的订阅凭据。 订阅 ID 构成了每个服务调用的 URI 的一部分。 |
api-version
|
query | True |
string |
客户端 API 版本。 |
响应
名称 | 类型 | 说明 |
---|---|---|
200 OK |
好的 |
|
Other Status Codes |
Front Door 错误响应,描述作失败的原因。 |
安全性
azure_auth
Azure Active Directory OAuth2 Flow
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
名称 | 说明 |
---|---|
user_impersonation | 模拟用户帐户 |
示例
List Rules Engine Configurations in a Front Door
示例请求
示例响应
{
"value": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/frontDoors/frontDoor1/rulesEngines/rulesEngine1",
"name": "rulesEngine1",
"properties": {
"rules": [
{
"name": "Rule1",
"priority": 1,
"action": {
"routeConfigurationOverride": {
"@odata.type": "#Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration",
"redirectType": "Moved",
"redirectProtocol": "HttpsOnly",
"customHost": "www.bing.com",
"customPath": "/api",
"customFragment": "fragment",
"customQueryString": "a=b"
}
},
"matchConditions": [
{
"rulesEngineMatchVariable": "RemoteAddr",
"rulesEngineOperator": "GeoMatch",
"rulesEngineMatchValue": [
"CH"
]
}
],
"matchProcessingBehavior": "Stop"
},
{
"name": "Rule2",
"priority": 2,
"action": {
"responseHeaderActions": [
{
"headerActionType": "Overwrite",
"headerName": "Cache-Control",
"value": "public, max-age=31536000"
}
]
},
"matchConditions": [
{
"rulesEngineMatchVariable": "RequestFilenameExtension",
"rulesEngineOperator": "Equal",
"rulesEngineMatchValue": [
"jpg"
],
"transforms": [
"Lowercase"
]
}
]
},
{
"name": "Rule3",
"priority": 3,
"action": {
"routeConfigurationOverride": {
"@odata.type": "#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration",
"customForwardingPath": null,
"forwardingProtocol": "HttpsOnly",
"cacheConfiguration": {
"queryParameterStripDirective": "StripOnly",
"queryParameters": "a=b,p=q",
"dynamicCompression": "Disabled",
"cacheDuration": "P1DT12H20M30S"
},
"backendPool": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/frontDoors/frontDoor1/backendPools/backendPool1"
}
}
},
"matchConditions": [
{
"rulesEngineMatchVariable": "RequestHeader",
"rulesEngineOperator": "Equal",
"rulesEngineMatchValue": [
"allowoverride"
],
"transforms": [
"Lowercase"
],
"negateCondition": false,
"selector": "Rules-Engine-Route-Forward"
}
]
}
]
}
}
]
}
定义
名称 | 说明 |
---|---|
Cache |
缓存类型路由的缓存设置。 若要禁用缓存,请不要提供 cacheConfiguration 对象。 |
Dynamic |
是否对缓存内容使用动态压缩 |
Error |
错误响应指示 Front Door 服务无法处理传入请求。 错误消息中提供了原因。 |
Forwarding |
描述转发路由。 |
Front |
将流量转发到后端时,此规则将使用协议。 |
Front |
在形成缓存密钥时处理 URL 查询词。 |
Front |
将流量重定向到的目标的协议 |
Front |
重定向流量时规则将使用的重定向类型。 |
Front |
Front Door 或 Front Door 子资源的资源状态。 |
Header |
可以作 http 标头的作。 |
header |
要应用于标头的作类型。 |
Match |
如果此规则是匹配规则,则规则引擎应继续运行剩余规则或停止。 如果不存在,则默认为“继续”。 |
Redirect |
描述重定向路由。 |
Rules |
一个规则引擎配置,其中包含将运行以修改请求和响应的运行时行为的规则列表。 |
Rules |
将执行的一个或多个作,修改请求和/或响应。 |
Rules |
列出规则引擎配置的请求的结果。 它包含 RulesEngine 对象列表和 URL 链接,用于获取下一组结果。 |
Rules |
定义匹配条件 |
Rules |
匹配变量 |
Rules |
描述要应用于匹配条件的运算符。 |
Rules |
包含匹配条件的列表,以及有关如何修改请求/响应的作。 如果多个规则匹配,则与上一个规则冲突的一个规则的作将覆盖单一作,或在标头作的情况下追加作。 |
Sub |
对另一个子资源的引用。 |
transform |
描述在匹配之前应用了哪些转换 |
CacheConfiguration
缓存类型路由的缓存设置。 若要禁用缓存,请不要提供 cacheConfiguration 对象。
名称 | 类型 | 说明 |
---|---|---|
cacheDuration |
string (duration) |
需要缓存内容的持续时间。 允许的格式采用 ISO 8601 格式(http://en.wikipedia.org/wiki/ISO_8601#Durations)。 HTTP 要求该值不超过一年 |
dynamicCompression |
是否对缓存内容使用动态压缩 |
|
queryParameterStripDirective |
在形成缓存密钥时处理 URL 查询词。 |
|
queryParameters |
string |
要包含或排除的查询参数(逗号分隔)。 |
DynamicCompressionEnabled
是否对缓存内容使用动态压缩
值 | 说明 |
---|---|
Disabled | |
Enabled |
ErrorResponse
错误响应指示 Front Door 服务无法处理传入请求。 错误消息中提供了原因。
名称 | 类型 | 说明 |
---|---|---|
code |
string |
错误代码。 |
message |
string |
指示操作失败的原因的错误消息。 |
ForwardingConfiguration
描述转发路由。
名称 | 类型 | 说明 |
---|---|---|
@odata.type |
string:
#Microsoft. |
|
backendPool |
对此规则路由到的 BackendPool 的引用。 |
|
cacheConfiguration |
与此规则关联的缓存配置。 |
|
customForwardingPath |
string |
用于重写此规则匹配的资源路径的自定义路径。 留空以使用传入路径。 |
forwardingProtocol |
将流量转发到后端时,此规则将使用协议。 |
FrontDoorForwardingProtocol
将流量转发到后端时,此规则将使用协议。
值 | 说明 |
---|---|
HttpOnly | |
HttpsOnly | |
MatchRequest |
FrontDoorQuery
在形成缓存密钥时处理 URL 查询词。
值 | 说明 |
---|---|
StripAll | |
StripAllExcept | |
StripNone | |
StripOnly |
FrontDoorRedirectProtocol
将流量重定向到的目标的协议
值 | 说明 |
---|---|
HttpOnly | |
HttpsOnly | |
MatchRequest |
FrontDoorRedirectType
重定向流量时规则将使用的重定向类型。
值 | 说明 |
---|---|
Found | |
Moved | |
PermanentRedirect | |
TemporaryRedirect |
FrontDoorResourceState
Front Door 或 Front Door 子资源的资源状态。
值 | 说明 |
---|---|
Creating | |
Deleting | |
Disabled | |
Disabling | |
Enabled | |
Enabling | |
Migrated | |
Migrating |
HeaderAction
可以作 http 标头的作。
名称 | 类型 | 说明 |
---|---|---|
headerActionType |
要应用于标头的作类型。 |
|
headerName |
string |
此作将应用到的标头的名称。 |
value |
string |
要更新给定标头名称的值。 如果 actionType 为 Delete,则不使用此值。 |
headerActionType
要应用于标头的作类型。
值 | 说明 |
---|---|
Append | |
Delete | |
Overwrite |
MatchProcessingBehavior
如果此规则是匹配规则,则规则引擎应继续运行剩余规则或停止。 如果不存在,则默认为“继续”。
值 | 说明 |
---|---|
Continue | |
Stop |
RedirectConfiguration
描述重定向路由。
名称 | 类型 | 说明 |
---|---|---|
@odata.type |
string:
#Microsoft. |
|
customFragment |
string |
要添加到重定向 URL 的片段。 片段是 #之后 URL 的一部分。 请勿包含 #。 |
customHost |
string |
要重定向的主机。 将传入主机保留为空,以将传入主机用作目标主机。 |
customPath |
string |
要重定向的完整路径。 路径不能为空,必须以 /开头。 将传入路径保留为空,以用作目标路径。 |
customQueryString |
string |
要放置在重定向 URL 中的查询字符串集。 设置此值将替换任何现有查询字符串;保留空以保留传入的查询字符串。 查询字符串必须采用 = 格式。 第一个? 并且会自动添加 &,因此不要在前面包含它们,但使用 &分隔多个查询字符串。 |
redirectProtocol |
将流量重定向到的目标的协议 |
|
redirectType |
重定向流量时规则将使用的重定向类型。 |
RulesEngine
一个规则引擎配置,其中包含将运行以修改请求和响应的运行时行为的规则列表。
名称 | 类型 | 说明 |
---|---|---|
id |
string |
资源 ID。 |
name |
string |
资源名称。 |
properties.resourceState |
Front Door 或 Front Door 子资源的资源状态。 |
|
properties.rules |
定义特定规则引擎配置的规则列表。 |
|
type |
string |
资源类型。 |
RulesEngineAction
将执行的一个或多个作,修改请求和/或响应。
名称 | 类型 | 说明 |
---|---|---|
requestHeaderActions |
要从 AFD 到源的请求中应用的标头作列表。 |
|
responseHeaderActions |
要从 AFD 响应应用到客户端的标头作的列表。 |
|
routeConfigurationOverride | RouteConfiguration: |
重写路由配置。 |
RulesEngineListResult
列出规则引擎配置的请求的结果。 它包含 RulesEngine 对象列表和 URL 链接,用于获取下一组结果。
名称 | 类型 | 说明 |
---|---|---|
nextLink |
string |
用于获取下一组 RulesEngine 对象的 URL(如果有)。 |
value |
Front Door 中的 rulesEngines 列表。 |
RulesEngineMatchCondition
定义匹配条件
名称 | 类型 | 说明 |
---|---|---|
negateCondition |
boolean |
描述这是否为否定条件 |
rulesEngineMatchValue |
string[] |
匹配要匹配的值。 运算符将应用于此处具有 OR 语义的每个值。 如果其中任何一个匹配变量与给定运算符匹配,则此匹配条件被视为匹配。 |
rulesEngineMatchVariable |
匹配变量 |
|
rulesEngineOperator |
描述要应用于匹配条件的运算符。 |
|
selector |
string |
要匹配的 RequestHeader 或 RequestBody 中的选择器的名称 |
transforms |
转换列表 |
RulesEngineMatchVariable
匹配变量
值 | 说明 |
---|---|
IsMobile | |
PostArgs | |
QueryString | |
RemoteAddr | |
RequestBody | |
RequestFilename | |
RequestFilenameExtension | |
RequestHeader | |
RequestMethod | |
RequestPath | |
RequestScheme | |
RequestUri |
RulesEngineOperator
描述要应用于匹配条件的运算符。
值 | 说明 |
---|---|
Any | |
BeginsWith | |
Contains | |
EndsWith | |
Equal | |
GeoMatch | |
GreaterThan | |
GreaterThanOrEqual | |
IPMatch | |
LessThan | |
LessThanOrEqual |
RulesEngineRule
包含匹配条件的列表,以及有关如何修改请求/响应的作。 如果多个规则匹配,则与上一个规则冲突的一个规则的作将覆盖单一作,或在标头作的情况下追加作。
名称 | 类型 | 说明 |
---|---|---|
action |
如果满足所有匹配条件,则对请求和响应执行的作。 |
|
matchConditions |
必须满足的匹配条件列表,以便运行此规则的作。 没有匹配条件意味着作将始终运行。 |
|
matchProcessingBehavior |
如果此规则是匹配规则,则规则引擎应继续运行剩余规则或停止。 如果不存在,则默认为“继续”。 |
|
name |
string |
要引用此特定规则的名称。 |
priority |
integer |
分配给此规则的优先级。 |
SubResource
对另一个子资源的引用。
名称 | 类型 | 说明 |
---|---|---|
id |
string |
资源 ID。 |
transform
描述在匹配之前应用了哪些转换
值 | 说明 |
---|---|
Lowercase | |
RemoveNulls | |
Trim | |
Uppercase | |
UrlDecode | |
UrlEncode |