调用ModifyVpnPbrRouteEntryWeight接口修改VPN策略路由的权重值。
接口说明
本接口仅适用于支持单隧道模式 IPsec-VPN 连接的 VPN 网关实例。对于支持双隧道模式 IPsec-VPN 连接的 VPN 网关实例,调用本接口成功修改权重值后,权重值也不会生效。
在 VPN 网关实例下存在主备策略路由场景下,如果您需要修改主策略路由的权重值,需先将备策略路由删除,待主策略路由修改完成后,再重新配置备策略路由。如果您需要修改备策略路由的权重值,也需先删除主策略路由,待备策略路由修改完成后再重新配置主策略路由。删除策略路由,请参见 DeleteVpnPbrRouteEntry 。
- ModifyVpnPbrRouteEntryWeight 接口属于异步接口,即系统先返回一个请求 ID,但该策略路由尚未修改成功,系统后台的修改任务仍在进行。您可以调用 DescribeVpnGateway 接口查询 VPN 网关实例状态,来确定策略路由的修改状态:
当 VPN 网关实例处于 updating 状态时,表示策略路由正在修改中。
当 VPN 网关实例处于 active 状态时,表示策略路由修改成功。
ModifyVpnPbrRouteEntryWeight 接口不支持在同一 VPN 网关实例下并发修改策略路由。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
vpc:ModifyVpnPbrRouteEntryWeight |
update |
*VpnGateway
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| RegionId |
string |
是 |
VPN 网关实例所在的地域 ID。您可以通过调用 DescribeRegions 接口获取地域 ID。 |
cn-hangzhou |
| ClientToken |
string |
否 |
客户端 Token,用于保证请求的幂等性。 从您的客户端生成一个参数值,确保不同请求间该参数值唯一。ClientToken 只支持 ASCII 字符。 说明
若您未指定,则系统自动使用 API 请求的 RequestId 作为 ClientToken 标识。每次 API 请求的 RequestId 不一样。 |
d7d24a21-f4ba-4454-9173-b3828dae492b |
| VpnGatewayId |
string |
是 |
VPN 网关实例 ID。 |
vpn-bp1a3kqjiiq9legfx**** |
| RouteSource |
string |
是 |
策略路由的源网段。 |
192.168.1.0/24 |
| RouteDest |
string |
是 |
策略路由的目标网段。 |
10.0.0.0/24 |
| NextHop |
string |
是 |
策略路由的下一跳。 |
vco-bp15oes1py4i66rmd**** |
| Weight |
integer |
是 |
策略路由原始的权重值。取值:
|
0 |
| NewWeight |
integer |
是 |
策略路由新的权重值。取值:
|
100 |
| OverlayMode |
string |
否 |
隧道协议。仅取值:Ipsec(IPsec 隧道协议)。 |
Ipsec |
| Priority |
integer |
否 |
策略路由的策略优先级。
|
10 |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
返回结果。 |
||
| RequestId |
string |
请求 ID。 |
5BE01CD7-5A50-472D-AC14-CA181C5C03BE |
示例
正常返回示例
JSON格式
{
"RequestId": "5BE01CD7-5A50-472D-AC14-CA181C5C03BE\t"
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | Resource.QuotaFull | The quota of resource is full | |
| 400 | VpnGateway.Configuring | The specified service is configuring. | |
| 400 | VpnGateway.FinancialLocked | The specified service is financial locked. | |
| 400 | VpnRouteEntry.AlreadyExists | The specified route entry is already exist. | 该路由已存在。 |
| 400 | VpnRouteEntry.Conflict | The specified route entry has conflict. | 路由条目存在冲突。 |
| 400 | VpnRouteEntry.SrcDestWeightConflict | The VPN gateway does not support Policy-based routing with the same source CIDR, destination CIDR and weight. | VPN网关不支持配置源网段、目标网段与权重同时相同的策略路由。 |
| 400 | VpnRouteEntry.SamePriorityPbrRoutePrefixOverlap | The source CIDR and destination CIDR of Policy-based routes with the same priority cannot overlap. | VPN网关不支持相同优先级下的多个策略路由源和目标网段同时重合。 |
| 400 | VpnRouteEntry.SrcDestConflict | The VPN gateway does not support Policy-based routing with the same source CIDR and destination CIDR. | 双隧道类型的VPN网关不支持配置源网段与目标网段同时相同的策略路由。 |
| 400 | VpnPbrRouteEntry.NotSupport | Current version of the VPN does not support pbr route entry. | 当前VPN实例不支持策略路由。 |
| 403 | Forbbiden.SubUser | User not authorized to operate on the specified resource as your account is created by another user. | |
| 403 | Forbidden | User not authorized to operate on the specified resource. | 您没有权限操作指定资源,请申请权限后再操作。 |
| 404 | InvalidVpnGatewayInstanceId.NotFound | The specified vpn gateway instance id does not exist. | |
| 404 | InvalidPbrRouteEntry.NotFound | The specified PBR route entry does not exist. | 指定的策略路由不存在。 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。