最近更新时间:2023.11.21 10:31:46
首次发布时间:2021.08.31 10:37:27
调用 DescribeListeners 接口查询监听器列表。
名称 | 类型 | 是否必填 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | DescribeListeners | 要执行的操作,取值为DescribeListeners。 |
Version | String | 是 | 2020-04-01 | API版本信息,当前版本为:2020-04-01。 |
LoadBalancerId | String | 否 | clb-bp1o94dp5i6ea**** | 负载均衡实例ID。您可以调用DescribeLoadBalancers接口获取负载均衡实例ID。 |
ListenerIds.N | String | 否 | ListenerIds.1=lsn-2fek3rgsxhrsw5oxruwec&ListenerIds.2=lsn-2fel9ycnzz94w5oxruv8 | 监听器的ID。您可以调用本接口接口获取监听器ID。 |
ListenerName | String | 否 | mylistener | 监听器的名称。 |
PageSize | Integer | 否 | 20 | 分页查询时每页的行数,取值范围为1 ~ 100,默认为10。 |
PageNumber | Integer | 否 | 1 | 列表的页码,默认值为1。 |
字段 | 类型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | 20210811152539010225146063030**** | 请求ID |
PageSize | Integer | 20 | 当前分页的行数。 |
PageNumber | Integer | 1 | 当前页码。 |
TotalCount | Integer | 50 | 符合条件的监听器总数。 |
Listeners | Array of Struct | - | 符合条件的监听器的详细信息。具体请参见下表“ Listeners ”。 |
字段 | 类型 | 示例值 | 描述 |
---|---|---|---|
CreateTime | String | 2021-08-11T16:37:37Z | 监听器的创建时间。 |
UpdateTime | String | 2021-08-11T16:37:37Z | 监听器的最近操作时间。 |
ListenerId | String | lsn-2fek3rgsxhrsw5oxruwec**** | 监听器的ID。 |
ListenerName | String | mylistener | 监听器的名称。 |
AclStatus | String | off | 是否开启访问控制功能。
|
AclType | String | black | 访问控制的方式。
说明 仅 |
Bandwidth | Integer | 10 | 监听器的带宽峰值,单位为Mbps。 |
AclIds | Array of String | ["acl-2fe5excqgk6ww5oxruvcv****","acl-2febxt4pu0zy85oxruw0t****"] | 监听器绑定的访问控制策略组ID。 说明 仅 |
Protocol | String | TCP | 监听器的协议。
|
Scheduler | String | wrr | 监听器使用的调度算法。
说明 该参数目前仅华南1(广州)、华东2(上海)地域返回,其他地域不返回。 |
ProxyProtocolType | String | off | 是否启用PP协议。取值如下:
|
PersistenceType | String | off | 会话保持的类型。
|
PersistenceTimeout | Integer | 10 | 会话保持的超时时间,单位为秒。 |
ConnectionDrainEnabled | String | on | 监听器是否开启连接优雅中断功能。
说明 参数 |
ConnectionDrainTimeout | Integer | 2 | 连接优雅中断的超时时间,单位为秒。 说明 参数 |
Port | Integer | 80 | 监听器接收请求使用的端口。 |
Status | String | Active | 监听器的状态。
|
Enabled | String | off | 是否启用监听器。
|
ServerGroupId | String | rsp-bp1o94dp5i6ea**** | TCP/UDP监听器关联的后端服务器组的ID。HTTP/HTTPS监听器关联的默认后端服务器组ID。 |
CertificateId | String | cert-bp1o94dp5i6ea**** | HTTPS监听器关联的证书ID。 |
HealthCheck | Struct | - | 健康检查相关的参数,不同协议所需参数不同。具体请参见如下“ HealthCheck ”结构。 |
字段 | 类型 | 示例值 | 描述 |
---|---|---|---|
Enabled | String | off | 监听器是否开启健康检查功能。
|
UdpRequest | String | Request123 | 执行健康检查的请求字符串。 |
UdpExpect | String | Expect123 | 健康检查的预期响应字符串。 |
Interval | Integer | 2 | 执行健康检查的时间间隔。 |
Timeout | Integer | 2 | 健康检查的响应超时时间,表示如果后端服务器在指定的时间内没有正确响应,则判定为健康检查异常。 |
HealthyThreshold | Integer | 3 | 健康检查的健康阈值,表示连续执行指定次数的健康检查,结果均为“正常”的后端服务器将被判定为健康检查“正常”。 |
UnHealthyThreshold | Integer | 3 | 健康检查的不健康阈值,表示连续执行指定次数的健康检查,结果均为“异常”的后端服务器将被判定为健康检查“异常”。 |
Method | String | GET | 监听器健康检查的方法。
说明 TCP/UDP监听器不返回该参数。 |
Uri | String | / | 健康检查的路径。 说明 TCP/UDP监听器不返回该参数。 |
Domain | String | www.test.com | 健康检查的域名。 说明 TCP/UDP监听器不返回该参数。 |
HttpCode | String | http_2xx | 健康检查正常的HTTP状态码。
说明 TCP/UDP监听器不返回该参数。 |
GET /?Action=DescribeListeners&Version=2020-04-01&LoadBalancerId=clb-bp1o94dp5i6ea****&PageSize=20&PageNumber=1&ListenerIds.1=lsn-2fek3rgsxhrsw5oxr****&ListenerName=test HTTP/1.1 Host: open.volcengineapi.com Region: cn-beijing Service: clb
{ "ResponseMetadata": { "RequestId": "20210811152539010225146063030****", "Action": "DescribeListeners", "Version": "2020-04-01", "Service": "clb", "Region": "cn-beijing" }, "Result": { "RequestId": "20210811152539010225146063030****", "PageNumber": 1, "PageSize": 20, "TotalCount": 1, "Listeners": [ { "CreateTime": "2021-08-14T11:13:40Z", "UpdateTime": "2021-08-14T11:13:41Z", "ListenerId": "lsn-2fek3rgsxhrsw5oxr****", "ListenerName": "test", "AclStatus": "on", "AclType": "black", "Bandwidth": -1, "AclIds": [ "acl-2fe5excqgk6ww5oxruvcv****", "acl-2febxt4pu0zy85oxruw0t****" ], "Enabled": "on", "Protocol": "HTTPS", "Scheduler": "wrr", "ProxyProtocolType": "off", "PersistenceType": "off", "PersistenceTimeut": 0, "ConnectionDrainEnabled": "off", "ConnectionDrainTimeout": 0, "Port": 3, "Status": "Active", "ServerGroupId": "rsp-bp1o94dp5i6ea****", "HealthCheck": { "Enabled": "on", "Interval": 12, "HealthyThreshold": 4, "UnHealthyThreshold": 5, "Timeout": 0 } } ] } }
此处仅展示当前API的错误码,更多错误码请参见公共错误码。
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | InvalidName.Malformed | The specified Name is malformed. | 指定的 Name 参数格式不合法。 |
400 | InvalidPaging.Malformed | The specified PageNumber or PageSize is malformed. | 指定的分页参数格式不合法。 |
400 | LimitExceeded.ListenerId | You've reached the limit on the number of Listener that you can operate. | 已达到单次可操作 ListenerId 的资源数量上限。 |