Queries the configurations of an HTTP listener.

Prerequisites

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 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.

  • -1: indicates that the maximum bandwidth is unlimited.
  • 1 to 5120: the maximum bandwidth of the listener. The sum of the maximum bandwidth values of all listeners cannot exceed the maximum bandwidth value of the CLB instance.
Status String stopped

The status of the listener. Valid values:

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

Indicates whether the X-Forwarded-For header is used to preserve the real IP address of the client. Valid values:

  • on: yes
  • off: no
Scheduler String wrr

The scheduling algorithm. Valid values:

  • wrr: Backend servers that have higher weights receive more requests than the backend servers that have lower weights.
  • rr: Requests are distributed to backend servers in sequence.
StickySession String on

Indicates whether session persistence is enabled. Valid values:

  • on: yes
  • off: no
StickySessionType String insert

The method that is used to handle a cookie.

Valid values: insert and server.

  • insert: inserts a cookie.

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

  • server: rewrites a cookie.

    When CLB 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 this request to the recorded backend 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:

  • on: yes
  • off: no
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 gzip compression is enabled to compress specific types of files. Valid values:

  • on: yes
  • off: no
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:

  • on: yes
  • off: no
AclType String white

The type of the ACL. Valid values:

  • white: a whitelist. Only requests from the IP addresses or CIDR blocks in the ACL are forwarded. Whitelists apply to scenarios where you want to allow only specific IP addresses to access an application. Your business may be affected if the whitelist is not set properly. After a whitelist is configured, only IP addresses in the whitelist can access the CLB listener.

    If you enable a whitelist but the whitelist does not contain an IP address, the listener forwards all requests.

  • black: a blacklist. All requests from the IP addresses or CIDR blocks in the ACL are rejected. Blacklists apply to scenarios where you want to block access from specified IP addresses to an application.

    If you enable a blacklist but the blacklist does not contain an IP address, the CLB listener forwards all requests.

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:

  • on: yes
  • off: no
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:

  • on: yes
  • off: no
XForwardedFor_SLBID String on

Indicates whether the SLB-ID header is used to obtain the ID of the CLB instance. Valid values:

  • on: yes
  • off: no
XForwardedFor_SLBIP String on

Indicates whether the SLB-IP header is used to obtain the virtual IP address (VIP) requested by the client. Valid values:

  • on: yes
  • off: no
XForwardedFor_proto String on

Indicates whether the X-Forwarded-Proto header is used to obtain the listener protocol of the CLB instance. Valid values:

  • on: yes
  • off: no

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.