Query CLB Listener List

Last updated: 2018-06-25 15:30:49

PDF

API Description

This API (DescribeLoadBalancerListeners) is used to query the list of listeners by load balancer ID, listener protocol or port.

Domain name for API access: lb.api.qcloud.com

Request Parameters

The following request parameter list only provides the API request parameters. Common request parameters are required when the API is called. For more information, please see Common Request Parameters page. The Action field for this API is DescribeLoadBalancerListeners.

Parameter Name Required Type Description
loadBalancerId Yes String ID of the load balancer instance, which can be queried via the API DescribeLoadBalancers.
listenerIds.n No String ID of the load balancer listener.
protocol No Int Protocol type of the listener.
1: HTTP, 2: TCP, 3: UDP, 4: HTTPS.
loadBalancerPort No Int Port of the load balancer listener.
status No Int Status of the load balancer listener. This field will be ignored if you enter the listener ID for your query.

Response Parameters

Parameter Name Type Description
code Int Common error code. 0: Successful; other values: Failed. For more information, please see Common Error Codes on the Error Codes page.
message String Module error message description depending on API.
codeDesc String Error code. For a successful operation, "Success" is returned. For a failed operation, a message describing the failure is returned.
totalCount Int The total number of load balancer instances meeting the filter criteria
listenerSet Array Returned array of listeners.

listenerSet is composed as follows:

Parameter Name Type Description
listenerId String ID of the load balancer listener.
unListenerId String ID of the cloud load balancer listener.
loadBalancerPort Int Listening port of the load balancer.
instancePort Int Forwarding port of the listener backend.
listenerName String Listener name.
protocol Int Protocol type of the listener.
1: HTTP, 2: TCP, 3: UDP, 4: HTTPS.
sessionExpire Int Session persistence duration.
healthSwitch Int Indicate whether Health Check is enabled: 1 (On) and 0 (Off).
timeOut Int Response timeout.
intervalTime Int Interval between health checks.
healthNum Int Healthy threshold.
unhealthNum Int Unhealthy threshold.
httpHash String Forwarding method of the conventional public network-based load balancer listener with HTTP or HTTPS protocol.
scheduler String Forwarding method of the conventional public network-based load balancer listener with UDP or TCP protocol.
httpCode Int Health check return code of the conventional public network-based load balancer listener with HTTP or HTTPS protocol. For more information, please see Create Listener.
httpCheckPath String Health check path of the conventional public network-based load balancer listener with HTTP or HTTPS protocol.
SSLMode String Verification method of the conventional public network-based load balancer listener with HTTPS protocol.
certId String Server certificate ID of the conventional public network-based load balancer listener with HTTPS protocol.
certCaId String Client certificate ID of the conventional public network-based load balancer listener with HTTPS protocol.
status Int Listener status. 0: Creating. 1: Running.

Example

Request

https://lb.api.qcloud.com/v2/index.php?Action=DescribeLoadBalancerListeners
&<Common request parameters>
&loadBalancerId=lb-abcdefgh
&listenerIds.0=lbl-6hkiqc6c
&listenerIds.1=lbl-6wv071ba

Response

{
    "code": 0,
    "message": "",
    "codeDesc": "Success",
    "listenerSet": [
        {    
            "listenerId": "lbl-6hkiqc6c",
            "loadBalancerPort": 80,
            "instancePort": 80,
            "protocol": 4,
            "status": 1,
            "listenerName": "teaa",
            "unListenerId": "lbl-6hkiqc6c",
            "sessionExpire": 1000,
            "healthSwitch": 1,
            "timeOut": 6,
            "intervalTime": 6,
            "healthNum": 3,
            "unhealthNum": 3,
            "httpCode": 15,
            "httpCheckPath": "/",
            "httpHash": "ip_hash",
            "SSLMode": "mutual",
            "certId": "4b9fc92b",
            "certCaId": "ee4c5590"
        },
        {
            "listenerId": "lbl-6hkiqc6c",
            "loadBalancerPort": 777,
            "instancePort": 798,
            "protocol": 4,
            "status": 1,
            "listenerName": "",
            "unListenerId": "lbl-6wv071ba",
            "sessionExpire": 0,
            "healthSwitch": 1,
            "timeOut": 2,
            "intervalTime": 5,
            "healthNum": 3,
            "unhealthNum": 3,
            "httpCode": 31,
            "httpCheckPath": "/",
            "httpHash": "wrr",
            "SSLMode": "mutual",
            "certId": "e2b6d555",
            "certCaId": "dcda0a22"
        }
    ],
    "totalCount": 2
}