调用DescribeLoadBalancerHTTPListenerAttribute查询HTTP监听配置。
前提条件
- 您已经创建传统型负载均衡,具体操作,请参见CreateLoadBalancer。
- 您已经创建HTTP监听,具体操作,请参见CreateLoadBalancerHTTPListener。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | DescribeLoadBalancerHTTPListenerAttribute |
要执行的操作。 取值:DescribeLoadBalancerHTTPListenerAttribute。 |
ListenerPort | Integer | 是 | 80 |
负载均衡实例前端使用的端口。 取值:1~65535。 |
LoadBalancerId | String | 是 | lb-bp1o94dp5**** |
负载均衡实例的ID。 |
RegionId | String | 是 | cn-hangzhou |
负载均衡实例的地域ID。 您可以调用DescribeRegions接口获取地域ID。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
ListenerPort | Integer | 80 |
负载均衡实例前端使用的端口。 |
Bandwidth | Integer | -1 |
监听的带宽峰值。单位:Mbps。
|
Status | String | stopped |
当前监听的状态。取值:
|
XForwardedFor | String | on |
是否开启通过
|
Scheduler | String | wrr |
调度算法。取值:
|
StickySession | String | on |
是否开启会话保持。取值:
|
StickySessionType | String | insert |
Cookie的处理方式。 取值:insert或server。
说明 当StickySession的值为on时,必须指定该参数。
|
CookieTimeout | Integer | 500 |
Cookie超时时间。单位:秒。 |
Cookie | String | B490B5EBF6F3CD402E515D22BCDA1598 |
服务器上配置的Cookie。 |
HealthCheck | String | on |
是否开启健康检查。取值:
|
HealthCheckDomain | String | www.domain.com |
用于健康检查的域名。 |
HealthCheckURI | String | /test/index.html |
用于健康检查的URI。 长度限制为1~80,只能使用字母、数字和短划线(-)、正斜线(/)、半角句号(.)、百分号(%),半角问号(?)、井号(#)和and(&)这些字符。URI不能只为正斜线(/),但必须以正斜线(/)开头。 |
HealthyThreshold | Integer | 4 |
健康检查阈值。 |
UnhealthyThreshold | Integer | 4 |
不健康检查阈值。 |
HealthCheckTimeout | Integer | 3 |
每次健康检查响应的超时时间,单位:秒。 |
HealthCheckInterval | Integer | 5 |
健康检查的时间间隔,单位:秒。 |
HealthCheckHttpCode | String | http_2xx,http_3xx |
健康检查正常的HTTP状态码。 |
HealthCheckConnectPort | Integer | 8080 |
健康检查的端口。 说明 当HealthCheck值为on时才会有效。
|
VServerGroupId | String | rsp-cige6j**** |
绑定的服务器组ID。 |
Gzip | String | on |
是否开启
|
AclId | String | on |
监听绑定的访问策略组ID。 说明 当AclStatus参数的值为on时,该参数必选。
|
AclStatus | String | off |
是否开启访问控制功能。取值:
|
AclType | String | white |
访问控制类型:
说明 当AclStatus参数的值为on时,该参数必选。
|
BackendServerPort | Integer | 80 |
负载均衡实例后端使用的端口。 |
Description | String | test |
HTTP监听描述。 |
ForwardPort | Integer | 80 |
HTTP至HTTPS的监听转发端口。 说明 如果ListenerForward的值为off,该参数不显示。
|
HealthCheckMethod | String | get |
监听HTTP类型健康检查的健康检查方法。取值:head或get。 说明 HealthCheck值为on时,该参数才会显示。
|
IdleTimeout | Integer | 2 |
指定连接空闲超时时间,单位:秒。 默认值为15,取值范围为1~60。 在超时时间内一直没有访问请求,负载均衡会暂时中断当前连接,直到下一次请求来临时重新建立新的连接。 |
ListenerForward | String | on |
是否开启HTTP至HTTPS的监听转发。取值:
|
RequestId | String | 365F4154-92F6-4AE4-92F8-7FF34B540710 |
请求ID。 |
RequestTimeout | Integer | 34 |
指定请求超时时间。单位:秒。 默认值为60,取值范围为1~180。 在超时时间内后端服务器一直没有响应,负载均衡将放弃等待,给客户端返回HTTP 504错误码。 |
Rules | Array of Rule |
转发规则描述。 |
|
Rule | |||
Domain | String | www.example.com |
域名。 |
RuleId | String | 1234 |
转发规则ID。 |
RuleName | String | test |
转发规则名称。 |
Url | String | /example |
访问路径。 |
VServerGroupId | String | 123 |
转发规则的目标服务器组ID。 |
SecurityStatus | String | on |
是否开启安全状态。取值:
|
XForwardedFor_SLBID | String | on |
是否通过
|
XForwardedFor_SLBIP | String | on |
是否通过
|
XForwardedFor_proto | String | on |
是否通过
|
示例
请求示例
http(s)://[Endpoint]/?Action=DescribeLoadBalancerHTTPListenerAttribute
&ListenerPort=80
&LoadBalancerId=lb-bp1o94dp5****
&<公共请求参数>
正常返回示例
XML
格式
<DescribeLoadBalancerHTTPListenerAttributeResponse>
<CookieTimeout>500</CookieTimeout>
<VServerGroupId>rsp-cige6j****</VServerGroupId>
<Description>test</Description>
<UnhealthyThreshold>4</UnhealthyThreshold>
<HealthCheckURI>/test/index.html</HealthCheckURI>
<Scheduler>wrr</Scheduler>
<HealthCheck>on</HealthCheck>
<IdleTimeout>2</IdleTimeout>
<BackendServerPort>80</BackendServerPort>
<XForwardedFor_SLBID>on</XForwardedFor_SLBID>
<HealthCheckConnectPort>8080</HealthCheckConnectPort>
<HealthCheckMethod>get</HealthCheckMethod>
<SecurityStatus>on</SecurityStatus>
<Bandwidth>-1</Bandwidth>
<Gzip>on</Gzip>
<StickySessionType>insert </StickySessionType>
<XForwardedFor_SLBIP>on</XForwardedFor_SLBIP>
<HealthCheckHttpCode>http_2xx,http_3xx</HealthCheckHttpCode>
<Cookie>B490B5EBF6F3CD402E515D22BCDA1598</Cookie>
<Status>stopped</Status>
<RequestTimeout>34</RequestTimeout>
<ListenerPort>80</ListenerPort>
<HealthCheckInterval>5</HealthCheckInterval>
<RequestId>365F4154-92F6-4AE4-92F8-7FF34B540710</RequestId>
<AclId>on</AclId>
<HealthCheckTimeout>3</HealthCheckTimeout>
<Rules>
<Rule>
<VServerGroupId>123</VServerGroupId>
<RuleId>1234</RuleId>
<Domain>www.example.com</Domain>
<Url>/example</Url>
<RuleName>test</RuleName>
</Rule>
</Rules>
<ListenerForward>on</ListenerForward>
<StickySession>on</StickySession>
<ForwardPort>80</ForwardPort>
<AclStatus>off</AclStatus>
<HealthyThreshold>4</HealthyThreshold>
<XForwardedFor>on</XForwardedFor>
<HealthCheckDomain>www.domain.com</HealthCheckDomain>
<AclType>white</AclType>
<XForwardedFor_proto>on</XForwardedFor_proto>
</DescribeLoadBalancerHTTPListenerAttributeResponse>
JSON
格式
{
"CookieTimeout": 500,
"VServerGroupId": "rsp-cige6j****",
"Description": "test",
"UnhealthyThreshold": 4,
"HealthCheckURI": "/test/index.html",
"Scheduler": "wrr",
"HealthCheck": "on",
"IdleTimeout": 2,
"BackendServerPort": 80,
"XForwardedFor_SLBID": "on",
"HealthCheckConnectPort": 8080,
"HealthCheckMethod": "get",
"SecurityStatus": "on",
"Bandwidth": -1,
"Gzip": "on",
"StickySessionType": "insert",
"XForwardedFor_SLBIP": "on",
"HealthCheckHttpCode": "http_2xx,http_3xx",
"Cookie": "B490B5EBF6F3CD402E515D22BCDA1598",
"Status": "stopped",
"RequestTimeout": 34,
"ListenerPort": 80,
"HealthCheckInterval": 5,
"RequestId": "365F4154-92F6-4AE4-92F8-7FF34B540710",
"AclId": "on",
"HealthCheckTimeout": 3,
"Rules": {
"Rule": {
"VServerGroupId": 123,
"RuleId": 1234,
"Domain": "www.example.com",
"Url": "/example",
"RuleName": "test"
}
},
"ListenerForward": "on",
"StickySession": "on",
"ForwardPort": 80,
"AclStatus": "off",
"HealthyThreshold": 4,
"XForwardedFor": "on",
"HealthCheckDomain": "www.domain.com",
"AclType": "white",
"XForwardedFor_proto": "on"
}
错误码
访问错误中心查看更多错误码。