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 Classic Load Balancer (CLB) instance is created. You can call theDescribeRegions 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. The name must be 1 to 80 characters in length and can contain only 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 takes effect only when you specify off for ListenerSync. The scheduling algorithm. Valid values:
|
StickySession | String | No | off |
This parameter is required and takes effect 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 a cookie. This parameter is required and takes effect when you specify onforStickySession. Valid values:
|
CookieTimeout | Integer | No | 123 |
The timeout period of a cookie. Valid values: 1 to 86400. Unit: seconds. Note Only when you set the StickySession parameter to on and the StickySessionType parameter to insert, this parameter is required and takes effect.
|
Cookie | String | No | 23ffsa |
The cookie to be configured on the backend server. The value must be 1 to 200 characters in length, and can contain only ASCII characters and digits. It cannot contain commas (,), semicolons (;), or space characters. It cannot start with a dollar sign ($). Note Only when you set the StickySession parameter to on and the StickySessionType parameter to server, this parameter is required and takes effect.
|
HealthCheck | String | No | off |
Specifies whether to enable health checks. Valid values: on and off. Note This parameter is required and takes effect 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 takes effect only when you set HealthCheck to on.
|
HealthCheckURI | String | No | /example |
The URL that is used for health checks. This parameter is required and takes effect only when you set HealthCheck to on. |
HealthyThreshold | Integer | No | 4 |
Specifies the number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy (from fail to success). Valid values: 2 to 10. Note This parameter is required and takes effect only when you set HealthCheck to on.
|
UnhealthyThreshold | Integer | No | 4 |
Specifies the number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy (from success to fail). Valid values: 2 to 10. Note This parameter is required and takes effect only when you set HealthCheck to on.
|
HealthCheckTimeout | Integer | No | 20 |
The timeout period of a health check response. If a backend Elastic Compute Service (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 This parameter is required and takes effect only when you set HealthCheck to on.
|
HealthCheckInterval | Integer | No | 20 |
The interval between two consecutive health checks. Valid values: 1 to 50. Unit: seconds. Note This parameter is required and takes effect only when you set HealthCheck to on.
|
HealthCheckHttpCode | String | No | http_2xx |
The HTTP status code that indicates a successful health check. Separate multiple HTTP status codes with commas (,). Valid values: http_2xx, http_3xx, http_4xx, and http_5xx Default value: http_2xx. Note This parameter is required and takes effect only when you set HealthCheck to on.
|
HealthCheckConnectPort | Integer | No | 80 |
The port that is used for health checks. Valid values: 1 to 65535. Note This parameter is takes effect 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 requests
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.