Adds one or more forwarding rules to a specified HTTP or HTTPS listener.
Try it now
Test
RAM authorization
Action | Access level | Resource type | Condition key | Dependent action |
slb:CreateRules | create | *loadbalancer
|
| None |
Request parameters
Parameter | Type | Required | Description | Example |
RegionId | string | Yes | The region ID of the load balancer instance. You can call the DescribeRegions operation to query region IDs. | cn-hangzhou |
LoadBalancerId | string | Yes | The ID of the load balancer instance. | lb-bp1ca0zt07t934w****** |
ListenerPort | integer | Yes | The frontend listener port of the load balancer instance. Valid values: 1–65535. | 443 |
ListenerProtocol | string | No | The frontend protocol of the listener. Note This parameter is required if you configure listeners that use different protocols on the same port. | https |
RuleList | string | Yes | The forwarding rules to add. You can add up to 10 forwarding rules in a single request. Each forwarding rule consists of the following parameters:
Note You must specify the | [{"RuleName":"Rule2","Domain":"test.com","VServerGroupId":"rsp-bp114ni******"}] |
DryRun | boolean | No |
Response elements
Element | Type | Description | Example |
object | |||
RequestId | string | The request ID. | 9DEC9C28-AB05-4DDF-9A78-6B08EC9CE18C |
| Rules | object | ||
| Rule | array<object> | A list of forwarding rules. | |
object | A forwarding rule. | ||
RuleName | string | The name of the forwarding rule. | Rule2 |
RuleId | string | The ID of the forwarding rule. | rule-bp12jzy0***** |
Examples
Success response
JSON format
{
"RequestId": "9DEC9C28-AB05-4DDF-9A78-6B08EC9CE18C",
"Rules": {
"Rule": [
{
"RuleName": "Rule2",
"RuleId": "rule-bp12jzy0*****"
}
]
}
}Error codes
HTTP status code | Error code | Error message | Description |
400 | InvalidParameter | The specified VServerGroupId does not belong to the LoadBalancerId of the rule. | |
400 | InvalidParameterValue.RegionNotSupport | The region does not support the parameter value, %s. | |
400 | TooManyListeners | More than 1 listener is found, please be more specified. | |
400 | DomainExist | rule with same domain and url already exists in specified vip | The specified domain name and URL already exists in another listener rule. |
400 | OperationFailed.ListenerStatusNotSupport | The status of the listener does not support this operation. Please try again later. | |
400 | OperationFailed.ActionNotSupport | The loadbalancer does not support such action. | |
400 | MissingParameter.RuleName | The parameter RuleName is required. | |
400 | DryRunOperation | Request validation has been passed with DryRun flag set. | Request validation has been passed with DryRun flag set. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.