Updates a forwarding rule.
Operation description
-
UpdateForwardingRules 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 ListForwardingRules operation to query the status of a forwarding rule.
- If the forwarding rule is in the configuring state, it indicates that the forwarding rule is being modified. In this case, you can perform only query operations.
- If the forwarding rule is in the active state, it indicates that the forwarding rule is modified.
-
The UpdateForwardingRules operation holds an exclusive lock on the Global Accelerator (GA) instance. While the operation is in progress, you cannot call the same operation in the same Alibaba Cloud account.
Debugging
Authorization information
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The region ID of the GA instance. Set the value to cn-hangzhou. | cn-hangzhou |
ClientToken | string | No | 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.
| 02fb3da4**** |
AcceleratorId | string | Yes | The GA instance ID. | ga-bp17frjjh0udz4q**** |
ListenerId | string | Yes | The listener ID. | lsr-bp1s0vzbi5bxlx5**** |
ForwardingRules | array<object> | Yes | The configurations of the forwarding rules. | test |
object | Yes | The configurations of the forwarding rules. | ||
Priority | integer | Yes | The priority of the forwarding rule. Valid values: 1 to 10000. A smaller value specifies a higher priority. | 1000 |
RuleConditions | array<object> | Yes | The forwarding conditions. | |
object | No | The forwarding conditions. | ||
RuleConditionType | string | Yes | The type of the forwarding condition. Valid values:
| Host |
RuleConditionValue | string | No | The value of the forwarding condition. You must specify different JSON strings based on RuleConditionType.
| ["www.example.com", "www.aliyun.com"] |
PathConfig | object | No | The path configuration. Note
We recommend that you use RuleConditionType and RuleConditionValue rather than this parameter to configure forwarding conditions.
| |
Values | array | No | The path configuration. Note
We recommend that you use RuleConditionType and RuleConditionValue rather than this parameter to configure forwarding conditions.
| |
string | No | The path. The path must be 1 to 128 characters in length, and must start with a forward slash (/). The path can contain letters, digits, and the following special characters: $ - _ . + / & ~ @ : '. Supported wildcard characters are asterisks (*) and question marks (?). Note
We recommend that you use RuleConditionType and RuleConditionValue rather than this parameter to configure forwarding conditions.
| /test | |
HostConfig | object | No | The domain name configuration. Note
We recommend that you use RuleConditionType and RuleConditionValue rather than this parameter to configure forwarding conditions.
| |
Values | array | No | The domain name configuration. Note
We recommend that you use RuleConditionType and RuleConditionValue rather than this parameter to configure forwarding conditions.
| |
string | No | The domain name. The domain name must be 3 to 128 characters in length, and can contain letters, digits, hyphens (-), and periods (.). You can use asterisks (*) and question marks (?) as wildcard characters. | example.com | |
RuleActions | array<object> | Yes | The configurations of the forwarding actions. | |
object | Yes | The configurations of the forwarding actions. | ||
Order | integer | Yes | The forwarding priority. Note
This parameter does not take effect. Ignore this parameter.
| 20 |
RuleActionType | string | Yes | The type of the forwarding action. Valid values:
| ForwardGroup |
RuleActionValue | string | No | The value of the forwarding action. You must specify different JSON strings based on RuleActionType. A forwarding rule can contain only one forwarding action whose type is ForwardGroup, Redirect, or FixResponse. You must specify a forwarding action whose type is Rewrite, AddHeader, or RemoveHeader before a forwarding action whose type is ForwardGroup.
| [{"type":"endpointgroup", "value":"epg-bp1enpdcrqhl78g6r****"}] |
ForwardGroupConfig | object | No | The forwarding configuration. Note
We recommend that you use RuleActionType and RuleActionValue rather than this parameter to configure forwarding actions.
| |
ServerGroupTuples | array<object> | Yes | The configuration of an endpoint group. Note
We recommend that you use RuleActionType and RuleActionValue rather than this parameter to configure forwarding actions.
| |
object | Yes | The configuration of an endpoint group. Note
We recommend that you use RuleActionType and RuleActionValue rather than this parameter to configure forwarding actions.
| ||
EndpointGroupId | string | Yes | The ID of the endpoint group. Note
We recommend that you use RuleActionType and RuleActionValue rather than this parameter to configure forwarding actions.
| epg-bp1ieei9664r5nv**** |
ForwardingRuleId | string | Yes | The forwarding rule ID. | frule-bp1dii16gu9qdvb34**** |
ForwardingRuleName | string | No | The forwarding rule name. The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter. | test |
RuleDirection | string | No | The direction in which the rule takes effect. You do not need to set this parameter. By default, this parameter is set to request, which specifies that the rule takes effect on requests. | request |
Response parameters
Examples
Sample success responses
JSON
format
{
"ForwardingRules": [
{
"ForwardingRuleId": "frule-bp1dii16gu9qdvb34****"
}
],
"RequestId": "64ADAB1E-0B7F-4FD8-A404-3BECC0E9CCFF"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | NotExist.Listener | The listener does not exist. | The listener does not exist. |
400 | NotActive.Listener | The state of the listener is not active. | The listener is unstable. |
400 | NotExist.Accelerator | The accelerated instance does not exist. | The GA instance does not exist. |
400 | StateError.Accelerator | The state of the accelerated instance is invalid. | The status of the GA instance is invalid. |
400 | NotExist.BusinessRegion | The business region does not exist. | The business region does not exist. |
400 | NotExist.BasicBandwidthPackage | You must specify the basic bandwidth package. | You must specify the basic bandwidth package. |
400 | QuotaExceeded.EndPoint | The maximum number of endpoints is exceeded. | The maximum number of endpoints is exceeded. |
400 | Exist.EndpointGroup | The endpoint group already exists. | The endpoint group already exists. |
400 | NoPermission.VpcEndpoint | You are not authorized to perform the operation. | The user does not have permissions to create service linked roles. Contact the Alibaba Cloud account owner or the permission administrator to grant the current user AliyunGlobalAccelerationFullAccess or create custom permission policies for service linked role. The following content describes the detailed information about custom permission policies: ServiceName: vpcendpoint.ga.aliyuncs.com. Service linked role name: AliyunServiceRoleForGaVpc. Endpoint Permission: ram:CreateServiceLinkedRole. |
400 | QuotaExceeded.ForwardingRule | he number of forwarding rule exceeds the limit. | - |
400 | QuotaExceeded.RuleConditionConfig | The number of path and host exceeds the limit. | - |
400 | RepeatPathAndHost.ForwardingRule | path and host %s repeat | - |
400 | NotExist.ForwardingRule | forwarding rule %s is not exist | - |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2023-10-18 | The Error code has changed | View Change Details |