All Products
Search
Document Center

Server Load Balancer:UpdateRulesAttribute

Last Updated:Dec 12, 2024

Modifies the attributes of forwarding rules.

Operation description

UpdateRulesAttribute is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the ListRules operation to query the status of the task.

  • If a forwarding rule is in the Configuring state, the forwarding rule is being updated.

  • If a forwarding rule is in the Available state, the forwarding rule is updated.

  • You can set RuleConditions and RuleActions to add conditions and actions to a forwarding rule. Take note of the following limits on the maximum number of conditions and the maximum number of actions in each forwarding rule:

    • Limits on conditions: 5 for a basic Application Load Balancer (ALB) instance, 10 for a standard ALB instance, and 10 for a WAF-enabled ALB instance.
    • Limits on actions: 3 for a basic ALB instance, 5 for a standard ALB instance, and 5 for a WAF-enabled ALB instance.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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.
OperationAccess levelResource typeCondition keyAssociated operation
alb:UpdateRulesAttributeupdate
*LoadBalancer
acs:alb:{#regionId}:{#accountId}:loadbalancer/{#LoadBalancerId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ClientTokenstringNo

The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The client token can contain only ASCII characters.

Note If you do not specify this parameter, the system automatically uses the request ID as the client token. The request ID may be different for each request.
123e4567-e89b-12d3-a456-426655440000
Rulesarray<object>Yes

The forwarding rules.

objectYes
PriorityintegerNo

The priority of the forwarding rule.

10
RuleNamestringNo

The name of the forwarding rule.

rule-instance-test
RuleActionsarray<object>No

The action of the forwarding rule.

objectYes
FixedResponseConfigobjectNo

The configuration of the action to return a custom response.

ContentstringNo

The content of the response.

dssacav
ContentTypestringNo

The content format of the response.

text/plain
HttpCodestringNo

The HTTP status code in responses.

200
ForwardGroupConfigobjectNo

The configuration of the action to forward requests to server groups.

ServerGroupTuplesarray<object>No

The server groups to which requests are forwarded.

objectNo
ServerGroupIdstringNo

The server group to which requests are forwarded.

sg-atstuj3rtoptyui****
WeightintegerNo

The weight of the server group.

30
ServerGroupStickySessionobjectNo

The configuration of session persistence for server groups.

EnabledbooleanNo

Specifies whether to enable session persistence.

false
TimeoutintegerNo

The timeout period of sessions.

2
InsertHeaderConfigobjectNo

The configuration of the action to insert a header.

CoverEnabledbooleanNo

Specifies whether to overwrite the header in the request.

false
KeystringNo

The key of the header.

test
ValuestringNo

The value of the header.

UserDefined
ValueTypestringNo

The type of header.

UserDefined
OrderintegerYes

The priority of the action.

1
RedirectConfigobjectNo

The configuration of the redirect action.

HoststringNo

The hostname to which requests are redirected.

www.example.com
HttpCodestringNo

The HTTP status code that indicates the redirect type.

301
PathstringNo

The path of the destination to which requests are forwarded.

/test
PortstringNo

The port to which requests are forwarded.

10
ProtocolstringNo

The protocol of the destination to which requests are forwarded.

HTTP
QuerystringNo

The query string to which requests are redirected.

quert
RewriteConfigobjectNo

The configuration of the rewrite action.

HoststringNo

The hostname of the destination to which requests are forwarded.

www.example.com
PathstringNo

The path to which requests are forwarded.

/tsdf
QuerystringNo

The query string of the URL to which requests are forwarded.

quedsa
TypestringYes

The type of action.

Host
TrafficLimitConfigobjectNo

The configuration of traffic throttling.

QPSintegerNo

The number of queries per second (QPS). Valid values: 1 to 1000000.

2
PerIpQpsintegerNo

The number of requests per IP address. Valid values: 1 to 1000000.

Note If both the QPS and PerIpQps properties are specified, make sure that the value of the QPS property is smaller than the value of the PerIpQps property.
80
TrafficMirrorConfigobjectNo

The configuration of traffic mirroring.

TargetTypestringNo

The type of target to which network traffic is mirrored.

ForwardGroupMirror
MirrorGroupConfigobjectNo

The configuration of the server group to which traffic is mirrored.

ServerGroupTuplesarray<object>No

The server group to which traffic is mirrored.

objectNo

The server group to which traffic is mirrored.

ServerGroupIdstringNo

The server group ID.

srg-00mkgijak0w4qgz9****
RemoveHeaderConfigobjectNo

The configuration of the HTTP header to be removed.

KeystringNo

The key of the response header.

Port
CorsConfigobjectNo

The CORS configuration.

AllowOriginarrayNo

The trusted origins.

stringNo
http://example.com
AllowMethodsarrayNo

The trusted HTTP methods of CORS requests.

stringNo
GET
AllowHeadersarrayNo

The trusted headers of CORS requests.

stringNo
test_123
ExposeHeadersarrayNo

The headers that can be exposed.

stringNo
test_123
AllowCredentialsstringNo

Specifies whether to allow credentials to be carried in CORS requests.

on
MaxAgelongNo

The maximum cache time of dry runs in the browser.

1000
RuleConditionsarray<object>No

The match conditions of the forwarding rule.

objectYes
CookieConfigobjectNo

The configuration of the cookie.

Valuesarray<object>No

The key-value pairs of cookies.

objectNo
KeystringNo

The cookie key.

test
ValuestringNo

The cookie value.

test
HeaderConfigobjectNo

The configuration of the HTTP header.

KeystringNo

The key of the header.

Port
ValuesarrayNo

The HTTP header values.

stringNo
5006
HostConfigobjectNo

The match conditions for hostnames.

ValuesarrayNo

The hostnames.

stringNo
www.example.com
MethodConfigobjectNo

The configuration of the HTTP request method.

ValuesarrayNo

The HTTP request methods.

stringNo
PUT
PathConfigobjectNo

The match conditions for query strings.

ValuesarrayNo

The paths to which requests are forwarded.

stringNo
/test
QueryStringConfigobjectNo

The match conditions for query strings.

Valuesarray<object>No

The key-value pairs of query strings.

objectNo
KeystringNo

The key of the query string.

test
ValuestringNo

The value of the query string.

test
ResponseHeaderConfigobjectNo

The HTTP response headers.

KeystringNo

The key of the response header.

test
ValuesarrayNo

The value of the response header.

stringNo
5006
ResponseStatusCodeConfigobjectNo

The match conditions for response status codes.

ValuesarrayNo

The match conditions.

stringNo
301
TypestringNo

The condition type of the forwarding rule.

ForwardGroup
SourceIpConfigobjectNo

Traffic matching based on source IP addresses.

ValuesarrayNo

Traffic matching based on source IP addresses.

stringNo

You can specify one or more IP addresses, including CIDR blocks.

Each forwarding rule supports at most five source IP addresses, including CIDR blocks.

192.168.0.1/32
RuleIdstringYes

The IDs of the forwarding rules.

rule-cxjh7vazn2jpnl****
DryRunbooleanNo

Specifies whether to perform only a dry run, without performing the actual request. Valid values:

  • true: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the DryRunOperation error code is returned.
  • false (default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.
false

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

The request ID.

365F4154-92F6-4AE4-92F8-7FF34B540710
JobIdstring

The asynchronous task ID.

72dcd26b-f12d-4c27-b3af-18f6aed5****

Examples

Sample success responses

JSONformat

{
  "RequestId": "365F4154-92F6-4AE4-92F8-7FF34B540710",
  "JobId": "72dcd26b-f12d-4c27-b3af-18f6aed5****"
}

Error codes

HTTP status codeError codeError messageDescription
400OperationDenied.IpGroupCanNotUsedForMirrorActionThe operation is not allowed because of %s.The operation is not allowed because of %s.
400IncorrectStatus.RuleThe status of %s [%s] is incorrect.-
400OperationDenied.SameGroupForForwardAndMirrorActionThe operation is not allowed because of %s.The operation is not allowed because of %s.
400OperationDenied.GRPCServerGroupThe operation is not allowed because of %s.-
400Conflict.PriorityThere is already %s having the same configuration with %s.-
400ResourceQuotaExceeded.ServerGroupAttachedNumThe quota of %s is exceeded for resource %s, usage %s/%s.-
400ResourceQuotaExceeded.LoadBalancerServersNumThe quota of %s is exceeded for resource %s, usage %s/%s.-
400ResourceQuotaExceeded.ServerAddedNumThe quota of %s is exceeded for resource %s, usage %s/%s.-
400QuotaExceeded.RuleWildcardsNumThe quota of %s is exceeded, usage %s/%s.The quota of %s is exceeded, usage %s/%s.
400QuotaExceeded.RuleMatchEvaluationsNumThe quota of %s is exceeded, usage %s/%s.-
400QuotaExceeded.RuleActionsNumThe quota of %s is exceeded, usage %s/%s.The quota of %s is exceeded. Usage: %s/%s.
400Mismatch.ProtocolThe %s is mismatched for %s and %s.The %s is mismatched for %s and %s.
400Mismatch.VpcIdThe %s is mismatched for %s and %s.The %s is mismatched for %s and %s.
400OperationDenied.ServiceManagedResourceThe operation is not allowed because the current resource of %s is managed resource.-
400OperationDenied.ListenerIdInconsistentThe operation is not allowed because of ListenerIdInconsistent.-
400IllegalParam.PriorityThe param of Priority is illegal.-
400OperationDenied.MirrorActionSupportHttpGroupOnlyThe operation is not allowed because of MirrorActionSupportHttpGroupOnly.-
400OperationDenied.ProtocolMustSameForForwardGroupActionThe operation is not allowed because of ProtocolMustSameForForwardGroupAction.-
404ResourceNotFound.RuleThe specified resource %s is not found.The specified resource %s is not found.
404ResourceNotFound.ServerGroupThe specified resource %s is not found.-

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-12-11The Error code has changedView Change Details
2024-11-28The Error code has changedView Change Details
2024-01-18The Error code has changedView Change Details