Modifies a forwarding rule that is associated with a vServer group.
Debugging
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.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
slb:SetRule | update |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | 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. | cn-hangzhou |
RuleId | string | Yes | The ID of the forwarding rule. | rule-3ejhkt**** |
VServerGroupId | string | No | The ID of the vServer group that is associated with the forwarding rule. | rsp-cige6**** |
RuleName | string | No | 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 (_). Note
On the same listener, the forwarding rule names must be unique.
| doctest |
ListenerSync | string | No | Specifies whether to use the scheduling algorithm, session persistence, and health check configurations of the listener. Valid values:
| off |
Scheduler | string | No | The scheduling algorithm. Valid values:
Note
This parameter is required and takes effect if the ListenerSync parameter is set to off.
| wrr |
StickySession | string | No | Specifies whether to enable session persistence. Valid values:
This parameter is required and takes effect if the ListenerSync parameter is set to off. | off |
StickySessionType | string | No | The method that is used to handle a cookie. Valid values:
Note
This parameter is required and takes effect if the StickySession parameter is set to on.
| insert |
CookieTimeout | integer | No | The timeout period of a cookie. Unit: seconds. Valid values: 1 to 86400. Note
This parameter is required and takes effect if StickySession is set to on and StickySessionType is set to insert.
| 123 |
Cookie | string | No | 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 ($). Note
This parameter is required and takes effect if StickySession is set to on and StickySessionType is set to server.
| 23ffsa |
HealthCheck | string | No | Specifies whether to enable the health check feature. Valid values:
Note
This parameter is required and takes effect if the ListenerSync parameter is set to off.
| off |
HealthCheckDomain | string | No | The domain name that is used for health checks. Valid values:
Note
This parameter takes effect if the HealthCheck parameter is set to on.
| $_ip |
HealthCheckURI | string | No | The URI that is used for health checks. Note
This parameter is required and takes effect if the HealthCheck parameter is set to on.
| /example |
HealthyThreshold | integer | No | 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. Note
This parameter is required and takes effect if the HealthCheck parameter is set to on.
| 4 |
UnhealthyThreshold | integer | No | 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. Note
This parameter is required and takes effect if the HealthCheck parameter is set to on.
| 4 |
HealthCheckTimeout | integer | No | 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. Note
This parameter is required and takes effect if the HealthCheck parameter is set to on.
| 20 |
HealthCheckInterval | integer | No | The interval between two consecutive health checks. Unit: seconds. Valid values: 1 to 50. Note
This parameter is required and takes effect if the HealthCheck parameter is set to on.
| 20 |
HealthCheckConnectPort | integer | No | The port that is used for health checks. Valid values: 1 to 65535. Note
This parameter takes effect when the HealthCheck parameter is set to on.
| 80 |
HealthCheckHttpCode | string | No | 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. Note
This parameter is required and takes effect if the HealthCheck parameter is set to on.
| http_2xx |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "9DEC9C28-AB05-4DDF-9A78-6B08EC9CE18C"
}
Error codes
HTTP status code | Error code | Error message |
---|---|---|
400 | InvalidParameter | The specified VServerGroupId does not belong to the LoadBalancerId of the rule. |
400 | InvalidParameter.RegionNotSupport | The region does not support the parameter: %s. |
For a list of error codes, visit the Service error codes.