Queries the configurations of an HTTP listener.
Prerequisites
- A Classic Load Balancer (CLB) instance is created. For more information, see CreateLoadBalancer.
- An HTTP listener is created. For more information about how to create an HTTP listener, see CreateLoadBalancerHTTPListener.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | DescribeLoadBalancerHTTPListenerAttribute |
The operation that you want to perform. Set the value to DescribeLoadBalancerHTTPListenerAttribute. |
ListenerPort | Integer | Yes | 80 |
The frontend port that is used by the CLB instance. Valid values: 1 to 65535. |
LoadBalancerId | String | Yes | lb-bp1o94dp5**** |
The ID of the CLB instance. |
RegionId | String | Yes | cn-hangzhou |
The region ID of the CLB instance. You can call the DescribeRegions operation to query the most recent region list. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
ListenerPort | Integer | 80 |
The frontend port that is used by the CLB instance. |
Bandwidth | Integer | -1 |
The maximum bandwidth of the listener. Unit: Mbit/s.
|
Status | String | stopped |
The status of the listener. Valid values:
|
XForwardedFor | String | on |
Indicates whether the
|
Scheduler | String | wrr |
The scheduling algorithm. Valid values:
|
StickySession | String | on |
Indicates whether session persistence is enabled. Valid values:
|
StickySessionType | String | insert |
The method that is used to handle a cookie. Valid values: insert and server.
Note This parameter is required if the StickySession parameter is set to on.
|
CookieTimeout | Integer | 500 |
The timeout period of the cookie. Unit: seconds. |
Cookie | String | B490B5EBF6F3CD402E515D22BCDA1598 |
The cookie that is configured on the server. |
HealthCheck | String | on |
Indicates whether health checks are enabled. Valid values:
|
HealthCheckDomain | String | www.domain.com |
The domain name used for health checks. |
HealthCheckURI | String | /test/index.html |
The uniform resource identifier (URI) that is used for health checks. The URI must be 1 to 80 characters in length, and can contain only digits, letters, hyphens (-), forward slashes (/), periods (.), percent signs (%), question marks (?), number signs (#), and ampersands (&). The URI cannot be a single forward slash (/) but it must start with a forward slash (/). |
HealthyThreshold | Integer | 4 |
The number of consecutive health check successes before a backend server is declared as healthy. |
UnhealthyThreshold | Integer | 4 |
The number of consecutive health check failures before a backend server is declared unhealthy. |
HealthCheckTimeout | Integer | 3 |
The timeout period of each health check. Unit: seconds. |
HealthCheckInterval | Integer | 5 |
The interval between health checks. Unit: seconds. |
HealthCheckHttpCode | String | http_2xx,http_3xx |
The HTTP status code that indicates a successful health check. |
HealthCheckConnectPort | Integer | 8080 |
The port used for health checks. Note This parameter takes effect only when the HealthCheck parameter is set to on.
|
VServerGroupId | String | rsp-cige6j**** |
The ID of the associated server group. |
Gzip | String | on |
Indicates whether
|
AclId | String | on |
The ID of the access control list (ACL) to be associated with the listener. Note This parameter is required if the AclStatus parameter is set to on.
|
AclStatus | String | off |
Indicates whether the ACL feature is enabled. Valid values:
|
AclType | String | white |
The type of the ACL. Valid values:
Note If AclStatus is set to on, this parameter is required.
|
BackendServerPort | Integer | 80 |
The backend port that is used by the CLB instance. |
Description | String | test |
The description of the HTTP listener. |
ForwardPort | Integer | 80 |
The listener port that is used to redirect HTTP requests to HTTPS. Note If the ListenerForward parameter is set to off, this parameter is not returned.
|
HealthCheckMethod | String | get |
The health check method used in HTTP health checks. Valid values: head and get. Note This parameter is returned only if the HealthCheck parameter is set to on.
|
IdleTimeout | Integer | 2 |
The timeout period of an idle connection. Unit: seconds. Default value: 15. Valid values: 1 to 60. If no request is received within the specified timeout period, CLB closes the connection. CLB starts a new connection when it receives a new connection request. |
ListenerForward | String | on |
Indicates whether HTTP-to-HTTPS redirection is enabled. Valid values:
|
RequestId | String | 365F4154-92F6-4AE4-92F8-7FF34B540710 |
The ID of the request. |
RequestTimeout | Integer | 34 |
The timeout period of a request. Unit: seconds. Default value: 60. Valid values: 1 to 180. If no response is received from the backend server within the specified timeout period, CLB sends an HTTP 504 error code to the client. |
Rules | Array of Rule |
The list of forwarding rules. |
|
Rule | |||
Domain | String | www.example.com |
The domain name. |
RuleId | String | 1234 |
The ID of the forwarding rule. |
RuleName | String | test |
The name of the forwarding rule. |
Url | String | /example |
The request path. |
VServerGroupId | String | 123 |
The ID of the vServer group with which the forwarding rule is associated. |
SecurityStatus | String | on |
Specifies whether to enable security hardening. Valid values:
|
XForwardedFor_SLBID | String | on |
Indicates whether the
|
XForwardedFor_SLBIP | String | on |
Indicates whether the
|
XForwardedFor_proto | String | on |
Indicates whether the
|
Examples
Sample requests
http(s)://[Endpoint]/?Action=DescribeLoadBalancerHTTPListenerAttribute
&ListenerPort=80
&LoadBalancerId=lb-bp1o94dp5****
&<Common request parameters>
Sample success responses
XML
format
<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
format
{
"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"
}
Error codes
For a list of error codes, visit the API Error Center.