All Products
Search
Document Center

Server Load Balancer:DescribeRuleAttribute

Last Updated:Mar 14, 2024

Queries the configurations of a specified forwarding rule.

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:DescribeRuleAttributeREAD
  • loadbalancer
    acs:slb:{#regionId}:{#accountId}:loadbalancer/{#loadbalancerId}
  • slb:tag
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

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

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

cn-hangzhou
RuleIdstringYes

The ID of the forwarding rule.

rule-bp1efemp9****

Response parameters

ParameterTypeDescriptionExample
object
HealthCheckHttpCodestring

The HTTP status code that indicates a successful health check. Separate multiple HTTP status codes with commas (,). Default value: http_2xx.

Valid values: http_2xx, http_3xx, http_4xx, and http_5xx.

Note If you set the HealthCheck parameter to on, this parameter is required.
http_3xx
VServerGroupIdstring

The ID of the vServer group that is associated with the forwarding rule.

rsp-cige6j****
Domainstring

The domain name that is configured in the forwarding rule.

test.com
Cookiestring

The cookie to be configured on the backend server.

The cookie must be 1 to 200 characters in length and can contain ASCII letters and digits. It cannot contain commas (,), semicolons (;), or whitespace characters. It cannot start with a dollar sign ($).

If you set the StickySession parameter to on and the StickySessionType parameter to server, this parameter is required.

wwe
LoadBalancerIdstring

The ID of the SLB instance.

lb-bp1ca0zt07t934wxe****
ListenerPortstring

The listener port that is used by the SLB instance.

90
HealthCheckIntervalinteger

The time interval between two consecutive health checks.

Valid values: 1 to 50. Unit: seconds.

Note If you set the HealthCheck parameter to on, this parameter is required.
34
Urlstring

The URL that is configured in the forwarding rule.

/cache
HealthCheckURIstring

The URI that is used for health checks.

Note If you set the HealthCheck parameter to on, this parameter is required.
10.21.22.1
StickySessionTypestring

The method that is used to handle a cookie. Valid values:

  • insert: inserts a cookie into the response. 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 will contain this cookie, and the listener will distribute this request to the recorded backend server.
  • server: rewrites a cookie. When SLB detects a user-defined cookie, SLB overwrites the original cookie with the user-defined cookie. The next request from the client contains the user-defined cookie, and the listener distributes the request to the recorded backend server.
Note If you set the StickySession parameter to on, this parameter is required.
insert
RuleNamestring

The name of the forwarding rule.

Rule1
RuleIdstring

The ID of the forwarding rule.

rule-hfgnd*****
HealthCheckConnectPortinteger

The port of the backend server that is used for health checks.

Valid values: 1 to 65535.

Note If you set the HealthCheck parameter to on, this parameter is required. If you left this parameter empty and the HealthCheck parameter is set to on, the backend port configuration of the listener is used by default.
23
Schedulerstring

The scheduling algorithm. Valid values:

  • wrr (default): Backend servers that have higher weights receive more requests than backend servers that have lower weights.
  • rr: Requests are distributed to backend servers in sequence.
Note If you set the ListenerSync parameter to off, this parameter is required. If you set the parameter to on, the configuration of the listener is used.
wrr
RequestIdstring

The ID of the request.

9DEC9C28-AB05-4DDF-9A78-6B08EC9CE18C
HealthCheckTimeoutinteger

The timeout period of a health check response. If a backend ECS instance does not send an expected response within the specified period of time, the ECS instance is considered unhealthy.

Valid values: 1 to 300. Unit: seconds.

Note If the value of the HealthCHeckTimeout parameter is smaller than that of the HealthCheckInterval parameter, the value of the HealthCHeckTimeout parameter is ignored and the value of the HealthCheckInterval parameter is regarded as the waiting period. If you set the HealthCheck parameter to on, this parameter is required.
34
ListenerSyncstring

Indicates whether the forwarding rule uses the scheduling algorithm, session persistence, and health check configurations of the listener.

Valid values: on and off.

  • off: does not use the configurations of the listener. You can customize health check and session persistence configurations for the forwarding rule.
  • on: uses the configurations of the listener.
off
HealthyThresholdinteger

The number of consecutive successful health checks that must occur before an unhealthy backend server is declared healthy. In this case, the health check state is changed from fail to success.

Valid values: 2 to 10.

Note If you set the HealthCheck parameter to on, this parameter is required.
2
CookieTimeoutinteger

The timeout period of a cookie.

Valid values: 1 to 86400. Unit: seconds.

Note If you set the StickySession parameter to on and the StickySessionType parameter to insert, this parameter is required.
12
HealthCheckDomainstring

The domain name that is used for health checks. Valid values:

  • $_ip: The private IP address of the backend server. If the $_ip parameter is set or the HealthCheckDomain parameter is not set, SLB uses the private IP addresses of backend servers as the domain names for health checks.
  • domain: The domain name must be 1 to 80 characters in length. It can contain only letters, digits, periods (.),and hyphens (-).
Note If you set the HealthCheck parameter to on, this parameter is required.
www.example.com
UnhealthyThresholdinteger

The number of consecutive failed health checks that must occur before a healthy backend server is declared unhealthy. In this case, the health check state is changed from success to fail.

Valid values: 2 to 10.

Note If you set the HealthCheck parameter to on, this parameter is required.
3
StickySessionstring

Indicates whether session persistence is enabled.

Valid values: on and off.

Note If you set the ListenerSync parameter to off, this parameter is required. If you set the parameter to on, the configuration of the listener is used.
off
HealthCheckstring

Specifies whether to enable health checks.

Valid values: on and off.

Note If you set the ListenerSync parameter to off, this parameter is required. If you set the parameter to on, the configuration of the listener is used.
off

Examples

Sample success responses

JSONformat

{
  "HealthCheckHttpCode": "http_3xx ",
  "VServerGroupId": "rsp-cige6j****",
  "Domain": "test.com",
  "Cookie": "wwe",
  "LoadBalancerId": "lb-bp1ca0zt07t934wxe****",
  "ListenerPort": "90",
  "HealthCheckInterval": 34,
  "Url": "/cache",
  "HealthCheckURI": "10.21.22.1",
  "StickySessionType": "insert",
  "RuleName": "Rule1",
  "RuleId": "rule-hfgnd*****",
  "HealthCheckConnectPort": 23,
  "Scheduler": "wrr",
  "RequestId": "9DEC9C28-AB05-4DDF-9A78-6B08EC9CE18C",
  "HealthCheckTimeout": 34,
  "ListenerSync": "off",
  "HealthyThreshold": 2,
  "CookieTimeout": 12,
  "HealthCheckDomain": "www.example.com",
  "UnhealthyThreshold": 3,
  "StickySession": "off",
  "HealthCheck": "off"
}

Error codes

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