调用ModifyVpnGatewayAttribute接口修改VPN网关的名称、描述信息或路由自动传播功能。
接口说明
- ModifyVpnGatewayAttribute 接口属于异步接口,即系统先返回 VPN 网关的信息,但该 VPN 网关的配置尚未修改成功,系统后台的修改任务仍在进行。您可以调用 DescribeVpnGateway 查询 VPN 网关的配置的修改状态:
当 VPN 网关处于 updating 状态时,表示 VPN 网关的配置正在修改中。
当 VPN 网关处于 active 状态时,表示 VPN 网关的配置修改成功。
ModifyVpnGatewayAttribute 接口不支持并发修改同一个 VPN 网关的配置。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
vpc:ModifyVpnGatewayAttribute |
update |
*VpnGateway
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| 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 个字符,不能以 |
myvpn |
| Description |
string |
否 |
VPN 网关新的描述信息。 描述信息长度为 1~100 个字符。 |
test |
| AutoPropagate |
boolean |
否 |
是否开启 VPN 网关的路由自动传播功能。取值:
|
true |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
返回结果。 |
||
| VpcId |
string |
VPN 网关实例所属 VPC 的 ID。 |
vpc-bp1ub1yt9cvakoel**** |
| Status |
string |
VPN 网关的状态。
|
active |
| InternetIp |
string |
|
116.62.XX.XX |
| Spec |
string |
VPN 网关实例的带宽规格。单位:Mbps。 |
5M |
| CreateTime |
integer |
VPN 网关实例的创建时间戳。单位:毫秒。 时间戳的格式采用 Unix 时间戳,表示从格林威治时间 1970 年 01 月 01 日 00 时 00 分 00 秒至创建 VPN 网关实例时的总时长。 |
1492753580000 |
| AutoPropagate |
boolean |
BGP 路由是否自动传播到 VPC。取值:
|
true |
| VpnGatewayId |
string |
VPN 网关实例的 ID。 |
vpn-bp1q8bgx4xnkm2ogj**** |
| IntranetIp |
string |
系统部署 VPN 网关实例时占用的交换机私网 IP 地址。 仅支持单隧道模式 IPsec-VPN 连接的 VPN 网关实例会返回当前参数,且该 VPN 网关实例需已开启 IPsec-VPN 功能。 |
172.16.10.46 |
| EndTime |
integer |
VPN 网关实例的到期时间戳。单位:毫秒。 时间戳的格式采用 Unix 时间戳,表示从格林威治时间 1970 年 01 月 01 日 00 时 00 分 00 秒至 VPN 网关实例到期时的总时长。 |
1495382400000 |
| VSwitchId |
string |
VPN 网关实例关联的交换机 ID。 |
vsw-bp1y9ovl1cu9ou4tv**** |
| RequestId |
string |
请求 ID。 |
54B48E3D-DF70-471B-AA93-08E683A1B457 |
| Description |
string |
VPN 网关实例的描述信息。 |
test |
| EnableBgp |
boolean |
VPN 网关 BGP 功能的开启状态。取值:
|
true |
| BusinessStatus |
string |
VPN 网关实例的付费状态。取值:
|
Normal |
| Name |
string |
VPN 网关实例的名称。 |
test |
| DisasterRecoveryInternetIp |
string |
系统为 VPN 网关实例分配的用于创建 IPsec-VPN 连接的第二个 IP 地址。 仅支持创建双隧道模式 IPsec-VPN 连接的 VPN 网关实例会返回当前参数。 |
116.11.XX.XX |
| DisasterRecoveryVSwitchId |
string |
VPN 网关实例关联的第二个交换机 ID。 仅支持创建双隧道模式 IPsec-VPN 连接的 VPN 网关实例会返回当前参数。 |
vsw-p0w95ql6tmr2ludkt**** |
| SslVpnInternetIp |
string |
SSL-VPN 连接的 IP 地址。 仅支持创建双隧道模式 IPsec-VPN 连接的公网网络类型的 VPN 网关实例开启 SSL-VPN 功能后,才会返回当前参数。 |
116.33.XX.XX |
| ResourceGroupId |
string |
VPN 网关实例所属的资源组 ID。 您可以调用 ListResourceGroups 接口查询资源组信息。 |
rg-acfmzs372yg**** |
示例
正常返回示例
JSON格式
{
"VpcId": "vpc-bp1ub1yt9cvakoel****",
"Status": "active",
"InternetIp": "116.62.XX.XX",
"Spec": "5M",
"CreateTime": 1492753580000,
"AutoPropagate": true,
"VpnGatewayId": "vpn-bp1q8bgx4xnkm2ogj****",
"IntranetIp": "172.16.10.46",
"EndTime": 1495382400000,
"VSwitchId": "vsw-bp1y9ovl1cu9ou4tv****",
"RequestId": "54B48E3D-DF70-471B-AA93-08E683A1B457",
"Description": "test",
"EnableBgp": true,
"BusinessStatus": "Normal",
"Name": "test",
"DisasterRecoveryInternetIp": "116.11.XX.XX",
"DisasterRecoveryVSwitchId": "vsw-p0w95ql6tmr2ludkt****",
"SslVpnInternetIp": "116.33.XX.XX",
"ResourceGroupId": "rg-acfmzs372yg****"
}
错误码
|
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. | 您没有权限操作指定资源,请申请权限后再操作。 |
| 404 | InvalidVpnGatewayInstanceId.NotFound | The specified vpn gateway instance id does not exist. |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。