All Products
Search
Document Center

Server Load Balancer:DescribeLoadBalancerHTTPListenerAttribute

Last Updated:Sep 20, 2024

Queries the configurations of an HTTP listener.

Operation description

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
slb:DescribeLoadBalancerHTTPListenerAttributeget
  • loadbalancer
    acs:slb:{#regionId}:{#accountId}:loadbalancer/{#loadbalancerId}
  • slb:tag
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringNo

The region ID of the CLB instance.

You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou
LoadBalancerIdstringYes

The CLB instance ID.

lb-bp1uaunez0uho0zf0****
ListenerPortintegerYes

The frontend port that is used by the CLB instance.

Valid values: 1 to 65535.

80

Response parameters

ParameterTypeDescriptionExample
object
AclTypestring

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 service may be adversely affected if the whitelist is not properly configured. If a whitelist is configured, only requests from IP addresses that are added to the whitelist are forwarded by the listener.

If you enable a whitelist but do not add an IP address to the ACL, the listener forwards all requests.

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

If a blacklist is configured for a listener but no IP address is added to the blacklist, the listener forwards all requests.

Note This parameter is required when AclStatus is set to on.
white
VServerGroupIdstring

The ID of the associated server group.

rsp-cige6j****
Statusstring

The status of the listener. Valid values:

  • running
  • stopped
stopped
XForwardedFor_ClientSrcPortstring

Indicates whether the XForwardedFor_ClientSrcPort header is used to retrieve the client port. Valid values:

  • on
  • off
off
Cookiestring

The cookie that is configured on the server.

B490B5EBF6F3CD402E515D22BCDA1598
Gzipstring

Indicates whether Gzip compression is enabled to compress specific types of files. Valid values:

  • on
  • off
on
HealthCheckConnectPortinteger

The port that is used for health checks.

Note This parameter takes effect only when HealthCheck is set to on.
8080
RequestIdstring

The request ID.

365F4154-92F6-4AE4-92F8-7FF34B540710
Descriptionstring

The name of the listener.

test
Bandwidthinteger

The maximum bandwidth of the listener. Unit: Mbit/s.

  • -1: If -1 is returned, it indicates that the bandwidth of the listener is unlimited.
  • 1 to 5120: If a value from 1 to 5120 is returned, the value indicates the maximum bandwidth of the listener. The sum of the maximum bandwidth of all listeners added to a CLB instance does not exceed the maximum bandwidth of the CLB instance.
-1
HealthCheckTimeoutinteger

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

3
AclStatusstring

Indicates whether access control is enabled. Valid values:

  • on
  • off
off
BackendServerPortinteger

The backend port that is used by the CLB instance.

80
CookieTimeoutinteger

The timeout period of a cookie. Unit: seconds.

500
HealthCheckDomainstring

The domain name that you want to use for health checks.

www.domain.com
UnhealthyThresholdinteger

The unhealthy threshold.

4
ForwardPortinteger

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 displayed.
80
XForwardedFor_SLBIDstring

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

  • on
  • off
on
SecurityStatusstring

Indicates whether the listener is in the Secure state. Valid values:

  • on
  • off
on
HealthCheckHttpCodestring

The HTTP status code for a successful health check.

http_2xx,http_3xx
ListenerForwardstring

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

  • on
  • off
on
XForwardedForstring

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

  • on
  • off
on
IdleTimeoutinteger

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. When a request is received, CLB establishes a new connection.

2
RequestTimeoutinteger

The timeout period of a request. Unit: seconds.

Default value: 60. Valid values: 1 to 180.

If no response is received from a backend server within the specified timeout period, CLB returns the HTTP 504 status code to the client.

34
ListenerPortinteger

The frontend port that is used by the CLB instance.

80
HealthCheckIntervalinteger

The interval at which health checks are performed. Unit: seconds.

5
XForwardedFor_SLBPORTstring

Indicates whether the XForwardedFor_SLBPORT header is used to retrieve the listener port of the CLB instance. Valid values:

  • on
  • off
off
HealthCheckURIstring

The URL path 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 must start with a forward slash (/) but cannot be a single forward slash (/).

/test/index.html
StickySessionTypestring

The method that is used to handle a cookie.

Valid values: insert and server.

  • insert: inserts a cookie.

    CLB inserts a session cookie (SERVERID) into the first HTTP or HTTPS response that is sent to a client. Subsequent requests to CLB carry this cookie, and CLB determines the destination servers of the requests based on the cookies.

  • 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 carries the user-defined cookie, and the listener forwards this request to the recorded backend server.

Note This parameter is required when StickySession is set to on.
insert
AclIdstring

The ID of the network ACL that is associated with a listener.

Note This parameter is returned when AclStatus is set to on.
on
Schedulerstring

The routing algorithm. Valid values:

  • wrr: Backend servers that have higher weights receive more requests than backend servers that have lower weights.
  • ** rr**: Requests are sequentially distributed to backend servers.
wrr
HealthyThresholdinteger

The healthy threshold.

4
XForwardedFor_protostring

Indicates whether the X-Forwarded-Proto header is used to retrieve the listener protocol. Valid values:

  • on
  • off
on
XForwardedFor_SLBIPstring

Indicates whether the SLB-IP header is used to retrieve the virtual IP address requested by the client. Valid values:

  • on
  • off
on
StickySessionstring

Indicates whether session persistence is enabled. Valid values:

  • on
  • off
on
HealthCheckMethodstring

The health check method used by HTTP listeners. Valid values: head and get.

Note This parameter is returned when HealthCheck is set to on.
get
HealthCheckstring

Indicates whether the health check feature is enabled. Valid values:

  • on
  • off
on
Rulesarray<object>

The list of forwarding rules.

object
VServerGroupIdstring

The ID of the server group specified in the forwarding rule.

123
Urlstring

The request URL.

/example
Domainstring

The domain name.

www.example.com
RuleNamestring

The name of the forwarding rule.

test
RuleIdstring

The ID of the forwarding rule.

1234
LoadBalancerIdstring

The CLB instance ID.

lb-bp1uaunez0uho0zf0****
Tagsarray<object>

The tags.

object
TagKeystring

The key of tag N. Valid values of N: 1 to 20. The tag key cannot be an empty string. The tag key can be up to 64 characters in length. The key cannot start with acs: or aliyun or contain http:// or https://.

TestKey
TagValuestring

The value of tag N. Valid values of N: 1 to 20. The tag value can be an empty string. The tag value must be 0 to 128 characters in length, and cannot start with acs:. It cannot contain http:// or https://.

TestValue

Examples

Sample success responses

JSONformat

{
  "AclType": "white",
  "VServerGroupId": "rsp-cige6j****",
  "Status": "stopped",
  "XForwardedFor_ClientSrcPort": "off",
  "Cookie": "B490B5EBF6F3CD402E515D22BCDA1598",
  "Gzip": "on",
  "HealthCheckConnectPort": 8080,
  "RequestId": "365F4154-92F6-4AE4-92F8-7FF34B540710",
  "Description": "test",
  "Bandwidth": -1,
  "HealthCheckTimeout": 3,
  "AclStatus": "off",
  "BackendServerPort": 80,
  "CookieTimeout": 500,
  "HealthCheckDomain": "www.domain.com",
  "UnhealthyThreshold": 4,
  "ForwardPort": 80,
  "XForwardedFor_SLBID": "on",
  "SecurityStatus": "on",
  "HealthCheckHttpCode": "http_2xx,http_3xx",
  "ListenerForward": "on",
  "XForwardedFor": "on",
  "IdleTimeout": 2,
  "RequestTimeout": 34,
  "ListenerPort": 80,
  "HealthCheckInterval": 5,
  "XForwardedFor_SLBPORT": "off",
  "HealthCheckURI": "/test/index.html",
  "StickySessionType": "insert ",
  "AclId": "on",
  "Scheduler": "wrr",
  "HealthyThreshold": 4,
  "XForwardedFor_proto": "on",
  "XForwardedFor_SLBIP": "on",
  "StickySession": "on",
  "HealthCheckMethod": "get",
  "HealthCheck": "on",
  "Rules": {
    "Rule": [
      {
        "VServerGroupId": "123",
        "Url": "/example",
        "Domain": "www.example.com",
        "RuleName": "test",
        "RuleId": "1234"
      }
    ]
  },
  "LoadBalancerId": "lb-bp1uaunez0uho0zf0****",
  "Tags": {
    "Tag": [
      {
        "TagKey": "TestKey",
        "TagValue": "TestValue"
      }
    ]
  }
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-05-28The response structure of the API has changedView Change Details
2023-12-14The response structure of the API has changedView Change Details