Queries the configurations of an HTTP listener.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

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 Server Load Balancer (SLB) instance.

Valid values: 1 to 65535.

LoadBalancerId String Yes lb-bp1o94dp5*********

The ID of the SLB instance.

RegionId String Yes cn-hangzhou

The ID of the region where the Server Load Balancer (SLB) instance is deployed.

You can query the most recent region list from the Regions and zones list or by calling the DescribeRegions operation.

Response parameters

Parameter Type Example Description
ListenerPort Integer 80

The frontend port that is used by the SLB instance.

Bandwidth Integer -1

Specify the maximum bandwidth value of the listener.

  • -1: If you set the value to -1, this indicates that the maximum bandwidth value of the listener is unlimited.
  • 1 to 5120: If you set the value to a number from 1 to 5120, the value that you specify indicates the maximum bandwidth value of the listener. The sum of maximum bandwidth values of all listeners cannot exceed the maximum bandwidth value of the SLB instance.
Status String stopped

The state of the listener.

Valid values: running and stopped.

  • running: The listener runs as expected.
  • stopped: The listener is stopped.
XForwardedFor String on

Indicates whether the X-Forwarded-For header is added to obtain the real IP address of the client.

Valid values: on and off.

Scheduler String wrr

The scheduling algorithm.

Valid values: wrr and rr.

  • wrr (default): Backend servers that have higher weights receive more requests than those that have lower weights.
  • rr: Requests are distributed to each backend server in sequence.
StickySession String on

Indicates whether session persistence is enabled. Default value: on.

Valid values: on and off.

StickySessionType String insert

The method that is used to handle a cookie.

Valid values: insert and server.

  • insert: inserts a cookie.

    SLB inserts a cookie (SERVERID) into the first HTTP or HTTPS response packet that is sent to a client. The next request from the client contains this cookie and the listener distributes this request to the recorded backend server.

  • server: rewrites a cookie.

    When SLB detects a user-defined cookie, it overwrites the original cookie with the user-defined cookie. The next request from the client will contain the user-defined cookie, and the listener will distribute the request to the recorded backend server.

Note If you set the StickySession parameter to on, this parameter is required.
CookieTimeout Integer 500

The timeout period of the cookie.

Cookie String B490B5EBF6F3CD402E515D22BCDA1598

The cookie to be configured on the backend server.

HealthCheck String on

Indicates whether health checks are enabled.

Valid values: on and off.

HealthCheckDomain String www.domain.com

The domain name that is used for health checks.

HealthCheckURI String /test/index.html

The URI that is used for health checks.

The value must be 1 to 80 characters in length, and can contain letters, digits, hyphens (-), forward slashes (/), periods (.), percent signs (%), question marks (?), number signs (#), and ampersands (&). The URI must not be a single forward slash (/) but it must start with a forward slash (/).

HealthyThreshold Integer 4

The healthy threshold.

UnhealthyThreshold Integer 4

The unhealthy threshold.

HealthCheckTimeout Integer 3

The timeout period of each health check response. Unit: seconds.

HealthCheckInterval Integer 5

The interval between two consecutive 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 that is used for health checks.

Note This parameter takes effect only if the HealthCheck parameter is set to on.
VServerGroupId String rsp-cige6j****

The ID of the associated server group.

Gzip String on

Indicates whether gzip compression is enabled to compress files of a specific type.

Valid values: on and off.

AclId String on

The ID of the access control list (ACL) to which the listener is bound.

This parameter is required if the AclStatus parameter is set to on.

AclStatus String off

Indicates whether access control is enabled.

Valid values: on and off. Default value: off.

AclType String white

The type of the ACL. Valid values:

  • white: specifies the ACL as a whitelist. Only requests from the IP addresses or CIDR blocks in the ACL are forwarded. Whitelists apply to scenarios that require you to allow only specific IP addresses to access an application.

    Risks may arise if you specify an ACL as a whitelist. After the whitelist is enabled, only IP addresses in the whitelist are forwarded by the SLB listener. If a whitelist is enabled without IP addresses specified, the SLB listener does not forward requests.

  • black: specifies the ACL as a blacklist. All requests from the IP addresses or CIDR blocks in the ACL are rejected. Blacklists apply to scenarios that require you to block access from specific IP addresses to an application.

    If the blacklist is enabled but the corresponding ACL does not contain IP addresses, the SLB listener forwards all requests.

This parameter is required if the AclStatus parameter is set to on.

BackendServerPort Integer 80

The backend port that is used by the SLB instance.

Description String test

The description of the HTTP listener.

ForwardPort Integer 80

The listening port that is used to redirect HTTP requests to HTTPS.

Note If the value of the ListenerForward parameter is set to off, this parameter is not displayed.
IdleTimeout Integer 2

The timeout period of an idle connection. Unit: seconds. Valid values: 1 to 60. Default value: 15.

If no request is received within the specified timeout period, SLB closes the connection. SLB starts a new connection if it receives a new connection request.

ListenerForward String on

Indicates whether HTTP-to-HTTPS redirection is enabled. Valid values:

  • on: enabled
  • off: disabled
RequestId String 365F4154-92F6-4AE4-92F8-7FF34B540710

The ID of the request.

RequestTimeout Integer 34

The timeout period of a request. Valid values: 1 to 180. Unit: seconds. Default value: 60.

If no response is received from the backend server during the request timeout period, SLB sends an HTTP 504 error code to the client.

Rules Array of Rule

The description of the forwarding rule.

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 server group with which the forwarding rule is associated.

SecurityStatus String on

The security status.

Valid values: on and off.

XForwardedFor_SLBID String on

Indicates whether the SLB-ID header is added to obtain the ID of the SLB instance.

XForwardedFor_SLBIP String on

Indicates whether the SLB-IP header is used to obtain the real IP address of the client.

XForwardedFor_proto String on

Indicates whether the X-Forwarded-Proto header is used to obtain the listener protocol of the SLB instance.

Examples

Sample requests

http(s)://[Endpoint]/?Action=DescribeLoadBalancerHTTPListenerAttribute
&ListenerPort=80
&LoadBalancerId=lb-bp1o94dp5*********
&<Common request parameters>

Sample success responses

XML format

<DescribeLoadBalancerHTTPListenerAttributeResponse>
    <ForwardPort>443</ForwardPort>
    <ListenerPort>80</ListenerPort>
    <Status>stopped</Status>
    <RequestId>99439CEF-192C-4B01-A45A-2D5BD5BCDA62</RequestId>
    <ListenerForward>on</ListenerForward>
</DescribeLoadBalancerHTTPListenerAttributeResponse>

JSON format

{
    "ForwardPort": 443, 
    "ListenerPort": 80, 
    "Status": "stopped", 
    "RequestId": "99439CEF-192C-4B01-A45A-2D5BD5BCDA62", 
    "ListenerForward": "on"
}

Error codes

For a list of error codes, visit the API Error Center.