Queries the forwarding rules that are configured for a specified listener.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | DescribeRules |
The operation that you want to perform. Set the value to DescribeRules. |
ListenerPort | Integer | Yes | 90 |
The frontend listener port that is used by the Server Load Balancer (SLB) instance. Valid values: 1 to 65535. |
LoadBalancerId | String | Yes | lb-bp1ca0zt07t934**** |
The ID of the SLB instance. |
RegionId | String | Yes | cn-hangzhou |
The ID of the region where the SLB instance is deployed. You can call the DescribeRegions operation to query the most recent region list. |
ListenerProtocol | String | No | https |
The frontend listener protocol that is used by the SLB instance. Note This parameter is required when listeners that use different protocols listen on the
same port.
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 9DEC9C28-AB05-4DDF-9A78-6B08EC9CE18C |
The ID of the request. |
Rules | Array of Rule |
The list of forwarding rules. |
|
Rule | |||
RuleId | String | rule-tybqi6**** |
The ID of the forwarding rule. |
RuleName | String | Rule2 |
The name of the forwarding rule. The name must be 1 to 80 characters in length, and can contain only letters, digits, hyphens (-), forward slashes (/), periods (.),and underscores (_). Note The name of each forwarding rule must be unique within a listener.
|
Domain | String | test.com |
The requested domain name specified in the forwarding rule. |
Url | String | /cache |
The requested path specified in the forwarding rule. |
VServerGroupId | String | rsp-6cejjzl**** |
The ID of the destination vServer group specified in the forwarding rule. |
Cookie | String | 23 |
The cookie that is configured on the backend server. The value must be 1 to 200 characters in length, and can contain only ASCII letters and digits. It cannot contain commas (,), semicolons (;), or spaces. It cannot start with a dollar sign ($). Note If you set the StickySession parameter to on and the StickySessionType parameter to server, this parameter is required.
|
CookieTimeout | Integer | 56 |
The timeout period of a cookie. Valid values: 1 to 86400. Unit: seconds. Note If you set the StickySession parameter to on and the StickySessionType parameter to insert, this parameter is required.
|
HealthCheck | String | off |
Indicates whether health checks are enabled. Valid values: on and off. Note If you set the ListenerSync parameter to off, this parameter is required. If you set the parameter to on, the configuration of the listener is used.
|
HealthCheckConnectPort | Integer | 45 |
The port of the backend server that is used for health check. Valid values: 1 to 65535. Note If you set the HealthCheck parameter to on, this parameter is required. If you left this parameter empty and the HealthCheck parameter is set to on, the backend port configuration of the listener is used by default.
|
HealthCheckDomain | String | www.domain.com |
The domain name that is used for health checks. Valid values:
Note If you set the HealthCheck parameter to on, this parameter is required.
|
HealthCheckHttpCode | String | http_3xx |
The HTTP status code that indicates a successful health check. Multiple HTTP status codes are separated by commas (,). Default value: http_2xx. Valid values: http_2xx, http_3xx, http_4xx, and http_5xx. Note If you set the HealthCheck parameter to on, this parameter is required.
|
HealthCheckInterval | Integer | 5 |
The time interval between two consecutive health checks. Valid values: 1 to 50. Unit: seconds. Note If you set the HealthCheck parameter to on, this parameter is required.
|
HealthCheckTimeout | Integer | 34 |
The timeout period for a health check response. If the backend Elastic Compute Service (ECS) instance does not send an expected response within the specified period of time, the health check fails. Valid values: 1 to 300. Unit: seconds. Note If the value of the HealthCHeckTimeout parameter is smaller than that of the HealthCheckInterval parameter, the value of the HealthCHeckTimeout parameter is ignored and the value of the HealthCheckInterval parameter is regarded as the waiting period. If you set the HealthCheck parameter to on, this parameter is required.
|
HealthCheckURI | String | /example |
The URI that is used for health checks. Note If you set the HealthCheck parameter to on, this parameter is required.
|
HealthyThreshold | Integer | 5 |
Specifies the number of successful health checks that must be consecutively performed before a backend server can be declared healthy (from fail to success). Valid values: 2 to 10. Note If you set the HealthCheck parameter to on, this parameter is required.
|
ListenerSync | String | off |
Indicates whether the forwarding rule uses the scheduling algorithm, session persistence, and health check configurations of the listener. Valid values: on and off.
|
Scheduler | String | wrr |
The scheduling algorithm. Valid values:
Note If you set the ListenerSync parameter to off, this parameter is required. If you set the parameter to on, the configuration of the listener is used.
|
StickySession | String | off |
Specifies whether to enable session persistence. Valid values: on and off. Note If you set the ListenerSync parameter to off, this parameter is required. If you set the parameter to on, the configuration of the listener is used.
|
StickySessionType | String | insert |
The method that is used to handle a cookie. Valid values:
Note If you set the StickySession parameter to on, this parameter is required.
|
UnhealthyThreshold | Integer | 2 |
Specifies the number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy (from success to fail). Valid values: 2 to 10 Note If you set the HealthCheck parameter to on, this parameter is required.
|
Examples
Sample requests
http(s)://[Endpoint]/?Action=DescribeRules
&ListenerPort=90
&LoadBalancerId=lb-bp1ca0zt07t93****
&RegionId=cn-hangzhou
&<Common request parameters>
Sample success responses
XML
format
<DescribeRulesResponse>
<RequestId>9DEC9C28-AB05-4DDF-9A78-6B08EC9CE18C</RequestId>
<Rules>
<Rule>
<Cookie>23</Cookie>
<CookieTimeout>56</CookieTimeout>
<VServerGroupId>rsp-6cejjzl******</VServerGroupId>
<HealthCheckInterval>5</HealthCheckInterval>
<UnhealthyThreshold>2</UnhealthyThreshold>
<HealthCheckURI>/example</HealthCheckURI>
<Scheduler>wrr</Scheduler>
<RuleId>rule-tybqi6******</RuleId>
<HealthCheck>off</HealthCheck>
<HealthCheckTimeout>34</HealthCheckTimeout>
<Url>/cache</Url>
<StickySession>off</StickySession>
<HealthCheckConnectPort>45</HealthCheckConnectPort>
<HealthyThreshold>5</HealthyThreshold>
<HealthCheckDomain>www.domain.com</HealthCheckDomain>
<ListenerSync>off</ListenerSync>
<StickySessionType>insert</StickySessionType>
<Domain>test.com</Domain>
<HealthCheckHttpCode>http_3xx</HealthCheckHttpCode>
<RuleName>Rule2</RuleName>
</Rule>
</Rules>
</DescribeRulesResponse>
JSON
format
{
"DescribeRulesResponse": {
"RequestId": "9DEC9C28-AB05-4DDF-9A78-6B08EC9CE18C",
"Rules": {
"Rule": {
"Cookie": 23,
"CookieTimeout": 56,
"VServerGroupId": "rsp-6cejjzl******",
"HealthCheckInterval": 5,
"UnhealthyThreshold": 2,
"HealthCheckURI": "/example",
"Scheduler": "wrr",
"RuleId": "rule-tybqi6******",
"HealthCheck": "off",
"HealthCheckTimeout": 34,
"Url": "/cache",
"StickySession": "off",
"HealthCheckConnectPort": 45,
"HealthyThreshold": 5,
"HealthCheckDomain": "www.domain.com",
"ListenerSync": "off",
"StickySessionType": "insert",
"Domain": "test.com",
"HealthCheckHttpCode": "http_3xx",
"RuleName": "Rule2"
}
}
}
}
Error codes
For a list of error codes, visit the API Error Center.