Queries the listeners of a Classic Load Balancer (CLB) instance.
Operation description
-
A CLB instance is created. For more information, see CreateLoadBalancer .
-
One or more listeners are added to the CLB instance. For more information, see the following topics:
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resourcesis used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
| Operation | Access level | Resource type | Condition key | Associated operation |
|---|---|---|---|---|
| slb:DescribeLoadBalancerListeners | get | *LoadBalancer acs:slb:{#regionId}:{#accountId}:loadbalancer/{#LoadBalancerId} |
| none |
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| RegionId | string | No | The ID of the region where the CLB instance is deployed. You can call the DescribeRegions operation to query the most recent region list. Note
If the endpoint of the selected region is slb.aliyuncs.com, the RegionId parameter is required.
| cn-hangzhou |
| NextToken | string | No | The token that is used for the next query. Valid values:
| FFmyTO70tTpLG6I3FmYAXGKPd**** |
| MaxResults | integer | No | The number of entries to return in each call. Valid values: 1 to 100. If you do not specify this parameter, the default value 20 is used. | 50 |
| ListenerProtocol | string | No | The protocol used by the listener. Valid values:
| http |
| LoadBalancerId | array | No | The IDs of the CLB instances. You can specify up to 10 instance IDs. Note
If you do not use the SDK to call this operation, use the LoadBalancerId.N parameter.
| |
| string | No | The ID of the CLB instance. | LoadBalancerId.1=lb-uf6so8u4g35prnvsw****,LoadBalancerId.2=lb-uf6s1l1kukqv4u5nt**** | |
| Tag | array<object> | No | The tags. | |
| object | No | The tags. | ||
| Key | string | No | The key of the tag. You can specify up to 20 tag keys. The tag key cannot be an empty string. The tag key must be 1 to 64 characters in length and cannot start with | TestKey |
| Value | string | No | The tag value. 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 frontend port that is used by the CLB instance. | 443 |
| Description | string | No | The description of the listener. | HTTPS_443 |
Response parameters
Examples
Sample success responses
JSONformat
{
"NextToken": "FFmyTO70tTpLG6I3FmYAXGKPd****",
"RequestId": "365F4154-92F6-4AE4-92F8-7FF34B540710",
"TotalCount": 10,
"MaxResults": 50,
"Listeners": [
{
"AclType": "white",
"Status": "running",
"VServerGroupId": "rsp-cige6j****",
"ListenerProtocol": "http",
"LoadBalancerId": "lb-bp1b6c719dfa****",
"ListenerPort": 80,
"AclId": "nacl-a2do9e413e0spzasx****",
"Scheduler": "wrr",
"Bandwidth": -1,
"Description": "test",
"AclStatus": "off",
"BackendServerPort": 80,
"AclIds": [
""
],
"HTTPListenerConfig": {
"HealthCheckHttpVersion": "HTTP 1.0",
"XForwardedFor_ClientSrcPort": "on",
"Cookie": "B490B5EBF6F3CD402E515D22BCDA****",
"Gzip": "on",
"HealthCheckConnectPort": 8080,
"HealthCheckTimeout": 3,
"HealthCheckType": "tcp",
"CookieTimeout": 500,
"HealthCheckDomain": "www.example.com",
"UnhealthyThreshold": 4,
"XForwardedFor_SLBID": "on",
"ForwardPort": 80,
"HealthCheckHttpCode": "http_2xx,http_3xx",
"ListenerForward": "on",
"XForwardedFor": "on",
"IdleTimeout": 15,
"RequestTimeout": 60,
"HealthCheckInterval": 5,
"XForwardedFor_SLBPORT": "on",
"HealthCheckURI": "/test/index.html",
"StickySessionType": "insert",
"HealthyThreshold": 4,
"XForwardedFor_proto": "on",
"XForwardedFor_SLBIP": "on",
"StickySession": "on",
"HealthCheckMethod": "get",
"HealthCheck": "on"
},
"HTTPSListenerConfig": {
"XForwardedFor_ClientCertClientVerify": "off",
"HealthCheckHttpVersion": "HTTP 1.0",
"XForwardedFor_ClientSrcPort": "off",
"Cookie": "B490B5EBF6F3CD402E515D22BCDA****",
"Gzip": "on",
"EnableHttp2": "off",
"CACertificateId": "idkp-234-cn-test-0****",
"HealthCheckConnectPort": 8080,
"HealthCheckTimeout": 3,
"HealthCheckType": "tcp",
"CookieTimeout": 500,
"HealthCheckDomain": "www.example.com",
"UnhealthyThreshold": 4,
"XForwardedFor_SLBID": "on",
"XForwardedFor_ClientCertSubjectDN": "off",
"HealthCheckHttpCode": "http_2xx,http_3xx",
"XForwardedFor_ClientCertFingerprint": "off",
"XForwardedFor": "on",
"RequestTimeout": 60,
"IdleTimeout": 15,
"ServerCertificateId": "idkp-123-cn-test-0****",
"HealthCheckInterval": 5,
"XForwardedFor_SLBPORT": "off",
"HealthCheckURI": "/test/index.html",
"StickySessionType": "insert",
"XForwardedFor_ClientCertIssuerDN": "off",
"HealthyThreshold": 4,
"XForwardedFor_proto": "on",
"XForwardedFor_SLBIP": "on",
"StickySession": "on",
"HealthCheckMethod": "get",
"TLSCipherPolicy": "tls_cipher_policy_1_0",
"HealthCheck": "on"
},
"TCPListenerConfig": {
"HealthCheckHttpCode": "http_2xx,http_3xx",
"ConnectionDrainTimeout": 300,
"PersistenceTimeout": 0,
"HealthCheckInterval": 5,
"HealthCheckURI": "/test/index.html",
"HealthCheckConnectPort": 8080,
"EstablishedTimeout": 500,
"HealthCheckType": "tcp",
"HealthCheckConnectTimeout": 100,
"MasterSlaveServerGroupId": "rsp-0bfucw*****",
"HealthyThreshold": 4,
"HealthCheckDomain": "www.example.com",
"UnhealthyThreshold": 4,
"ConnectionDrain": "off",
"HealthCheckMethod": "get",
"HealthCheck": "on",
"ProxyProtocolV2Enabled": "false"
},
"UDPListenerConfig": {
"ConnectionDrainTimeout": 300,
"HealthCheckInterval": 5,
"HealthCheckExp": "ok",
"HealthCheckConnectPort": 8080,
"HealthCheckConnectTimeout": 100,
"MasterSlaveServerGroupId": "rsp-0bfucw****",
"HealthyThreshold": 4,
"UnhealthyThreshold": 4,
"ConnectionDrain": "off",
"HealthCheckReq": "hello",
"HealthCheck": "on",
"ProxyProtocolV2Enabled": "false"
},
"Tags": [
{
"TagValue": "TestValue",
"TagKey": "TestKey"
}
]
}
]
}Error codes
| HTTP status code | Error code | Error message | Description |
|---|---|---|---|
| 400 | IllegalParam.ListenerProtocol | The param of ListenerProtocol is illegal. | - |
| 400 | IllegalParam.MaxResults | The param of MaxResults is illegal. | - |
| 400 | IllegalParam.NextToken | The param of NextToken is illegal. | - |
| 400 | IllegalParamSize.LoadBalancerId | The param size of LoadBalancerId is illegal. | - |
| 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. |
For a list of error codes, visit the Service error codes.
Change history
| Change time | Summary of changes | Operation |
|---|---|---|
| 2025-02-14 | The Error code has changed | View Change Details |
| 2024-05-28 | The Error code has changed. The response structure of the API has changed | View Change Details |
| 2023-10-25 | The Error code has changed. The request parameters of the API has changed | View Change Details |
| 2023-07-04 | The Error code has changed | View Change Details |
