DescribeLoadBalancerHTTPListenerAttribute

Updated at:

Queries the configuration of an HTTP listener.

Operation description

Before you begin

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

slb:DescribeLoadBalancerHTTPListenerAttribute

get

*loadbalancer

acs:slb:{#regionId}:{#accountId}:loadbalancer/{#loadbalancerId}

  • slb:tag
  • slb:tag
  • slb:tag
  • slb:tag
None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

No

The region ID of the Server Load Balancer instance.

You can call the DescribeRegions operation to query the region ID.

cn-hangzhou

LoadBalancerId

string

Yes

The ID of the Server Load Balancer instance.

lb-bp1uaunez0uho0zf0****

ListenerPort

integer

Yes

The frontend port used by the instance.

Valid values: 1 to 65535.

80

Response elements

Element

Type

Description

Example

object

AclType

string

The type of access control. Valid values:

  • white: Only requests from the IP addresses or CIDR blocks in the selected access control policy group are forwarded. Whitelists are applicable to scenarios in which you want to allow only specific IP addresses to access your service. Enabling a whitelist poses some risks to your services. After a whitelist is enabled, only the IP addresses in the whitelist can access the SLB listener.

If a whitelist is enabled but no IP address is added to the access control policy group, the SLB listener forwards all requests.

  • black: All requests from the IP addresses or CIDR blocks in the selected access control policy group are not forwarded. Blacklists are applicable to scenarios in which you want to deny access from specific IP addresses.

If a blacklist is enabled but no IP address is added to the access control policy group, the SLB listener forwards all requests.

Note

This parameter is required when the value of AclStatus is on.

white

VServerGroupId

string

The ID of the bound vServer group.

rsp-cige6j****

Status

string

The current status of the listener. Valid values:

  • running: The listener is running.

  • stopped: The listener is stopped.

stopped

XForwardedFor_ClientSrcPort

string

Indicates whether the XForwardedFor_ClientSrcPort header is used to retrieve the port of the client that accesses the SLB instance. Valid values:

  • on: yes.

  • off: no.

off

Cookie

string

The cookie configured on the server.

testCookie

Gzip

string

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

  • on: yes.

  • off: no.

on

HealthCheckConnectPort

integer

The port used for health checks.

Note

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

8080

RequestId

string

The request ID.

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

Description

string

The custom listener name.

HTTP_80

Bandwidth

integer

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

  • -1: The peak bandwidth is not limited.

  • 1 to 5120: The peak bandwidth of the listener. The sum of the peak bandwidth values of all listeners cannot exceed the peak bandwidth of the instance.

-1

HealthCheckTimeout

integer

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

3

AclStatus

string

Indicates whether access control is enabled. Valid values:

  • on: yes.

  • off: no.

off

BackendServerPort

integer

The backend port used by the instance.

80

CookieTimeout

integer

The cookie timeout period. Unit: seconds.

500

HealthCheckDomain

string

The domain name used for health checks.

www.domain.com

UnhealthyThreshold

integer

The unhealthy health check threshold.

4

ForwardPort

integer

The redirection port for HTTP-to-HTTPS forwarding.

Note

This parameter is not displayed if the value of ListenerForward is off.

80

XForwardedFor_SLBID

string

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

  • on: yes.

  • off: no.

on

SecurityStatus

string

Indicates whether the security status is enabled. Valid values:

  • on: yes.

  • off: no.

on

HealthCheckHttpCode

string

The HTTP status code that indicates a healthy health check.

http_2xx,http_3xx

ListenerForward

string

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

  • on: yes.

  • off: no.

on

XForwardedFor

string

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

  • on: yes.

  • off: no.

on

IdleTimeout

integer

The idle connection timeout period. Unit: seconds.

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

If no access request is received within the timeout period, Server Load Balancer temporarily breaks the current connection and waits until the next request arrives to re-establish a new connection.

2

RequestTimeout

integer

The request timeout period. Unit: seconds.

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

If no response is received from the backend server within the timeout period, Server Load Balancer stops waiting and returns an HTTP 504 error code to the client.

34

ListenerPort

integer

The frontend port used by the instance.

80

HealthCheckInterval

integer

The interval between two consecutive health checks. Unit: seconds.

5

XForwardedFor_SLBPORT

string

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

  • on: yes.

  • off: no.

off

HealthCheckURI

string

The URI used for health checks.

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

/test/index.html

StickySessionType

string

The method used to handle cookies. Valid values: insert or server.

  • insert: insert cookie.

    When a client accesses the SLB instance for the first time, Server Load Balancer inserts a cookie into the response (inserts SERVERID into the HTTP or HTTPS response). The next time the client sends a request with this cookie, Server Load Balancer forwards the request to the previously recorded backend server.

  • server: rewrite cookie.

    When Server Load Balancer discovers a user-defined cookie, it rewrites the original cookie. The next time the client sends a request with the new cookie, Server Load Balancer forwards the request to the previously recorded backend server.

Note

This parameter is required when the value of StickySession is on.

insert

AclId

string

The ID of the access control policy group bound to the listener.

Note

This parameter is returned when the value of AclStatus is on.

acl-uf60jw******

Scheduler

string

The scheduling algorithm. Valid values:

  • wrr: Backend servers with higher weights receive more requests than those with lower weights.

  • rr: Requests are distributed to backend servers in sequence.

wrr

HealthyThreshold

integer

The healthy health check threshold.

4

XForwardedFor_proto

string

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

  • on: yes.

  • off: no.

on

XForwardedFor_SLBIP

string

Indicates whether the SLB-IP header is used to retrieve the virtual IP address (VIP) of the client request. Valid values:

  • on: yes.

  • off: no.

on

StickySession

string

Indicates whether session persistence is enabled. Valid values:

  • on: yes.

  • off: no.

on

HealthCheckMethod

string

The health check method used for HTTP health checks of the listener. Valid values: head or get.

Note

This parameter is returned when the value of HealthCheck is on.

get

HealthCheck

string

Indicates whether health checks are enabled. Valid values:

  • on: yes.

  • off: no.

on

AclIds

object

AclId

array

The ID of the access control policy group.

Rules

object

Rule

array<object>

The description of the forwarding rule.

object

VServerGroupId

string

The ID of the destination vServer group of the forwarding rule.

rsp-uf6w******

Url

string

The access path.

/example

Domain

string

The domain name.

www.example.com

RuleName

string

The name of the forwarding rule.

test

RuleId

string

The ID of the forwarding rule.

1234

LoadBalancerId

string

The ID of the Server Load Balancer instance.

lb-bp1uaunez0uho0zf0****

Tags

object

Tag

array<object>

The tags.

object

The tags.

TagKey

string

The tag key of the listener. 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 and cannot start with aliyun or acs:. The tag key cannot contain http:// or https://.

TestKey

TagValue

string

The tag value of the listener. Valid values of N: 1 to 20. The tag value can be an empty string. The tag value can be up to 128 characters in length and cannot start with acs:. The tag value cannot 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.