Queries the settings of a forwarding rule.

Make the API call

You can use OpenAPI Explorer to make API calls, search for API calls, perform debugging, and generate SDK example code.

Request parameters

Parameter Type Required? Example value Description
Action String Yes DescribeRuleAttribute

The name of this action.

Value: DescribeRuleAttribute

RegionId String Yes cn-hangzhou

The ID of the region to which the Server Load Balancer (SLB) instance belongs.

To query the region ID, call DescribeRegions.

RuleId String Yes rule-bp1efemp9suk5

The ID of the forwarding rule to be queried.

Response parameters

Parameter Type Example value Description
RuleName String Rule1

The name of the forwarding rule.

LoadBalancerId String lb-bp1ca0zt07t934wxezyxo

The ID of the SLB instance.

ListenerPort String 90

The frontend listening port used by the SLB instance.

Domain String test.com

The domain name specified in the forwarding rule.

Url String /cache

The URL specified in the forwarding rule.

VServerGroupId String rsp-cige6j5e7p

The ID of the VServer group associated with the forwarding rule.

Cookie String wwe

The cookie configured on the server.

The cookie is 1 to 200 characters in length. It can only contain ASCII English letters and numbers. It cannot contain commas (,), semicolons (;), or spaces. It cannot start with a dollar sign ($).

When the value of the StickySession parameter is on and the value of the StickySessionType parameter is server, this parameter is required.

CookieTimeout Integer 12

The timeout value of the cookie.

Value range: 0 to 86400. Unit: seconds

Note When the value of the StickySession parameter is on and the value of the StickySessionType parameter is insert, this parameter is required.
HealthCheck String off

Indicates whether the health check function is enabled.

Valid values: on | off.

Note This parameter is valid only when the value of the ListenerSync parameter is off. If the value of the ListenerSync parameter is on, the health check settings of the listener are used.
HealthCheckConnectPort Integer 23

The backend server port used for health checks.

Value range: 1 to 65535.

Note This parameter is valid only when the value of the HealthCheck parameter is on. If the value of the HealthCheck parameter is on, but this parameter is not specified, the backend port settings of the listener are used.
HealthCheckDomain String www.example.com

The domain name used for health checks. Valid values:

  • $_ip: the private IP address of the backend server. If the IP address is specified or this parameter is not specified, SLB uses 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, and can only contain letters, numbers, periods (.), and hyphens (-).
Note This parameter is valid only when the value of the HealthCheck parameter is set to on.
HealthCheckHttpCode String http_3xx

The HTTP status code indicating that a health check is successful. Multiple HTTP status codes are separated by commas (,). Default value: http_2xx.

Valid values: http_2xx | http_3xx | http_4xx | http_5xx.

Note This parameter is valid only when the value of the HealthCheck parameter is on.
HealthCheckInterval Integer 34

The interval between two consecutive health checks.

Value range: 1 to 50. Unit: seconds

Note This parameter is valid only when the value of the HealthCheck parameter is on.
HealthCheckTimeout Integer 34

The length of time to wait for a response from a health check. If the backend server does not send an expected response within the specified time, the health check fails.

Value range: 1 to 300. Unit: seconds

Note If the value of HealthCheckTimeout is smaller than the value of HealthCheckInterval, the HealthCheckTimeout parameter is invalid and the timeout value is set to the value of HealthCheckInterval. This parameter is valid only when the value of the HealthCheck parameter is on.
HealthCheckURI String 10.21.22.1

The URI used for health checks.

Note This parameter is valid only when the value of the HealthCheck parameter is on.
HealthyThreshold Integer 2

The number of consecutive successful health checks that must occur before a backend server is declared as healthy (from failure to success).

Value range: 2 to 10

Note This parameter is valid only when the value of the HealthCheck parameter is on.
ListenerSync String off

Indicates whether the forwarding rule inherits the settings of health checks, session persistence, and scheduling algorithms from the listener.

Valid values: on | off. Default value: off.

  • off: The forwarding rule does not inherit the settings from the listener. The rule customizes its health check and session persistence settings.
  • on: The forwarding rule inherits the settings from the listener.
RequestId String 9DEC9C28-AB05-4DDF-9A78-6B08EC9CE18C

The ID of the request.

RuleId String rule-hfgnd*****

The ID of the forwarding rule.

Scheduler String wrr

The algorithm used for distributing traffic. Valid values:

  • wrr (default): A backend server with a higher weight receives more requests.
  • rr: Requests are evenly and sequentially distributed to backend servers.
Note This parameter is valid when the value of the ListenerSync parameter is off. If the value of the ListenerSync parameter is on, the settings of the listener are used.
StickySession String off

Indicates whether session persistence is enabled.

Valid values: on | off. Default value: off.

Note This parameter is required when the value of the ListenerSync parameter is off. If the value of the ListenerSync parameter is on, the settings of the listener are used.
StickySessionType String insert

The method used to handle the cookie. Valid values:

  • insert: Insert the cookie. SLB adds a cookie to the first response from the backend server (inserts SERVERID in the HTTP and HTTPS response packets). The next request contains the cookie and the listener distributes the request to the same backend server.
  • server: Rewrite the cookie. SLB overwrites the original cookie when it discovers that a new cookie is set. The next time the client carries the new cookie to access SLB, the listener distributes the request to the recorded backend server.
Note This parameter is valid only when the value of the StickySession parameter is on.
UnhealthyThreshold Integer 3

The number of consecutive failed health checks that must occur before a backend server is declared as unhealthy (from success to failure).

Value range: 2 to 10

Note This parameter is valid only when the value of the HealthCheck parameter is on.

Examples

Request example


http(s)://[Endpoint]/? Action=DescribeRuleAttribute
&RegionId=cn-hangzhou
&RuleId=rule-bp1efemp9suk5
&<CommonParameters>

Response example

XML format

<DescribeRuleAttributeResponse>	
	  <Domain>test.com</Domain>
	  <VServerGroupId>rsp-bp114nimo4kl9</VServerGroupId>
	  <LoadBalancerId>lb-bp1ca0zt07t934wxezyxo</LoadBalancerId>
	  <RuleName>Rule2</RuleName>
	  <ListenerPort>90</ListenerPort>
	  <RequestId>DB3C28EE-9A6C-4FFA-8759-4ED8346A675E</RequestId>
	  <ListenerSync>on</ListenerSync>
</DescribeRuleAttributeResponse>

JSON format

{
	"Domain":"test.com",
	"RequestId":"DB3C28EE-9A6C-4FFA-8759-4ED8346A675E",
	"VServerGroupId":"rsp-bp114nimo4kl9",
	"LoadBalancerId":"lb-bp1ca0zt07t934wxezyxo",
	"RuleName":"Rule2",
	"ListenerSync":"on",
	"ListenerPort":90
}

Errors

For a list of error codes, visit the API Error Center.