Modifies the forwarding rule of a specified vServer group.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | SetRule |
The operation that you want to perform. Set the value to SetRule. |
RegionId | String | Yes | cn-hangzhou |
The ID of the region where the Server Load Balancer (SLB) instance is created. You can call the DescribeRegions operation to query region IDs. |
RuleId | String | Yes | rule-3ejhkt****** |
The ID of the forwarding rule. |
VServerGroupId | String | Yes | rsp-cige6****** |
The ID of the vServer group with which the forwarding rule is associated. |
RuleName | String | No | doctest |
The name of the forwarding rule must be 1 to 80 characters in length. It can contain letters, digits, hyphens (-), forward slashes (/), periods (.), and underscores (_). Note Forwarding rule names must be unique within each listener.
|
ListenerSync | String | No | off |
Specifies whether the forwarding rule uses the scheduling algorithm, session persistence, and health check configurations of the listener. Valid values: on and off.
|
Scheduler | String | No | wrr |
This parameter is required and effective only when you specify off for ListenerSync. The scheduling algorithm. Valid values:
|
StickySession | String | No | off |
This parameter is required and effective only when you specify off for ListenerSync. Specifies whether to enable session persistence. Valid values: on and off. |
StickySessionType | String | No | insert |
Specifies whether to insert or rewrite the cookie. This parameter is required and effective when you specify on for StickySession. Valid values:
|
CookieTimeout | Integer | No | 123 |
The timeout period of a cookie. Valid values: 1 to 86400 Unit: seconds. Only when you set the StickySession parameter to on and the StickySessionType parameter to insert, this parameter is required and effective. |
Cookie | String | No | 23ffsa |
The cookie configured on the backend server. The cookie must be 1 to 200 characters in length and can contain only ASCII letters and digits. It cannot contain commas (,), semicolons (;), or spaces. It cannot start with a dollar sign ($). Only when you set the StickySession parameter to on and the StickySessionType parameter to server, this parameter is required and effective. |
HealthCheck | String | No | off |
Specifies whether to enable health checks. Valid values: on and off. Note This parameter is required and effective only when you set ListenerSync to off.
|
HealthCheckDomain | String | No | www.domain.com |
The domain name that is used for health checks. Valid values:
Note This parameter is required and effective only when you set HealthCheck to on.
|
HealthCheckURI | String | No | /example |
This parameter is required and effective only when you set HealthCheck to on. |
HealthyThreshold | Integer | No | 4 |
The number of consecutive health check successes required before a backend server is declared healthy (from fail to success). This parameter is required and effective only when you set HealthCheck to on. Valid values: 2 to 10. |
UnhealthyThreshold | Integer | No | 4 |
The number of consecutive health check failures required before a backend server is declared unhealthy (from success to fail). This parameter is required and effective only when you set HealthCheck to on. Valid values: 2 to 10. |
HealthCheckTimeout | Integer | No | 20 |
Specify the amount of time to wait for a health check response. If the backend Elastic Compute Service (ECS) instance does not send an expected response within the specified period of time, the health check fails. Note This parameter is required and effective only when you set HealthCheck to on.
Valid values: 1 to 300 . Unit: seconds. |
HealthCheckInterval | Integer | No | 20 |
The interval between two consecutive health checks. This parameter is required only when you set HealthCheck to on. Valid values: 1 to 50 . Note This parameter is required and effective only when you set HealthCheck to on.
|
HealthCheckHttpCode | String | No | http_2xx |
The HTTP status code that specifies a successful health check. Separate multiple HTTP status codes with commas (,). This parameter is required only when you set HealthCheck to on. Valid values: http_2xx (default value), http_3xx, http_4xx, and http_5xx. Note This parameter is effective only when you set HealthCheck to on.
|
HealthCheckConnectPort | Integer | No | 80 |
The port number used for health checks. Valid values: 1 to 65535. Note This parameter is effective only when you set HealthCheck to on.
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 9DEC9C28-AB05-4DDF-9A78-6B08EC9CE18C |
The ID of the request. |
Examples
Sample request
http(s)://[Endpoint]/? Action=SetRule
&RegionId=cn-hangzhou
&RuleId=rule-3ejhkt******
&<Common request parameters>
Sample success responses
XML
format
<SetRuleResponse>
<RequestId>9DEC9C28-AB05-4DDF-9A78-6B08EC9CE18C</RequestId>
</SetRuleResponse>
JSON
format
{
"RequestId":"9DEC9C28-AB05-4DDF-9A78-6B08EC9CE18C"
}
Error codes
For a list of error codes, visit the API Error Center.