Get Redirection Rules
Get redirection rules for website accleration domain.
Request
Request-Line
GET /waap/v1.0/services/{serviceId}/redirections HTTP/1.1
Request Parameters
Path Parameters
Parameter | Type | Required | Description |
---|---|---|---|
serviceId | Integer | Mandatory | Service ID. |
Response
Response Body
Parameter | Type | Required | Description |
---|---|---|---|
Array | Mandatory | Array of Redirection Rule. |
Object: Redirection Rule
Parameter | Type | Required | Description |
---|---|---|---|
ruleId | Integer | Mandatory | Rule ID number for redirection. |
name | String | Mandatory | Rule name for access control. |
matchUrlPath | Object | Mandatory | URL path matching configuration that determines which requests the rule applies to. See Match Url Path for details. |
matchQueryString | Object | Optional | Query-string matching configuration used to refine which requests the rule applies to. See Match Query String for details. |
priority | Integer | Mandatory | Priority weight for the rule. Rules with a higher weight take precedence. The weight must be non-zero. |
redirectionURL | String | Mandatory | Send an HTTP redirect if this policy matches. |
statusCode | Integer | Mandatory | HTTP response code to use if sending an HTTP redirect. Could be "301/302". |
enabled | Boolean | Mandatory | Flag indicating whether the rule is active. |
Object: Match Url Path
Parameter | Type | Required | Description |
---|---|---|---|
operator | String | Mandatory | Defines how to match the field. Supported values:prefix,regex,equals,suffix. |
patterns | String[] | Mandatory | List of patterns to match what against. If any of the patterns matches then the match succeeds. |
Object: Match Query String
Parameter | Type | Required | Description |
---|---|---|---|
operator | String | Mandatory | Defines how to match the field. Supported values:prefix,regex,equals,suffix. |
patterns | String[] | Mandatory | List of patterns to match what against. If any of the patterns matches then the match succeeds. |
Status Codes, Error Codes and Error Messages
Status Code | Error Code | Error Message |
---|---|---|
400 | ServiceId.Invalid | ServiceId is empty or invalid. |
400 | Redirection.OperationFailed | The redirection operation failed. |
404 | ServiceId.NotFound | ServiceId is not found. |
Examples
Get Redirection Rules
Request
GET /waap/v1.0/services/12345/redirections HTTP/1.1
Successful Response Body
[
{
"name": "test",
"priority": 12,
"enabled": true,
"ruleId": 261704,
"matchUrlPath": {
"operator": "prefix",
"patterns": [
"/"
]
},
"redirectionURL": "http://www.example.com/404.html",
"statusCode": 302
},
{
"name": "test",
"priority": 11,
"enabled": true,
"ruleId": 261703,
"matchUrlPath": {
"operator": "prefix",
"patterns": [
"/"
]
},
"matchQueryString": {
"operator": "prefix",
"patterns": [
"name1=1",
"name2=2"
]
},
"redirectionURL": "http://www.example.com/404.html",
"statusCode": 302
}
]