Queries the details of SLB listeners.
Operation description
-
You have created a Classic Load Balancer (CLB) instance. For more information, see CreateLoadBalancer.
-
You have configured listeners for the CLB instance. For more information, see:
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
slb:DescribeLoadBalancerListeners |
get |
*LoadBalancer
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
No |
The region ID of the SLB instance. You can invoke the DescribeRegions operation to query the region ID. Note
If the endpoint of the selected region is slb.aliyuncs.com, the |
cn-hangzhou |
| NextToken |
string |
No |
The token that determines the start point of the next query. Valid values:
|
FFmyTO70tTpLG6I3FmYAXGKPd**** |
| MaxResults |
integer |
No |
The number of entries per page in a paginated query. Valid values: 1 to 100. If this parameter is not specified, the default value is 20. |
50 |
| ListenerProtocol |
string |
No |
The Server Load Balancer (SLB) listener protocol. Valid values:
|
http |
| LoadBalancerId |
array |
No |
The list of Server Load Balancer (SLB) instance IDs. A maximum of 10 instance IDs are supported. Note
For non-SDK calls, use the LoadBalancerId.N format to specify this parameter. |
lb-123wrwer |
|
string |
No |
The ID of the SLB instance. |
lb-uf6so8u4g35prnvsw**** |
|
| Tag |
array<object> |
No |
The tags. |
|
|
object |
No |
The tags. |
||
| Key |
string |
No |
The tag key of the resource. Valid values of N: 1 to 20. The tag key cannot be an empty string. The tag key can be up to 64 characters in length and cannot start with |
TestKey |
| Value |
string |
No |
The tag value of the resource. Valid values of N: 1 to 20. The tag value can be an empty string.
The tag value can be up to 128 characters in length and cannot start with |
TestValue |
| ListenerPort |
integer |
No |
The listener port of the CLB instance. |
443 |
| Description |
string |
No |
The custom listener name. |
HTTPS_443 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| Listeners |
array<object> |
The list of listeners of the Classic Load Balancer (CLB) instance. Note
This parameter is not returned if no listeners are configured for the instance. |
|
|
array<object> |
The list of listeners of the Classic Load Balancer (CLB) instance. Note
This parameter is not returned if no listeners are configured for the instance. |
||
| AclId |
string |
The ID of the access control policy group. |
acl-a2do9e413e0spzasx**** |
| AclIds |
array |
The list of access control policy group IDs. |
|
|
string |
The ID of the access control policy group. |
acl-a2do9e413e0spzasx**** |
|
| AclStatus |
string |
Indicates whether access control is enabled. Valid values:
|
off |
| AclType |
string |
The type of access control. Valid values:
If a whitelist is enabled but no IP addresses are added to the access control policy group, the SLB listener forwards all requests.
If a blacklist is enabled but no IP addresses are added to the access control policy group, the SLB listener forwards all requests. |
white |
| BackendServerPort |
integer |
The port of the backend server. Note
This parameter takes effect only when both |
80 |
| Bandwidth |
integer |
The peak bandwidth of the listener. Unit: Mbit/s. |
-1 |
| Description |
string |
The description of the listener. |
test |
| HTTPListenerConfig |
object |
The HTTP listener configuration. |
|
| Cookie |
string |
The cookie configured on the server. |
B490B5EBF6F3CD402E515D22BCDA**** |
| CookieTimeout |
integer |
The cookie timeout period. Unit: seconds. Valid values: 1 to 86400. |
500 |
| ForwardPort |
integer |
The listening port used to redirect HTTP requests to HTTPS. Note
This parameter is not displayed if ListenerForward is set to off. |
80 |
| Gzip |
string |
Indicates whether Gzip compression is enabled. Valid values:
|
on |
| HealthCheck |
string |
Indicates whether health checks are enabled. Valid values:
|
on |
| HealthCheckConnectPort |
integer |
The port used for health checks. Note
This parameter takes effect only when HealthCheck is set to on. |
8080 |
| HealthCheckDomain |
string |
The domain name used for health checks. |
www.example.com |
| HealthCheckHttpCode |
string |
The HTTP status code that indicates a Normal health check result. |
http_2xx,http_3xx |
| HealthCheckHttpVersion |
string |
The HTTP version used for health checks. |
HTTP 1.0 |
| HealthCheckInterval |
integer |
The interval between two consecutive health checks. Unit: seconds. |
5 |
| HealthCheckMethod |
string |
The health check method. Valid values: head or get. |
get |
| HealthCheckTimeout |
integer |
The maximum timeout period for each health check response. Unit: seconds. |
3 |
| HealthCheckType |
string |
The health check protocol. |
tcp |
| HealthCheckURI |
string |
The URI used for health checks. |
/test/index.html |
| HealthyThreshold |
integer |
The number of consecutive successful health checks required before the health check status of a backend server changes from fail to success. Valid values: 2 to 10. |
4 |
| IdleTimeout |
integer |
The idle connection timeout period. Unit: seconds. Valid values: 1 to 60. If no request is received within the timeout period, Server Load Balancer temporarily closes the connection and re-establishes the connection when the next request arrives. |
15 |
| ListenerForward |
string |
Indicates whether HTTP-to-HTTPS redirection is enabled for the listener. Valid values:
|
on |
| RequestTimeout |
integer |
The request timeout period. Unit: seconds. Valid values: 1 to 180. If no response is received from the backend server within the timeout period, Server Load Balancer stops waiting and returns an |
60 |
| StickySession |
string |
Indicates whether session persistence is enabled. Valid values:
|
on |
| StickySessionType |
string |
The method used to handle cookies. Valid values:
|
insert |
| UnhealthyThreshold |
integer |
The number of consecutive failed health checks required before the health check status of a backend server changes from success to fail. Valid values: 2 to 10. |
4 |
| XForwardedFor |
string |
Indicates whether the
|
on |
| XForwardedFor_ClientSrcPort |
string |
Indicates whether the
|
on |
| XForwardedFor_SLBID |
string |
Indicates whether the
|
on |
| XForwardedFor_SLBIP |
string |
Indicates whether the
|
on |
| XForwardedFor_SLBPORT |
string |
Indicates whether the
|
on |
| XForwardedFor_proto |
string |
Indicates whether the
|
on |
| HTTPSListenerConfig |
object |
The HTTPS listener configuration. |
|
| CACertificateId |
string |
The ID of the CA certificate. |
idkp-234-cn-test-0**** |
| Cookie |
string |
The cookie configured on the server. |
B490B5EBF6F3CD402E515D22BCDA**** |
| CookieTimeout |
integer |
The cookie timeout period. Unit: seconds. Valid values: 1 to 86400. |
500 |
| EnableHttp2 |
string |
Indicates whether
|
off |
| Gzip |
string |
Indicates whether Gzip compression is enabled. Valid values:
|
on |
| HealthCheck |
string |
Indicates whether health checks are enabled. Valid values:
|
on |
| HealthCheckConnectPort |
integer |
The port used for health checks. |
8080 |
| HealthCheckDomain |
string |
The domain name used for health checks. |
www.example.com |
| HealthCheckHttpCode |
string |
The HTTP status code that indicates a Normal health check result. |
http_2xx,http_3xx |
| HealthCheckHttpVersion |
string |
The HTTP version used for health checks. |
HTTP 1.0 |
| HealthCheckInterval |
integer |
The interval between two consecutive health checks. Unit: seconds. |
5 |
| HealthCheckMethod |
string |
The health check method. |
get |
| HealthCheckTimeout |
integer |
The maximum timeout period for each health check response. Unit: seconds. |
3 |
| HealthCheckType |
string |
The health check protocol. |
tcp |
| HealthCheckURI |
string |
The URI used for health checks. |
/test/index.html |
| HealthyThreshold |
integer |
The number of consecutive successful health checks required before the health check status of a backend server changes from fail to success. Valid values: 2 to 10. |
4 |
| IdleTimeout |
integer |
The idle connection timeout period. Unit: seconds. Valid values: 1 to 60. If no request is received within the timeout period, Server Load Balancer temporarily closes the connection and re-establishes the connection when the next request arrives. |
15 |
| RequestTimeout |
integer |
The request timeout period. Unit: seconds. Valid values: 1 to 180. If no response is received from the backend server within the timeout period, Server Load Balancer stops waiting and returns an |
60 |
| ServerCertificateId |
string |
The ID of the server certificate. |
idkp-123-cn-test-0**** |
| StickySession |
string |
Indicates whether session persistence is enabled. Valid values:
|
on |
| StickySessionType |
string |
The method used to handle cookies.
|
insert |
| TLSCipherPolicy |
string |
The security policy that contains the TLS protocol versions and supported encryption algorithm suites for HTTPS.
|
tls_cipher_policy_1_0 |
| UnhealthyThreshold |
integer |
The number of consecutive failed health checks required before the health check status of a backend server changes from success to fail. Valid values: 2 to 10. |
4 |
| XForwardedFor |
string |
Indicates whether the
|
on |
| XForwardedFor_ClientCertClientVerify |
string |
Indicates whether the
|
off |
| XForwardedFor_ClientCertFingerprint |
string |
Indicates whether the
|
off |
| XForwardedFor_ClientCertIssuerDN |
string |
Indicates whether the
|
off |
| XForwardedFor_ClientCertSubjectDN |
string |
Indicates whether the
|
off |
| XForwardedFor_ClientSrcPort |
string |
Indicates whether the
|
off |
| XForwardedFor_SLBID |
string |
Indicates whether the
|
on |
| XForwardedFor_SLBIP |
string |
Indicates whether the
|
on |
| XForwardedFor_SLBPORT |
string |
Indicates whether the
|
off |
| XForwardedFor_proto |
string |
Indicates whether the
|
on |
| ListenerPort |
integer |
The listening port. |
80 |
| ListenerProtocol |
string |
The listener protocol of the Classic Load Balancer (CLB) instance. |
http |
| LoadBalancerId |
string |
The ID of the Classic Load Balancer (CLB) instance. |
lb-bp1b6c719dfa**** |
| Scheduler |
string |
The scheduling algorithm. Valid values:
Note
Only guaranteed-performance instances support the sch, tch, and qch consistent hashing algorithms. |
wrr |
| Status |
string |
The status of the listener. Valid values:
|
running |
| TCPListenerConfig |
object |
The TCP listener configuration. |
|
| ConnectionDrain |
string |
Indicates whether connection draining is enabled. Valid values:
|
off |
| ConnectionDrainTimeout |
integer |
The connection draining timeout period. Unit: seconds. Valid values: 10 to 900. |
300 |
| EstablishedTimeout |
integer |
The connection timeout period. Unit: seconds. |
500 |
| HealthCheck |
string |
Indicates whether health checks are enabled. Valid values:
|
on |
| HealthCheckConnectPort |
integer |
The port used for health checks. |
8080 |
| HealthCheckConnectTimeout |
integer |
The health check timeout period. Unit: seconds. Valid values: 1 to 300. |
100 |
| HealthCheckDomain |
string |
The domain name used for health checks. |
www.example.com |
| HealthCheckHttpCode |
string |
The HTTP status code that indicates a healthy health check. |
http_2xx,http_3xx |
| HealthCheckInterval |
integer |
The interval between two consecutive health checks. Unit: seconds. |
5 |
| HealthCheckMethod |
string |
The health check method. |
get |
| HealthCheckType |
string |
The health check protocol. |
tcp |
| HealthCheckURI |
string |
The URI used for health checks. |
/test/index.html |
| HealthyThreshold |
integer |
The number of consecutive successful health checks required before the health check status of a backend server changes from fail to success. Valid values: 2 to 10. |
4 |
| MasterSlaveServerGroupId |
string |
The ID of the primary/secondary server group associated with the listener. |
rsp-0bfucw***** |
| PersistenceTimeout |
integer |
Indicates whether session persistence is enabled. Unit: seconds. Valid values: 0 to 3600. A value of 0 indicates that session persistence is not enabled. |
0 |
| ProxyProtocolV2Enabled |
string |
Indicates whether the Proxy Protocol is used to carry the client source address to the backend server. Valid values:
|
false |
| UnhealthyThreshold |
integer |
The number of consecutive failed health checks required before the health check status of a backend server changes from success to fail. Valid values: 2 to 10. |
4 |
| Tags |
array<object> |
The tags. |
|
|
object |
The tags. |
||
| TagKey |
string |
The tag key of the resource. |
TestKey |
| TagValue |
string |
The tag value of the resource. |
TestValue |
| UDPListenerConfig |
object |
The UDP listener configuration. |
|
| ConnectionDrain |
string |
Indicates whether connection draining is enabled. Valid values:
|
off |
| ConnectionDrainTimeout |
integer |
The connection draining timeout period. Unit: seconds. Valid values: 10 to 900. |
300 |
| HealthCheck |
string |
Indicates whether health checks are enabled. Valid values:
|
on |
| HealthCheckConnectPort |
integer |
The port used for health checks. |
8080 |
| HealthCheckConnectTimeout |
integer |
The health check response timeout period. |
100 |
| HealthCheckExp |
string |
The response string for UDP listener health checks. |
ok |
| HealthCheckInterval |
integer |
The interval between two consecutive health checks. Unit: seconds. |
5 |
| HealthCheckReq |
string |
The request string for UDP listener health checks. |
hello |
| HealthyThreshold |
integer |
The health check healthy threshold. |
4 |
| MasterSlaveServerGroupId |
string |
The ID of the associated primary/secondary server group. |
rsp-0bfucw**** |
| ProxyProtocolV2Enabled |
string |
Indicates whether the Proxy Protocol is used to carry the client source address to the backend server. Valid values:
|
false |
| UnhealthyThreshold |
integer |
The health check unhealthy threshold. |
4 |
| VServerGroupId |
string |
The ID of the virtual server group associated with the listener. |
rsp-cige6j**** |
| MaxResults |
integer |
The number of entries returned per page in a paginated query. |
50 |
| NextToken |
string |
Indicates whether a next query token exists. Valid values:
|
FFmyTO70tTpLG6I3FmYAXGKPd**** |
| RequestId |
string |
The request ID. |
365F4154-92F6-4AE4-92F8-7FF34B540710 |
| TotalCount |
integer |
The total number of entries returned under the current query conditions. |
10 |
Examples
Success response
JSON format
{
"Listeners": [
{
"AclId": "acl-a2do9e413e0spzasx****",
"AclIds": [
"acl-a2do9e413e0spzasx****"
],
"AclStatus": "off",
"AclType": "white",
"BackendServerPort": 80,
"Bandwidth": -1,
"Description": "test",
"HTTPListenerConfig": {
"Cookie": "B490B5EBF6F3CD402E515D22BCDA****",
"CookieTimeout": 500,
"ForwardPort": 80,
"Gzip": "on",
"HealthCheck": "on",
"HealthCheckConnectPort": 8080,
"HealthCheckDomain": "www.example.com",
"HealthCheckHttpCode": "http_2xx,http_3xx",
"HealthCheckHttpVersion": "HTTP 1.0",
"HealthCheckInterval": 5,
"HealthCheckMethod": "get",
"HealthCheckTimeout": 3,
"HealthCheckType": "tcp",
"HealthCheckURI": "/test/index.html",
"HealthyThreshold": 4,
"IdleTimeout": 15,
"ListenerForward": "on",
"RequestTimeout": 60,
"StickySession": "on",
"StickySessionType": "insert",
"UnhealthyThreshold": 4,
"XForwardedFor": "on",
"XForwardedFor_ClientSrcPort": "on",
"XForwardedFor_SLBID": "on",
"XForwardedFor_SLBIP": "on",
"XForwardedFor_SLBPORT": "on",
"XForwardedFor_proto": "on"
},
"HTTPSListenerConfig": {
"CACertificateId": "idkp-234-cn-test-0****",
"Cookie": "B490B5EBF6F3CD402E515D22BCDA****",
"CookieTimeout": 500,
"EnableHttp2": "off",
"Gzip": "on",
"HealthCheck": "on",
"HealthCheckConnectPort": 8080,
"HealthCheckDomain": "www.example.com",
"HealthCheckHttpCode": "http_2xx,http_3xx",
"HealthCheckHttpVersion": "HTTP 1.0",
"HealthCheckInterval": 5,
"HealthCheckMethod": "get",
"HealthCheckTimeout": 3,
"HealthCheckType": "tcp",
"HealthCheckURI": "/test/index.html",
"HealthyThreshold": 4,
"IdleTimeout": 15,
"RequestTimeout": 60,
"ServerCertificateId": "idkp-123-cn-test-0****",
"StickySession": "on",
"StickySessionType": "insert",
"TLSCipherPolicy": "tls_cipher_policy_1_0",
"UnhealthyThreshold": 4,
"XForwardedFor": "on",
"XForwardedFor_ClientCertClientVerify": "off",
"XForwardedFor_ClientCertFingerprint": "off",
"XForwardedFor_ClientCertIssuerDN": "off",
"XForwardedFor_ClientCertSubjectDN": "off",
"XForwardedFor_ClientSrcPort": "off",
"XForwardedFor_SLBID": "on",
"XForwardedFor_SLBIP": "on",
"XForwardedFor_SLBPORT": "off",
"XForwardedFor_proto": "on"
},
"ListenerPort": 80,
"ListenerProtocol": "http",
"LoadBalancerId": "lb-bp1b6c719dfa****",
"Scheduler": "wrr",
"Status": "running",
"TCPListenerConfig": {
"ConnectionDrain": "off",
"ConnectionDrainTimeout": 300,
"EstablishedTimeout": 500,
"HealthCheck": "on",
"HealthCheckConnectPort": 8080,
"HealthCheckConnectTimeout": 100,
"HealthCheckDomain": "www.example.com",
"HealthCheckHttpCode": "http_2xx,http_3xx",
"HealthCheckInterval": 5,
"HealthCheckMethod": "get",
"HealthCheckType": "tcp",
"HealthCheckURI": "/test/index.html",
"HealthyThreshold": 4,
"MasterSlaveServerGroupId": "rsp-0bfucw*****",
"PersistenceTimeout": 0,
"ProxyProtocolV2Enabled": "false",
"UnhealthyThreshold": 4
},
"Tags": [
{
"TagKey": "TestKey",
"TagValue": "TestValue"
}
],
"UDPListenerConfig": {
"ConnectionDrain": "off",
"ConnectionDrainTimeout": 300,
"HealthCheck": "on",
"HealthCheckConnectPort": 8080,
"HealthCheckConnectTimeout": 100,
"HealthCheckExp": "ok",
"HealthCheckInterval": 5,
"HealthCheckReq": "hello",
"HealthyThreshold": 4,
"MasterSlaveServerGroupId": "rsp-0bfucw****",
"ProxyProtocolV2Enabled": "false",
"UnhealthyThreshold": 4
},
"VServerGroupId": "rsp-cige6j****"
}
],
"MaxResults": 50,
"NextToken": "FFmyTO70tTpLG6I3FmYAXGKPd****",
"RequestId": "365F4154-92F6-4AE4-92F8-7FF34B540710",
"TotalCount": 10
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | IllegalParam.ListenerProtocol | The param of ListenerProtocol is illegal. | The specified ListenerProtocol is invalid. Check the parameter constraints and try again. |
| 400 | IllegalParam.MaxResults | The param of MaxResults is illegal. | The specified MaxResults is invalid. Check the parameter constraints and try again. |
| 400 | IllegalParam.NextToken | The param of NextToken is illegal. | The specified NextToken is invalid. Check the parameter constraints and try again. |
| 400 | IllegalParamSize.LoadBalancerId | The param size of LoadBalancerId is illegal. | The specified LoadBalancerId is invalid. Check the parameter constraints and try again. |
| 400 | MissingParam.TagKey | The param of TagKey is missing. | |
| 403 | UnauthorizedRegion | The specified region of is not authorized. | The specified region of is not authorized. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.