DescribeListeners

1. API Description

This API is used to get the list of listeners by the load balancer ID and the listener protocol as filtering conditions. If no filtering conditions are specified, all listeners under the specified load balancer instance will be returned.

2. Input Parameters

The following request parameter list only provides API request parameters.

Parameter Name
Required
Type
Description

loadBalancerId

Yes

String

The ID of the load balance instance.

listenerIds

No

Array of String

The list of load balancer listener IDs to query.

protocol

No

The type of the queried listener protocol.

3. Output Parameters

Parameter Name
Type
Description

requestId

String

The unique request ID, which is returned for each request. RequestId is required to locate a problem.

listeners

Array of Listener

List of listeners.

4. Code Example

Query all listeners under a specified load balancer instance.

POST /api/v2/zlb HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: DescribeListeners
<Common Request Params>

Request:
{
  "loadBalancerId": "<loadBalancerId>"
}

Response:
{
  "requestId": "TFF2866DD-E3CF-47E4-8B52-D141992D6BB6",
  "response": {
    "listeners": [
      {
        "scheduler": "mh",
        "listenerId": "<loadBalancerId>",
        "protocol": "TCP",
        "port": "40",
        "createTime": "2025-01-01T01:01:01Z",
        "listenerName": "sample-name",
        "healthCheck": {
          "checkType": null,
          "checkHttpGetUrl": "",
          "checkDelayTry": null,
          "checkConnTimeout": null,
          "checkHttpStatusCode": null,
          "checkPort": null,
          "checkRetry": null,
          "enabled": false,
          "checkDelayLoop": null
        }
      }
    ],
    "requestId": "TFF2866DD-E3CF-47E4-8B52-D141992D6BB6"
  }
}

5. Developer Resources

Zenlayer Cloud API 2.0 SDKs to make it easier for you to call APIs. More programming languages will be supported.

6. Error Codes

No error codes related to the API business logic. For other error codes, see Common Error Codes.​

Last updated