DescribeListeners
1. API Description
This API (DescribeListeners) is used to query the information of one or more specified listeners. Users can search for listener information based on the ID of the load balancer, the ID of the listener, and other information.
2. Input Parameters
The following request parameter list only provides API request parameters.
listenerIds
No
Array of String
List of listener IDs.
Up to 100 requests are supported.
loadBalancerIds
No
Array of String
List of load balancer instance IDs.
Up to 100 requests are supported.
listenerName
No
String
Listener name.
Fuzzy search supported.
pageNum
No
Integer
Number of pages returned.
Default value: 1 .
Default value: 1
pageSize
No
Integer
Number of items in the current page result.
Default value: 20 ;
Maximum value: 1000 .
3. Output Parameters
requestId
String
The unique request ID, which is returned for each request.
RequestId is required for locating a problem.
totalCount
Integer
The total number of listeners that meet the filtering conditions.
4. Code Example
Query listeners by load balancer instance ID.
POST /api/v2/bmc HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: DescribeListeners
<Common Request Params>
Request:
{
"loadBalancerIds": ["xxxx"]
}
Response:
{
"requestId": "TEEFDCA5B-76FB-4E91-A18E-DF7F5D2CE41F",
"response": {
"requestId": "TEEFDCA5B-76FB-4E91-A18E-DF7F5D2CE41F",
"totalCount": 10,
"dataSet": [
{
"listenerId": "xxxxx",
"listenerName": "xxxx",
"status": "Available",
"port": "80",
"protocol": "TCP",
"backendProtocol": "TCP",
"scheduler": "rr",
"kind": "DR",
"loadBalancerId": "xxxx",
"createTime": "2022-08-31 11:11:20"
}
]
}
}5. Developer Resources
Zenlayer Cloud API 2.0 integrates SDKs,to make it easier for you to call APIs. More programming languages will be supported.
6. Error Codes
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
HTTP Status Code
Error Code
Description
Last updated