调用ListForwardingRules查看已经创建的转发策略信息。
说明 调用该接口只能查看自定义转发策略信息,无法查看默认转发策略信息。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
RegionId | String | 是 | cn-hangzhou |
全球加速实例所属的地域ID,仅取值:cn-hangzhou。 |
ClientToken | String | 否 | 02fb3da4**** |
客户端Token,用于保证请求的幂等性。 由客户端生成该参数值,要保证在不同请求间唯一,最大值不超过64个ASCII字符。 |
ListenerId | String | 是 | lsr-bp1s0vzbi5bxlx5pw**** |
监听实例ID。 |
AcceleratorId | String | 是 | ga-bp17frjjh0udz4qzk**** |
全球加速实例ID。 |
ForwardingRuleId | String | 否 | frule-bp19a3t3yzr21q3**** |
转发策略ID。 |
NextToken | String | 否 | FFBBOCFx**** |
下一个查询开始的Token。 |
MaxResults | Integer | 是 | 2 |
允许查询的转发策略的个数。 取值范围:1~100。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | CFC67ED9-4AB1-431F-B6E3-A752B7B8CCD4 |
请求ID。 |
TotalCount | Integer | 1 |
转发策略总个数。 |
NextToken | String | FFBBOCFx**** |
下一个查询开始的Token。 |
MaxResults | Integer | 2 |
允许查询的转发策略个数。 |
ForwardingRules | Array of ForwardingRules |
转发策略信息列表。 |
|
Priority | Integer | 5000 |
转发策略优先级。 |
ForwardingRuleId | String | frule-bp19a3t3yzr21q3**** |
转发策略ID。 |
ForwardingRuleName | String | auto_named_rule |
转发策略名称。 |
ForwardingRuleStatus | String | active |
转发策略状态。
|
RuleConditions | Array of RuleConditions |
转发条件。 |
|
RuleConditionType | String | Host |
转发条件类型。
|
PathConfig | object |
路径配置信息。 |
|
Values | Array of String | /test |
路径。 |
HostConfig | object |
域名配置信息。 |
|
Values | Array of String | www.example.icu |
域名。 |
RuleActions | Array of RuleActions |
转发动作。 |
|
Order | Integer | 1 |
转发优先级。 |
RuleActionType | String | ForwardGroup |
转发动作类型。 默认值:ForwardGroup。 |
ForwardGroupConfig | object |
转发动作配置信息。 |
|
ServerGroupTuples | Array of ServerGroupTuples |
终端节点组信息。 |
|
EndpointGroupId | String | epg-bp1ieei9664r5nv**** |
终端节点组ID。 |
ListenerId | String | lsr-bp1s0vzbi5bxlx5**** |
监听实例ID。 |
示例
请求示例
http(s)://[Endpoint]/?Action=ListForwardingRules
&RegionId=cn-hangzhou
&ClientToken=02fb3da4****
&ListenerId=lsr-bp1s0vzbi5bxlx5pw****
&AcceleratorId=ga-bp17frjjh0udz4qzk****
&ForwardingRuleId=frule-bp19a3t3yzr21q3****
&NextToken=FFBBOCFx****
&MaxResults=2
&公共请求参数
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<ListForwardingRulesResponse>
<TotalCount>1</TotalCount>
<RequestId>CFC67ED9-4AB1-431F-B6E3-A752B7B8CCD4</RequestId>
<MaxResults>2</MaxResults>
<ForwardingRules>
<RuleActions>
<RuleActionType>ForwardGroup</RuleActionType>
<Order>1</Order>
<ForwardGroupConfig>
<ServerGroupTuples>
<EndpointGroupId>epg-bp1ieei9664r5nv****</EndpointGroupId>
</ServerGroupTuples>
</ForwardGroupConfig>
</RuleActions>
<ForwardingRuleName>auto_named_rule</ForwardingRuleName>
<Priority>5000</Priority>
<ForwardingRuleId>frule-bp19a3t3yzr21q3****</ForwardingRuleId>
<RuleConditions>
<PathConfig/>
<HostConfig>
<Values>www.example.icu</Values>
</HostConfig>
<RuleConditionType>Host</RuleConditionType>
</RuleConditions>
<ForwardingRuleStatus>active</ForwardingRuleStatus>
<ListenerId>lsr-bp1s0vzbi5bxlx5****</ListenerId>
</ForwardingRules>
</ListForwardingRulesResponse>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"TotalCount" : 1,
"RequestId" : "CFC67ED9-4AB1-431F-B6E3-A752B7B8CCD4",
"MaxResults" : 2,
"ForwardingRules" : [ {
"RuleActions" : [ {
"RuleActionType" : "ForwardGroup",
"Order" : 1,
"ForwardGroupConfig" : {
"ServerGroupTuples" : [ {
"EndpointGroupId" : "epg-bp1ieei9664r5nv****"
} ]
}
} ],
"ForwardingRuleName" : "auto_named_rule",
"Priority" : 5000,
"ForwardingRuleId" : "frule-bp19a3t3yzr21q3****",
"RuleConditions" : [ {
"PathConfig" : { },
"HostConfig" : {
"Values" : [ "www.example.icu" ]
},
"RuleConditionType" : "Host"
} ],
"ForwardingRuleStatus" : "active",
"ListenerId" : "lsr-bp1s0vzbi5bxlx5****"
} ]
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | NotExist.Listener | The listener does not exist. | 监听器不存在 |
400 | NotActive.Listener | The state of the listener is not active. | 监听器状态非稳态 |
400 | NotExist.Accelerator | The accelerated instance does not exist. | 加速实例不存在 |
400 | StateError.Accelerator | The state of the accelerated instance is invalid. | 加速实例状态非法 |
400 | NotExist.BusinessRegion | The business region does not exist. | 业务region并不存在 |
400 | NotExist.BasicBandwidthPackage | You must specify the basic bandwidth package. | 缺少基础带宽包 |
400 | QuotaExceeded.EndPoint | The maximum number of endpoints is exceeded. | 终端节点达到Quota限制 |
400 | Exist.EndpointGroup | The endpoint group already exists. | 终端节点组已经存在 |
400 | NoPermission.VpcEndpoint | You are not authorized to perform the operation. | 用户没有创建服务关联角色的权限,请联系主账号或权限管理员授权当前用户AliyunGlobalAccelerationFullAccess或者创建服务关联角色的自定义权限。自定义权限策略的相关信息如下: ServiceName:vpcendpoint.ga.aliyuncs.com 服务关联角色名称:AliyunServiceRoleForGaVpcEndpoint 执行该操作所需的用户权限:ram:CreateServiceLinkedRole |
访问错误中心查看更多错误码。