Updates a forwarding rule.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | UpdateForwardingRules |
The operation that you want to perform. Set the value to UpdateForwardingRules. |
RegionId | String | Yes | cn-hangzhou |
The ID of the region where the Global Accelerator (GA) instance is deployed. Set the value to cn-hangzhou. |
ClientToken | String | No | 02fb3da4**** |
The client token that is used to ensure the idempotence of the request. You can use the client to generate the value. Make sure that the value is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length. |
AcceleratorId | String | Yes | ga-bp17frjjh0udz4q**** |
The ID of the GA instance. |
ListenerId | String | Yes | lsr-bp1s0vzbi5bxlx5**** |
The ID of the listener. |
ForwardingRules | Array | Yes |
The configurations that you want to apply to the forwarding rule. |
|
Priority | Integer | Yes | 1000 |
The order of the forwarding rule. Note This parameter only specifies the order in which the forwarding rule is displayed
in the console and does not specify the priority of the forwarding rule.
|
RuleConditions | Array | Yes |
The conditions that trigger the forwarding rule. |
|
RuleConditionType | String | Yes | Host |
The type of the forwarding condition. Valid values:
|
PathConfig | Object | No |
The path configuration. |
|
Values | Array of String | No | /test |
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, dollar signs ($), hyphens (-), underscores (_), periods (.), plus signs (+), forward slashes (/), ampersands (&), tildes (~), at signs (@), colons (:), and apostrophes (').Supported wildcard characters are asterisks (*) and question marks (?). |
HostConfig | Object | No |
The domain name configuration. |
|
Values | Array of String | No | www.test.com |
The domain name. The domain name must be 3 to 128 characters in length and can contain letters, digits, hyphens (-), and periods (.).Supported wildcard characters are asterisks (*) and question marks (?). |
RuleActions | Array | Yes |
The forwarding action. |
|
Order | Integer | Yes | 2 |
The forwarding order. Note This parameter does not take effect because a forwarding rule can be associated with
only one endpoint group.
|
RuleActionType | String | Yes | ForwardGroup |
The type of the forwarding action. Default value: ForwardGroup. |
ForwardGroupConfig | Object | Yes |
The forwarding configuration. |
|
ServerGroupTuples | Array | Yes |
The configuration of the endpoint group. |
|
EndpointGroupId | String | Yes | epg-bp1ieei9664r5nv**** |
The ID of the endpoint group. |
ForwardingRuleId | String | Yes | frule-bp1dii16gu9qdvb34**** |
The ID of the forwarding rule. |
ForwardingRuleName | String | No | test |
The name of the forwarding rule. 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. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
ForwardingRules | Array of ForwardingRules |
The information about the forwarding rule. |
|
ForwardingRuleId | String | frule-bp1dii16gu9qdvb34**** |
The ID of the forwarding rule. |
RequestId | String | 64ADAB1E-0B7F-4FD8-A404-3BECC0E9CCFF |
The ID of the request. |
Examples
Sample requests
http(s)://[Endpoint]/?Action=UpdateForwardingRules
&RegionId=cn-hangzhou
&ClientToken=02fb3da4****
&AcceleratorId=ga-bp17frjjh0udz4q****
&ListenerId=lsr-bp1s0vzbi5bxlx5****
&ForwardingRules=[{"Priority":1000,"RuleConditions":[{"RuleConditionType":"Host","PathConfig":{"Values":["/test"]},"HostConfig":{"Values":["www.test.com"]}}],"RuleActions":[{"Order":2,"RuleActionType":"ForwardGroup","ForwardGroupConfig":{"ServerGroupTuples":[{"EndpointGroupId":"epg-bp1ieei9664r5nv****"}]}}],"ForwardingRuleId":"frule-bp1dii16gu9qdvb34****","ForwardingRuleName":"test"}]
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<UpdateForwardingRulesResponse>
<ForwardingRules>
<ForwardingRuleId>frule-bp1dii16gu9qdvb34****</ForwardingRuleId>
</ForwardingRules>
<RequestId>64ADAB1E-0B7F-4FD8-A404-3BECC0E9CCFF</RequestId>
</UpdateForwardingRulesResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"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 error message returned because the specified listener does not exist. |
400 | NotActive.Listener | The state of the listener is not active. | The error message returned because the specified listener is in an unstable status. |
400 | NotExist.Accelerator | The accelerated instance does not exist. | The error message returned because the specified GA instance does not exist. |
400 | StateError.Accelerator | The state of the accelerated instance is invalid. | The error message returned because the specified GA instance is in an invalid status. |
400 | NotExist.BusinessRegion | The business region does not exist. | The error message returned because the specified region does not exist. |
400 | NotExist.BasicBandwidthPackage | You must specify the basic bandwidth package. | The error message returned because the required basic bandwidth plan is not specified. |
400 | QuotaExceeded.EndPoint | The maximum number of endpoints is exceeded. | The error message returned because the number of endpoints has reached the upper limit. |
400 | Exist.EndpointGroup | The endpoint group already exists. | The error message returned because the specified endpoint group already exists. |
400 | NoPermission.VpcEndpoint | You are not authorized to perform the operation. | The error message returned because you are not authorized to create the service-linked role. Contact the owner of the Alibaba Cloud account or the permission administrator to grant the current user the AliyunGlobalAccelerationFullAccess permission or custom permissions. The custom permissions must allow you to create the service-linked role. Configure the following information to customize a permission policy: 1. Set the service name to vpcendpoint.ga.aliyuncs.com. 2. Set the name of the service-linked role to AliyunServiceRoleForGaVpcEndpoint. 3. Set the required permissions to ram:CreateServiceLinkedRole. |
400 | QuotaExceeded.RuleConditionConfig | The number of path and host exceeds the limit. | The error message returned because the number of paths and domain names has reached the upper limit. |
For a list of error codes, visit the API Error Center.