Queries the forwarding rules that are configured for a specified listener.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
slb:DescribeRules |
get |
*loadbalancer
|
|
None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The ID of the region where the SLB instance is deployed. You can call the DescribeRegions operation to query the most recent region list. |
cn-hangzhou |
| LoadBalancerId |
string |
Yes |
The ID of the SLB instance. |
lb-bp1ca0zt07t934**** |
| ListenerProtocol |
string |
No |
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. |
http |
| ListenerPort |
integer |
Yes |
The frontend listener port that is used by the Server Load Balancer (SLB) instance. Valid values: 1 to 65535. |
90 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The ID of the request. |
9DEC9C28-AB05-4DDF-9A78-6B08EC9CE18C |
| Rules |
object |
||
| Rule |
array<object> |
The forwarding rules. |
|
|
object |
|||
| HealthCheckHttpCode |
string |
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. |
http_3xx |
| VServerGroupId |
string |
The ID of the destination vServer group specified in the forwarding rule. |
rsp-6cejjzl**** |
| Domain |
string |
The requested domain name specified in the forwarding rule. |
www.example.com |
| Cookie |
string |
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. |
23 |
| HealthCheckInterval |
integer |
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. |
5 |
| Url |
string |
The requested path specified in the forwarding rule. |
/cache |
| HealthCheckURI |
string |
The URI that is used for health checks. Note
If you set the HealthCheck parameter to on, this parameter is required. |
/example |
| StickySessionType |
string |
The method that is used to handle a cookie. Valid values:
Note
If you set the StickySession parameter to on, this parameter is required. |
insert |
| RuleName |
string |
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. |
Rule2 |
| RuleId |
string |
The ID of the forwarding rule. |
rule-tybqi6**** |
| HealthCheckConnectPort |
integer |
The backend port that is used for health checks. Valid values: 1 to 65535. Note
If you set the HealthCheck parameter to on, this parameter is required. If this parameter is empty but HealthCheck is set to on, the listener port is used for health checks. |
45 |
| Scheduler |
string |
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. |
wrr |
| HealthCheckTimeout |
integer |
The timeout period of a health check response. If a backend ECS instance does not respond within the specified timeout period, the ECS instance fails the health check. Unit: seconds Valid values: 1 to 300. Note
When you set the HealthCheck parameter to on, this parameter takes effect. |
34 |
| ListenerSync |
string |
Indicates whether the forwarding rule uses the scheduling algorithm, session persistence, and health check configurations of the listener. Valid values: on and off.
|
off |
| HealthyThreshold |
integer |
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. |
5 |
| CookieTimeout |
integer |
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. |
56 |
| HealthCheckDomain |
string |
The domain name that is used for health checks. Valid values:
Note
If you set the HealthCheck parameter to on, this parameter is required. |
www.example.com |
| UnhealthyThreshold |
integer |
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. |
2 |
| StickySession |
string |
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. |
off |
| HealthCheck |
string |
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. |
off |
Examples
Success response
JSON format
{
"RequestId": "9DEC9C28-AB05-4DDF-9A78-6B08EC9CE18C",
"Rules": {
"Rule": [
{
"HealthCheckHttpCode": "http_3xx",
"VServerGroupId": "rsp-6cejjzl****",
"Domain": "www.example.com",
"Cookie": "23",
"HealthCheckInterval": 5,
"Url": "/cache",
"HealthCheckURI": "/example",
"StickySessionType": "insert",
"RuleName": "Rule2",
"RuleId": "rule-tybqi6****",
"HealthCheckConnectPort": 45,
"Scheduler": "wrr",
"HealthCheckTimeout": 34,
"ListenerSync": "off",
"HealthyThreshold": 5,
"CookieTimeout": 56,
"HealthCheckDomain": "www.example.com",
"UnhealthyThreshold": 2,
"StickySession": "off",
"HealthCheck": "off"
}
]
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | TooManyListeners | More than 1 listener is found, please be more specified. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.