-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Add RedirectConfiguration to support the redirect routing rule #4943
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
81caab7
Add the redirect configuration to support the redirect route
2ac4eec
Add the examples for rediret routing rrule
2fe92e4
Capitalize the first letter of Redirect
0cb338a
Change the structure of a RouteRule Enum value
3c896b9
Add the routeType property
d38f7ca
Replace the boolean type with an Enum type with proper string values
045d7a0
Update the examples
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
160 changes: 160 additions & 0 deletions
160
...osoft.Network/preview/2018-08-01-preview/examples/FrontdoorRedirectRoutingRuleCreate.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,160 @@ | ||
| { | ||
| "parameters": { | ||
| "api-version": "2018-08-01", | ||
| "subscriptionId": "subid", | ||
| "resourceGroupName": "rg1", | ||
| "frontDoorName": "frontDoor1", | ||
| "routingRuleName": "redirectRoutingRule1", | ||
| "routingRuleParameters": { | ||
| "name": "redirectRoutingRule1", | ||
| "properties": { | ||
| "routeType": [ | ||
| "Redirect" | ||
| ], | ||
| "frontendEndpoints": [ | ||
| { | ||
| "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/frontDoors/frontDoor1/frontendEndpoints/frontendEndpoint1" | ||
| }, | ||
| { | ||
| "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/frontDoors/frontDoor1/frontendEndpoints/default" | ||
| } | ||
| ], | ||
| "acceptedProtocols": [ | ||
| "Https" | ||
| ], | ||
| "patternsToMatch": [ | ||
| "/*" | ||
| ], | ||
| "redirectConfiguration": { | ||
| "redirectType": [ | ||
| "Moved(301)" | ||
| ], | ||
| "destinationProtocol": [ | ||
| "MatchRequest" | ||
| ], | ||
| "destinationHost": "www.bing.com", | ||
| "destinationPath": "/api", | ||
| "preservePath": "false", | ||
| "preserveQueryString": "true" | ||
| }, | ||
| "enabledState": "Enabled" | ||
| } | ||
| } | ||
| }, | ||
| "responses": { | ||
| "200": { | ||
| "body": { | ||
| "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/frontDoors/frontDoor1/redirectRoutingRule1", | ||
| "name": "redirectRoutingRule1", | ||
| "properties": { | ||
| "routeType": [ | ||
| "Redirect" | ||
| ], | ||
| "frontendEndpoints": [ | ||
| { | ||
| "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/frontDoors/frontDoor1/frontendEndpoints/frontendEndpoint1" | ||
| }, | ||
| { | ||
| "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/frontDoors/frontDoor1/frontendEndpoints/default" | ||
| } | ||
| ], | ||
| "acceptedProtocols": [ | ||
| "Https" | ||
| ], | ||
| "patternsToMatch": [ | ||
| "/*" | ||
| ], | ||
| "redirectConfiguration": { | ||
| "redirectType": [ | ||
| "Moved(301)" | ||
| ], | ||
| "destinationProtocol": [ | ||
| "MatchRequest" | ||
| ], | ||
| "destinationHost": "www.bing.com", | ||
| "destinationPath": "/api", | ||
| "preservePath": "false", | ||
| "preserveQueryString": "true" | ||
| }, | ||
| "enabledState": "Enabled" | ||
| } | ||
| } | ||
| }, | ||
| "201": { | ||
| "body": { | ||
| "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/frontDoors/frontDoor1/redirectRoutingRule1", | ||
| "name": "redirectRoutingRule1", | ||
| "properties": { | ||
| "routeType": [ | ||
| "Redirect" | ||
| ], | ||
| "frontendEndpoints": [ | ||
| { | ||
| "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/frontDoors/frontDoor1/frontendEndpoints/frontendEndpoint1" | ||
| }, | ||
| { | ||
| "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/frontDoors/frontDoor1/frontendEndpoints/default" | ||
| } | ||
| ], | ||
| "acceptedProtocols": [ | ||
| "Https" | ||
| ], | ||
| "patternsToMatch": [ | ||
| "/*" | ||
| ], | ||
| "redirectConfiguration": { | ||
| "redirectType": [ | ||
| "Moved(301)" | ||
| ], | ||
| "destinationProtocol": [ | ||
| "MatchRequest" | ||
| ], | ||
| "destinationHost": "www.bing.com", | ||
| "destinationPath": "/api", | ||
| "preservePath": "false", | ||
| "preserveQueryString": "true" | ||
| }, | ||
| "enabledState": "Enabled" | ||
| } | ||
| } | ||
| }, | ||
| "202": { | ||
| "body": { | ||
| "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/frontDoors/frontDoor1/redirectRoutingRule1", | ||
| "name": "redirectRoutingRule1", | ||
| "properties": { | ||
| "routeType": [ | ||
| "Redirect" | ||
| ], | ||
| "frontendEndpoints": [ | ||
| { | ||
| "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/frontDoors/frontDoor1/frontendEndpoints/frontendEndpoint1" | ||
| }, | ||
| { | ||
| "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/frontDoors/frontDoor1/frontendEndpoints/default" | ||
| } | ||
| ], | ||
| "acceptedProtocols": [ | ||
| "Https" | ||
| ], | ||
| "patternsToMatch": [ | ||
| "/*" | ||
| ], | ||
| "redirectConfiguration": { | ||
| "redirectType": [ | ||
| "Moved(301)" | ||
| ], | ||
| "destinationProtocol": [ | ||
| "MatchRequest" | ||
| ], | ||
| "destinationHost": "www.bing.com", | ||
| "destinationPath": "/api", | ||
| "preservePath": "false", | ||
| "preserveQueryString": "true" | ||
| }, | ||
| "enabledState": "Enabled" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
49 changes: 49 additions & 0 deletions
49
...icrosoft.Network/preview/2018-08-01-preview/examples/FrontdoorRedirectRoutingRuleGet.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| { | ||
| "parameters": { | ||
| "api-version": "2018-08-01", | ||
| "subscriptionId": "subid", | ||
| "resourceGroupName": "rg1", | ||
| "frontDoorName": "frontDoor1", | ||
| "routingRuleName": "redirectRoutingRule1" | ||
| }, | ||
| "responses": { | ||
| "200": { | ||
| "body": { | ||
| "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/frontDoors/frontDoor1/redirectRoutingRule1", | ||
| "name": "redirectRoutingRule1", | ||
| "properties": { | ||
| "routeType": [ | ||
| "Redirect" | ||
| ], | ||
| "frontendEndpoints": [ | ||
| { | ||
| "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/frontDoors/frontDoor1/frontendEndpoints/frontendEndpoint1" | ||
| }, | ||
| { | ||
| "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/frontDoors/frontDoor1/frontendEndpoints/default" | ||
| } | ||
| ], | ||
| "acceptedProtocols": [ | ||
| "Https" | ||
| ], | ||
| "patternsToMatch": [ | ||
| "/*" | ||
| ], | ||
| "redirectConfiguration": { | ||
| "redirectType": [ | ||
| "Moved(301)" | ||
| ], | ||
| "destinationProtocol": [ | ||
| "Https" | ||
| ], | ||
| "destinationHost": "www.bing.com", | ||
| "destinationPath": "/api", | ||
| "preservePath": "false", | ||
| "preserveQueryString": "true" | ||
| }, | ||
| "enabledState": "Enabled" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -431,8 +431,11 @@ | |
| } | ||
| }, | ||
| "x-ms-examples": { | ||
| "Get Routing Rule": { | ||
| "Get Forward Routing Rule": { | ||
| "$ref": "./examples/FrontdoorRoutingRuleGet.json" | ||
| }, | ||
| "Get Redirect Routing Rule": { | ||
| "$ref": "./examples/FrontdoorRedirectRoutingRuleGet.json" | ||
| } | ||
| } | ||
| }, | ||
|
|
@@ -495,8 +498,11 @@ | |
| } | ||
| }, | ||
| "x-ms-examples": { | ||
| "Create or update specific Routing Rule": { | ||
| "Create or update specific Forward Routing Rule": { | ||
| "$ref": "./examples/FrontdoorRoutingRuleCreate.json" | ||
| }, | ||
| "Create or update specific Rediret Routing Rule": { | ||
| "$ref": "./examples/FrontdoorRedirectRoutingRuleCreate.json" | ||
| } | ||
| }, | ||
| "x-ms-long-running-operation": true | ||
|
|
@@ -1740,6 +1746,18 @@ | |
| "description": "Routing rules to apply to an endpoint", | ||
| "type": "object", | ||
| "properties": { | ||
| "routeType": { | ||
| "type": "string", | ||
| "enum": [ | ||
| "Forward", | ||
| "Redirect" | ||
| ], | ||
| "x-ms-enum": { | ||
| "name": "FrontDoorRouteType", | ||
| "modelAsString": true | ||
| }, | ||
| "description": "Route type." | ||
| }, | ||
| "frontendEndpoints": { | ||
| "description": "Frontend endpoints associated with this rule", | ||
| "type": "array", | ||
|
|
@@ -1808,6 +1826,67 @@ | |
| "name": "FrontDoorEnabledState", | ||
| "modelAsString": true | ||
| } | ||
| }, | ||
| "redirectConfiguration": { | ||
| "description": "A reference to the redirect routing configuration. ", | ||
| "$ref": "./network.json#/definitions/RedirectConfiguration" | ||
| } | ||
| } | ||
| }, | ||
| "RedirectConfiguration": { | ||
| "description": "The configuration for a redirect routing rule. This object is needed only if the type property of RoutingRule is set to Redirect. ", | ||
| "type": "object", | ||
| "properties": { | ||
| "redirectType": { | ||
| "description": "The redirect type the rule will use when redirecting traffic.", | ||
| "type": "string", | ||
| "enum": [ | ||
| "Moved(301)", | ||
| "Found(302)", | ||
| "TemporaryRedirect(307)", | ||
| "PermanentRedirect(308)" | ||
| ], | ||
| "x-ms-enum": { | ||
| "name": "FrontDoorRedirectProtocol", | ||
| "modelAsString": true | ||
| } | ||
| }, | ||
| "destinationProtocol": { | ||
| "description": "The protocol of the destination where the traffic is forwarded to", | ||
| "type": "string", | ||
| "enum": [ | ||
| "MatchRequest", | ||
| "Http", | ||
| "Https" | ||
| ], | ||
| "x-ms-enum": { | ||
| "name": "FrontDoorDestinationProtocol", | ||
| "modelAsString": true | ||
| } | ||
| }, | ||
| "destinationHost": { | ||
| "type": "string", | ||
| "description": "If left blank, then we will use the incoming host as the destination host." | ||
| }, | ||
| "destinationPath": { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: you can use pattern specifiers to enforce this. Not blocking on this. |
||
| "type": "string", | ||
| "description": "Path cannot be empty and must start with /." | ||
| }, | ||
| "destinationFragment": { | ||
| "type": "string", | ||
| "description": "Fragment is the part of the URL that comes after #. Do not include the #." | ||
| }, | ||
| "preservePath": { | ||
| "description": "Indicates whether the path is preserved.", | ||
| "type": "boolean" | ||
| }, | ||
| "preserveQueryString": { | ||
| "description": "Indicates whether the query string is preserved.", | ||
| "type": "boolean" | ||
| }, | ||
| "extraQueryString": { | ||
| "description": "Any string to be added to the query string in the destination URL. ? and & will be added automatically so do not include them.", | ||
| "type": "string" | ||
| } | ||
| } | ||
| }, | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The SharedSchema use "destinationSchema", better to be consistent
the other fields are already consistent