调用UpdateEnhancedVpnGateway接口修改增强型VPN网关的名称、描述信息或路由自动传播功能。
接口说明
- UpdateEnhancedVpnGateway 接口属于异步接口,即系统先返回增强型 VPN 网关的信息,但该增强型 VPN 网关的配置尚未修改成功,系统后台的修改任务仍在进行。您可以调用 DescribeVpnGateway 查询增强型 VPN 网关的配置的修改状态:
- 当增强型 VPN 网关处于 updating 状态时,表示增强型 VPN 网关的配置正在修改中。
- 当增强型 VPN 网关处于 active 状态时,表示 VPN 网关的配置修改成功。
- UpdateEnhancedVpnGateway 接口不支持并发修改同一个增强型 VPN 网关的配置。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:
- 操作:是指具体的权限点。
- 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
- 资源类型:是指操作中支持授权的资源类型。具体说明如下:
- 对于必选的资源类型,用前面加 * 表示。
- 对于不支持资源级授权的操作,用
全部资源表示。
- 条件关键字:是指云产品自身定义的条件关键字。
- 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
| 操作 | 访问级别 | 资源类型 | 条件关键字 | 关联操作 |
|---|---|---|---|---|
| vpc:UpdateEnhancedVpnGateway | update | *VpnGateway acs:vpc:{#regionId}:{#accountId}:vpngateway/{#VpnGatewayId} |
| 无 |
请求参数
| 名称 | 类型 | 必填 | 描述 | 示例值 |
|---|---|---|---|---|
| RegionId | string | 是 | 增强型 VPN 网关实例所在的地域 ID。您可以通过调用 DescribeRegions 接口获取地域 ID。 | cn-hangzhou |
| ClientToken | string | 否 | 客户端 Token,用于保证请求的幂等性。 从您的客户端生成一个参数值,确保不同请求间该参数值唯一。ClientToken 只支持 ASCII 字符。 说明
若您未指定,则系统自动使用 API 请求的 RequestId 作为 ClientToken 标识。每次 API 请求的 RequestId 不一样。
| 123e4567-e89b-12d3-a456-4266**** |
| VpnGatewayId | string | 是 | 增强型 VPN 网关实例的 ID。 | vpn-bp1q8bgx4xnkm2ogj**** |
| Name | string | 否 | 增强型 VPN 网关的新名称。 长度为 2~100 个字符,不能以 http://或 https://开头,需要以大写或小写字母开头,后面可包含大小写字母、数字、下划线(_)、短划线(-)和半角句号(.),不支持其他特殊字符。 | myvpn |
| Description | string | 否 | 增强型 VPN 网关新的描述信息。 描述信息长度为 1~100 个字符。 | test |
| AutoPropagate | boolean | 否 | 是否开启增强型 VPN 网关的路由自动传播功能。取值:
| true |
返回参数
示例
正常返回示例
JSON格式
{
"VpnType": "Normal",
"Status": "active",
"VpcId": "vpc-bp1ub1yt9cvakoel****",
"CreateTime": 1492753580000,
"AutoPropagate": true,
"VpnGatewayId": "vpn-bp1q8bgx4xnkm2ogj****",
"Tag": {
"VpnEnableBgp": true
},
"VSwitchId": "vsw-bp1y9ovl1cu9ou4tv****",
"RequestId": "54B48E3D-DF70-471B-AA93-08E683A1B457",
"EnableBgp": true,
"Name": "test",
"Description": "test",
"Tags": {
"Tag": [
{
"Key": "key1",
"Value": "val1"
}
]
},
"NetworkType": "public",
"DisasterRecoveryVSwitchId": "vsw-p0w95ql6tmr2ludkt****",
"ResourceGroupId": "rg-acfmzs372yg****",
"EniInstanceIds": {
"EniInstanceId": [
"eni-uf6cwkwt0f6zuul5****"
]
},
"GatewayType": "Enhanced.SiteToSite"
}错误码
| HTTP status code | 错误码 | 错误信息 | 描述 |
|---|---|---|---|
| 400 | InvalidName | The name is not valid | 该名称格式不合法。 |
| 400 | InvalidDescription | The description is not valid | 描述格式不合法。 |
| 400 | OperationUnsupported.EnableBgp | Current version of the VPN does not support enable BGP. | 当前版本的VPN不支持开启BGP |
| 400 | OperationFailed.VpnConnectionExist | Auto propagate cannot be closed when VPN connections with BGP enabled exist. | 当存在已开启BGP的VPN连接时,路由自动传播无法关闭。 |
| 400 | InvalidVpnGatewayInstanceId.NotFound | The specified vpn gateway instance id does not exist. | 指定的 VPN 网关不存在,请您检查 VPN 网关是否正确。 |
| 400 | VpnGateway.Configuring | The specified service is configuring. | 服务正在配置中,请您稍后再试。 |
| 400 | OperationFailed.CenLevelNotSupport | When the VPC to which the VPN gateway belongs is attached to a FULL-mode CEN, the VPN gateway cannot enable BGP. | 当VPN网关所属VPC加入到的云企业网且开启了路由同步时,VPN网关不能开启BGP。 |
| 400 | OperationFailed.VpcRoutePropagationDisable | The VPC system routing table does not enable the acceptance of propagated routes. | VPC系统路由表未开启接受传播路由 |
| 400 | OperationFailed.VpcRoutePublishEnabledInTR | A VPC supports at most one dynamic route learning source. In the forwarding router, disable route synchronization for the VPC. | VPC最多只支持一个动态路由学习源,请在转发路由器中关闭对该VPC的路由同步 |
| 400 | OperationFailed.VpcRoutePublishEnabledInECR | VPC supports only one dynamic route learning source at most. Please remove the VPC from ECR. | VPC最多只支持一个动态路由学习源,请将VPC从ECR中移除 |
| 400 | OperationFailed.BondingVpnNotSupportBGP | The architecture does not support BGP capabilities (single tunnel bonding architecture VPN gateway). | 架构不支持BGP能力(单隧道bonding架构vpn网关) |
| 400 | OperationFailed.StaleBGPRoutes | BGP routes are still there and automatic route propagation cannot be disabled. | BGP路由有残留,无法关闭路由自动传播。 |
| 403 | Forbidden.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. | 您没有权限操作指定资源,请申请权限后再操作。 |
访问错误中心查看更多错误码。
变更历史
| 变更时间 | 变更内容概要 | 操作 |
|---|---|---|
| 2026-04-02 | 新增 OpenAPI | 查看变更详情 |
