调用DescribeLoadBalancerHTTPListenerAttribute查询HTTP监听配置。
接口说明
API 调用频率:100 次/秒。
单用户调用频率:10 次/秒。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
ens:DescribeLoadBalancerHTTPListenerAttribute |
get |
*全部资源
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| ListenerPort |
integer |
是 |
需要查询的监听端口。取值:1~65535。 |
80 |
| LoadBalancerId |
string |
是 |
负载均衡实例的 ID。 |
lb-5snthcyu1x10g7tywj7iu**** |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
Schema of Response |
||
| RequestId |
string |
请求 ID。 |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
| ListenerPort |
integer |
监听端口。 |
80 |
| Status |
string |
当前监听的状态。取值:
|
Running |
| Bandwidth |
integer |
负载均衡带宽峰值,默认值为-1(表示不限速)。 |
-1 |
| Scheduler |
string |
调度算法。取值:
|
wrr |
| HealthCheck |
string |
是否开启健康检查。取值:
|
on |
| HealthyThreshold |
integer |
健康检查连续成功多少次后,将后端服务器的健康检查状态由 fail(后台服务器不可达)判定为 success(后台服务器可达)。取值:2~10。 说明
HealthCheck 值为 on 时才会有效。 |
3 |
| UnhealthyThreshold |
integer |
健康检查连续失败多少次后,将后端服务器的健康检查状态由 success(后台服务器可达)判定为 fail(后台服务器不可达)。取值:2~10。 说明
HealthCheck 值为 on 时才会有效。 |
3 |
| HealthCheckTimeout |
integer |
接收来自运行状况检查的响应需要等待的时间。如果后端 ENS 在指定的时间内没有响应,则判定为健康检查失败。
说明
|
10 |
| HealthCheckConnectPort |
integer |
健康检查使用的端口,取值:1~65535。不设置此参数时,表示使用后端服务端口(BackendServerPort)。 说明
HealthCheck 值为 on 时才会有效。 |
5000 |
| HealthCheckInterval |
integer |
健康检查的时间间隔。取值:1~50,单位:秒。 说明
HealthCheck 值为 on 时才会有效。 |
5 |
| Description |
string |
设置监听的描述信息。长度限制为 1~80 个字符。 说明
不能以 |
abc |
| ListenerForward |
string |
是否开启 HTTP 至 HTTPS 的转发。取值:
|
off |
| ForwardPort |
integer |
HTTP 至 HTTPS 的监听转发端口。 |
10002 |
| RequestTimeout |
integer |
指定请求超时时间,默认值:60 秒,取值:1~180,单位:秒。 说明
在超时时间内后端服务器一直没有响应,负载均衡将放弃等待,给客户端返回 HTTP 的 504 错误码。 |
60 |
| IdleTimeout |
integer |
指定连接空闲超时时间,默认值:15 秒,取值:1~60,单位:秒。 说明
在超时时间内一直没有访问请求,负载均衡会暂时中断当前连接,直到一下次请求来临时重新建立新的连接。 |
15 |
| HealthCheckHttpCode |
string |
健康检查正常时的 HTTP 状态码。取值:
说明
HealthCheck 值为 on 时才会有效。 |
http_2xx |
| HealthCheckDomain |
string |
用于健康检查的域名。 说明
HealthCheck 值为 on 时才会有效。 |
www.example.com |
| HealthCheckURI |
string |
用于健康检查的 URI。长度限制为 1~80。 说明
|
/checkpreload.htm |
| ServerCertificateId |
string |
服务器证书的 ID。 |
6027667 |
| HealthCheckMethod |
string |
监听 HTTP 类型健康检查的健康检查方法。取值:
说明
HealthCheck 值为 on 时才会有效。 |
head |
| XForwardedFor |
string |
是否开启通过 X-Forwarded-For 字段获取来访者真实 IP。取值:
|
on |
| BackendServerPort |
integer |
负载均衡实例后端服务器使用的端口,取值:1~65535。 |
8080 |
示例
正常返回示例
JSON格式
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
"ListenerPort": 80,
"Status": "Running",
"Bandwidth": -1,
"Scheduler": "wrr",
"HealthCheck": "on",
"HealthyThreshold": 3,
"UnhealthyThreshold": 3,
"HealthCheckTimeout": 10,
"HealthCheckConnectPort": 5000,
"HealthCheckInterval": 5,
"Description": "abc",
"ListenerForward": "off",
"ForwardPort": 10002,
"RequestTimeout": 60,
"IdleTimeout": 15,
"HealthCheckHttpCode": "http_2xx",
"HealthCheckDomain": "www.example.com",
"HealthCheckURI": "/checkpreload.htm",
"ServerCertificateId": "6027667",
"HealthCheckMethod": "head",
"XForwardedFor": "on\n",
"BackendServerPort": 8080
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | LoadBalancerNotFound | The input parameter loadBalancerId that is not found. | |
| 400 | ListenerNotFound | Listener is not found. | 监听不存在 |
| 400 | ens.interface.error | Failed to call API. | 接口调用发生异常。 |
| 400 | NoPermission | Permission denied. | |
| 400 | InvalidParameter.%s | The specified field %s invalid. Please check it again. |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。