public static final class SetRuleRequest.Builder extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
SetRuleRequest |
build() |
SetRuleRequest.Builder |
cookie(String cookie)
The cookie that is configured on the server.
|
SetRuleRequest.Builder |
cookieTimeout(Integer cookieTimeout)
The timeout period of a cookie.
|
SetRuleRequest.Builder |
dryRun(Boolean dryRun)
DryRun.
|
SetRuleRequest.Builder |
healthCheck(String healthCheck)
Specifies whether to enable the health check feature.
|
SetRuleRequest.Builder |
healthCheckConnectPort(Integer healthCheckConnectPort)
The port that is used for health checks.
|
SetRuleRequest.Builder |
healthCheckDomain(String healthCheckDomain)
The domain name that is used for health checks.
|
SetRuleRequest.Builder |
healthCheckHttpCode(String healthCheckHttpCode)
The HTTP status code for a successful health check.
|
SetRuleRequest.Builder |
healthCheckInterval(Integer healthCheckInterval)
The interval between two consecutive health checks.
|
SetRuleRequest.Builder |
healthCheckTimeout(Integer healthCheckTimeout)
The timeout period of a health check response.
|
SetRuleRequest.Builder |
healthCheckURI(String healthCheckURI)
The URI that is used for health checks.
|
SetRuleRequest.Builder |
healthyThreshold(Integer healthyThreshold)
The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy.
|
SetRuleRequest.Builder |
listenerSync(String listenerSync)
Specifies whether to use the scheduling algorithm, session persistence, and health check configurations of the listener.
|
SetRuleRequest.Builder |
ownerAccount(String ownerAccount)
OwnerAccount.
|
SetRuleRequest.Builder |
ownerId(Long ownerId)
OwnerId.
|
SetRuleRequest.Builder |
regionId(String regionId)
The ID of the region where the Classic Load Balancer (CLB) instance is deployed.
|
SetRuleRequest.Builder |
resourceOwnerAccount(String resourceOwnerAccount)
ResourceOwnerAccount.
|
SetRuleRequest.Builder |
resourceOwnerId(Long resourceOwnerId)
ResourceOwnerId.
|
SetRuleRequest.Builder |
ruleId(String ruleId)
The ID of the forwarding rule.
|
SetRuleRequest.Builder |
ruleName(String ruleName)
The name of the forwarding rule.
|
SetRuleRequest.Builder |
scheduler(String scheduler)
The scheduling algorithm.
|
SetRuleRequest.Builder |
stickySession(String stickySession)
Specifies whether to enable session persistence.
|
SetRuleRequest.Builder |
stickySessionType(String stickySessionType)
The method that is used to handle a cookie.
|
SetRuleRequest.Builder |
unhealthyThreshold(Integer unhealthyThreshold)
The number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy.
|
SetRuleRequest.Builder |
vServerGroupId(String vServerGroupId)
The ID of the vServer group that is associated with the forwarding rule.
|
public SetRuleRequest.Builder cookie(String cookie)
The cookie that is configured on the server.
The cookie 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 ($).
example:This parameter is required and takes effect if StickySession is set to on and StickySessionType is set to server.
23ffsa
public SetRuleRequest.Builder cookieTimeout(Integer cookieTimeout)
The timeout period of a cookie. Unit: seconds. Valid values: 1 to 86400.
example:This parameter is required and takes effect if StickySession is set to on and StickySessionType is set to insert.
123
public SetRuleRequest.Builder dryRun(Boolean dryRun)
public SetRuleRequest.Builder healthCheck(String healthCheck)
Specifies whether to enable the health check feature. Valid values:
example:This parameter is required and takes effect if the ListenerSync parameter is set to off.
off
public SetRuleRequest.Builder healthCheckConnectPort(Integer healthCheckConnectPort)
The port that is used for health checks. Valid values: 1 to 65535.
example:This parameter takes effect when the HealthCheck parameter is set to on.
80
public SetRuleRequest.Builder healthCheckDomain(String healthCheckDomain)
The domain name that is used for health checks. Valid values:
example:This parameter takes effect if the HealthCheck parameter is set to on.
$_ip
public SetRuleRequest.Builder healthCheckHttpCode(String healthCheckHttpCode)
The HTTP status code for a successful health check. Multiple HTTP status codes are separated by commas (,).
Valid values: http_2xx, http_3xx, http_4xx, and http_5xx.
example:This parameter is required and takes effect if the HealthCheck parameter is set to on.
http_2xx
public SetRuleRequest.Builder healthCheckInterval(Integer healthCheckInterval)
The interval between two consecutive health checks. Unit: seconds. Valid values: 1 to 50.
example:This parameter is required and takes effect if the HealthCheck parameter is set to on.
20
public SetRuleRequest.Builder healthCheckTimeout(Integer healthCheckTimeout)
The timeout period of a health check response. If a backend server, such as an Elastic Compute Service (ECS) instance, does not return a health check response within the specified timeout period, the server fails the health check. Unit: seconds. Valid values: 1 to 300.
example:This parameter is required and takes effect if the HealthCheck parameter is set to on.
20
public SetRuleRequest.Builder healthCheckURI(String healthCheckURI)
The URI that is used for health checks.
example:This parameter is required and takes effect if the HealthCheck parameter is set to on.
/example
public SetRuleRequest.Builder healthyThreshold(Integer healthyThreshold)
The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy. In this case, the health status is changed from fail to success.
Valid values: 2 to 10.
example:This parameter is required and takes effect if the HealthCheck parameter is set to on.
4
public SetRuleRequest.Builder listenerSync(String listenerSync)
Specifies whether to use the scheduling algorithm, session persistence, and health check configurations of the listener. Valid values:
off
public SetRuleRequest.Builder ownerAccount(String ownerAccount)
public SetRuleRequest.Builder ownerId(Long ownerId)
public SetRuleRequest.Builder regionId(String regionId)
The ID of the region where the Classic Load Balancer (CLB) instance is deployed.
You can call the DescribeRegions operation to query the most recent region list.
This parameter is required.
example:cn-hangzhou
public SetRuleRequest.Builder resourceOwnerAccount(String resourceOwnerAccount)
public SetRuleRequest.Builder resourceOwnerId(Long resourceOwnerId)
public SetRuleRequest.Builder ruleId(String ruleId)
The ID of the forwarding rule.
This parameter is required.
example:rule-3ejhkt****
public SetRuleRequest.Builder ruleName(String ruleName)
The name of the forwarding rule. The name must be 1 to 40 characters in length, and can contain letters, digits, hyphens (-), forward slashes (/), periods (.), and underscores (_).
example:On the same listener, the forwarding rule names must be unique.
doctest
public SetRuleRequest.Builder scheduler(String scheduler)
The scheduling algorithm. Valid values:
example:This parameter is required and takes effect if the ListenerSync parameter is set to off.
wrr
public SetRuleRequest.Builder stickySession(String stickySession)
Specifies whether to enable session persistence. Valid values:
This parameter is required and takes effect if the ListenerSync parameter is set to off.
example:off
public SetRuleRequest.Builder stickySessionType(String stickySessionType)
The method that is used to handle a cookie. Valid values:
insert: inserts a cookie.
CLB inserts the backend server ID as a cookie into the first HTTP or HTTPS response 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 CLB detects a user-defined cookie, it overwrites the original cookie with the user-defined cookie. The next request from the client will contain the user-defined cookie, and the listener will distribute this request to the recorded backend server.
example:This parameter is required and takes effect if the StickySession parameter is set to on.
insert
public SetRuleRequest.Builder unhealthyThreshold(Integer unhealthyThreshold)
The number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy. In this case, the health status is changed from success to fail.
Valid values: 2 to 10.
example:This parameter is required and takes effect if the HealthCheck parameter is set to on.
4
public SetRuleRequest.Builder vServerGroupId(String vServerGroupId)
The ID of the vServer group that is associated with the forwarding rule.
example:rsp-cige6****
public SetRuleRequest build()
Copyright © 2026. All rights reserved.