Queries the configuration of an HTTP listener on a Classic Load Balancer (CLB) instance.
Prerequisites
Before you begin, ensure that you have:
A CLB instance. To create one, call the CreateLoadBalancer operation.
An HTTP listener on the CLB instance. To create one, call the CreateLoadBalancerHTTPListener operation.
Try it now
RAM authorization
To call this operation, your RAM user or RAM role must have the following permissions. Define these in a Resource Access Management (RAM) policy using the fields described below.
Action: The action to include in the
Actionelement of a RAM policy statement.Access level: The predefined access level for this action. Valid values: create, list, get, update, and delete.
Resource type: The resource type that supports authorization. Required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the
Resourceelement. For actions without resource-level permissions, use an asterisk (*) in theResourceelement.Condition key: Condition keys defined by the service, used for fine-grained access control. In addition to service-specific keys, Alibaba Cloud provides common condition keys applicable to all RAM-supported services.
Dependent action: Additional actions required to complete this action. The RAM user or role must have permission for all dependent actions.
| Action | Access level | Resource type | Condition key | Dependent action |
|---|---|---|---|---|
| slb:DescribeLoadBalancerHTTPListenerAttribute | get | *loadbalanceracs:slb:{#regionId}:{#accountId}:loadbalancer/{#loadbalancerId} | slb:tag | None |
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| RegionId | string | No | The region of the CLB instance. Call DescribeRegions to get the region ID. | cn-hangzhou |
| LoadBalancerId | string | Yes | The ID of the CLB instance. | lb-bp1uaunez0uho0zf0**** |
| ListenerPort | integer | Yes | The frontend port of the CLB instance. Valid values: 1 to 65535. | 80 |
Response elements
| Element | Type | Description | Example |
|---|---|---|---|
| RequestId | string | The request ID. | 365F4154-92F6-4AE4-92F8-7FF34B540710 |
| LoadBalancerId | string | The ID of the CLB instance. | lb-bp1uaunez0uho0zf0**** |
| ListenerPort | integer | The frontend port of the CLB instance. | 80 |
| Description | string | The name of the listener. | HTTP_80 |
| Status | string | The status of the listener. Valid values: running | stopped | stopped |
| Bandwidth | integer | The maximum bandwidth of the listener, in Mbit/s. -1 means the bandwidth is unlimited. For values from 1 to 5120, the sum of the maximum bandwidth of all listeners on a CLB instance cannot exceed the maximum bandwidth of that instance. | -1 |
| Scheduler | string | The routing algorithm. Valid values: wrr (weighted round robin — servers with higher weights receive more requests) | rr (round robin — requests are distributed sequentially) | wrr |
| BackendServerPort | integer | The backend port of the CLB instance. | 80 |
| VServerGroupId | string | The ID of the associated server group. | rsp-cige6j**** |
| ListenerForward | string | Specifies whether HTTP-to-HTTPS redirect is enabled. Valid values: on | off | on |
| ForwardPort | integer | The listener port to which HTTP requests are redirected over HTTPS. Returned only when ListenerForward is set to on. | 80 |
| StickySession | string | Specifies whether session persistence is enabled. Valid values: on | off | on |
| StickySessionType | string | The method used to handle cookies. Required when StickySession is on. Valid values: insert (CLB inserts a SERVERID session cookie into the first HTTP or HTTPS response; subsequent requests carry this cookie and are routed to the same backend server) | server (when CLB detects a user-defined cookie, it overwrites the original cookie; subsequent requests carry the user-defined cookie and are forwarded to the recorded backend server) | insert |
| Cookie | string | The cookie configured on the server. | testCookie |
| CookieTimeout | integer | The cookie timeout period, in seconds. | 500 |
| IdleTimeout | integer | The idle connection timeout period, in seconds. Default value: 15. Valid values: 1 to 60. If no request is received within this period, CLB closes the connection. When a new request arrives, CLB establishes a new connection. | 2 |
| RequestTimeout | integer | The request timeout period, in seconds. Default value: 60. Valid values: 1 to 180. If no response is received from a backend server within this period, CLB returns an HTTP 504 error to the client. | 34 |
| Gzip | string | Specifies whether Gzip compression is enabled for specific file types. Valid values: on | off | on |
| SecurityStatus | string | Specifies whether the listener is in the Secure state. Valid values: on | off | on |
| AclStatus | string | Specifies whether access control is enabled. Valid values: on | off | off |
| AclId | string | The ID of the access control list (ACL) associated with the listener. Returned when AclStatus is on. | acl-uf60jw****** |
| AclType | string | The type of ACL. Required when AclStatus is on. Valid values: white (whitelist — only requests from IP addresses or CIDR blocks in the ACL are forwarded; if the whitelist is configured but empty, all requests are forwarded) | black (blacklist — all requests from IP addresses or CIDR blocks in the ACL are rejected; if the blacklist is configured but empty, all requests are forwarded) | white |
| XForwardedFor | string | Specifies whether the X-Forwarded-For header is used to preserve the real client IP address. Valid values: on | off | on |
| XForwardedFor_SLBID | string | Specifies whether the SLB-ID header is used to retrieve the CLB instance ID. Valid values: on | off | on |
| XForwardedFor_SLBIP | string | Specifies whether the SLB-IP header is used to retrieve the virtual IP address requested by the client. Valid values: on | off | on |
| XForwardedFor_SLBPORT | string | Specifies whether the XForwardedFor_SLBPORT header is used to retrieve the listener port of the CLB instance. Valid values: on | off | off |
| XForwardedFor_proto | string | Specifies whether the X-Forwarded-Proto header is used to retrieve the listener protocol. Valid values: on | off | on |
| XForwardedFor_ClientSrcPort | string | Specifies whether the XForwardedFor_ClientSrcPort header is used to retrieve the client port. Valid values: on | off | off |
| HealthCheck | string | Specifies whether health checks are enabled. Valid values: on | off | on |
| HealthCheckConnectPort | integer | The port used for health checks. Takes effect only when HealthCheck is on. | 8080 |
| HealthCheckDomain | string | The domain name used for health checks. | www.domain.com |
| HealthCheckURI | string | The URL path used for health checks. Must be 1 to 80 characters in length, start with a forward slash (/), and cannot be a single forward slash. Allowed characters: digits, letters, hyphens (-), forward slashes (/), periods (.), percent signs (%), question marks (?), number signs (#), and ampersands (&). | /test/index.html |
| HealthCheckHttpCode | string | The HTTP status codes that indicate a successful health check. | http_2xx,http_3xx |
| HealthCheckInterval | integer | The interval between health checks, in seconds. | 5 |
| HealthCheckTimeout | integer | The timeout period for each health check, in seconds. | 3 |
| HealthyThreshold | integer | The healthy threshold — the number of consecutive successful health checks required before a backend server is declared healthy. | 4 |
| UnhealthyThreshold | integer | The unhealthy threshold — the number of consecutive failed health checks required before a backend server is declared unhealthy. | 4 |
| HealthCheckMethod | string | The health check method for HTTP listeners. Returned when HealthCheck is on. Valid values: head | get | get |
| AclIds | object | The list of ACL IDs associated with the listener. | |
| AclIds.AclId | array | The ACL IDs. | |
| Rules | object | The forwarding rules associated with the listener. | |
| Rules.Rule | array\<object\> | The list of forwarding rules. | |
| Rules.Rule.RuleId | string | The ID of the forwarding rule. | 1234 |
| Rules.Rule.RuleName | string | The name of the forwarding rule. | test |
| Rules.Rule.Domain | string | The domain name in the forwarding rule. | www.example.com |
| Rules.Rule.Url | string | The request URL in the forwarding rule. | /example |
| Rules.Rule.VServerGroupId | string | The ID of the server group specified in the forwarding rule. | rsp-uf6w****** |
| Tags | object | The tags attached to the listener. | |
| Tags.Tag | array\<object\> | The tags. | |
| Tags.Tag.TagKey | string | The tag key. Valid values of N: 1 to 20. Cannot be empty. Max 64 characters. Cannot start with acs: or aliyun, or contain http:// or https://. | TestKey |
| Tags.Tag.TagValue | string | The tag value. Valid values of N: 1 to 20. Can be empty. Max 128 characters. Cannot start with acs:, or contain http:// or https://. | TestValue |
Examples
Success response
JSON format
{
"AclType": "white",
"VServerGroupId": "rsp-cige6j****",
"Status": "stopped",
"XForwardedFor_ClientSrcPort": "off",
"Cookie": "testCookie",
"Gzip": "on",
"HealthCheckConnectPort": 8080,
"RequestId": "365F4154-92F6-4AE4-92F8-7FF34B540710",
"Description": "HTTP_80",
"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": "acl-uf60jw******",
"Scheduler": "wrr",
"HealthyThreshold": 4,
"XForwardedFor_proto": "on",
"XForwardedFor_SLBIP": "on",
"StickySession": "on",
"HealthCheckMethod": "get",
"HealthCheck": "on",
"AclIds": {
"AclId": [
""
]
},
"Rules": {
"Rule": [
{
"VServerGroupId": "rsp-uf6w******",
"Url": "/example",
"Domain": "www.example.com",
"RuleName": "test",
"RuleId": "1234"
}
]
},
"LoadBalancerId": "lb-bp1uaunez0uho0zf0****",
"Tags": {
"Tag": [
{
"TagKey": "TestKey",
"TagValue": "TestValue"
}
]
}
}Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.