调用ModifyVpnGatewayAttribute接口修改VPN网关的名称和描述信息。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | ModifyVpnGatewayAttribute |
要执行的操作。取值:ModifyVpnGatewayAttribute。 |
RegionId | String | 是 | cn-shanghai |
VPN网关实例所在的地域。您可以通过调用DescribeRegions接口获取地域ID。 |
VpnGatewayId | String | 是 | vpn-bp1q8bgx4xnkm2ogj**** |
VPN网关实例的ID。 |
ClientToken | String | 否 | 02fb3da4-130e-11e9-8e44-0016e04115b |
客户端token,用于保证请求的幂等性。 由客户端生成该参数值,要保证在不同请求间唯一,最大值不超过64个ASCII字符。 |
Name | String | 否 | myvpn |
VPN网关的名称。 长度为2~128个字符,必须以字母或中文开头,可包含数字、点号(.)、下划线(_)和短横线(-)。但不能以 |
Description | String | 否 | vpn网关 |
VPN网关的描述信息。 长度为2~256个字符,必须以字母或中文开头,但不能以 |
AutoPropagate | Boolean | 否 | true |
是否将BGP路由自动传播到VPC,取值:
|
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
VpnGatewayId | String | vpn-bp1q8bgx4xnkm2ogj**** |
VPN网关实例的ID。 |
VpcId | String | vpc-bp1ub1yt9cvakoel**** |
VPN网关实例所属VPC的ID。 |
VSwitchId | String | vsw-bp1y9ovl1cu9ou4tv**** |
VPN网关实例所属交换机的ID。 |
InternetIp | String | 116.62.69.xxx |
VP网关实例的公网IP地址。 |
CreateTime | Long | 1492753580000 |
VPN网关实例的创建时间。 |
EndTime | Long | 1495382400000 |
VPN网关实例的到期时间。 |
Spec | String | 5M |
VPN网关实例的带宽规格。 |
Name | String | test |
VPN网关实例的名称。 |
Description | String | test |
VPN网关实例的描述信息。 |
Status | String | active |
VPN网关的状态。 |
BusinessStatus | String | Normal |
VPN网关实例的付费状态。 |
AutoPropagate | Boolean | true |
BGP路由是否自动传播到VPC。
|
EnableBgp | Boolean | true |
VPN网关BGP功能的开启状态。
|
IntranetIp | String | 172.16.104.xxx |
VPN网关的私网IP。 |
RequestId | String | 54B48E3D-DF70-471B-AA93-08E683A1B457 |
请求ID。 |
示例
请求示例
https://vpc.aliyuncs.com/?Action=ModifyVpnGatewayAttribute
&RegionId=cn-shanghai
&VpnGatewayId=vpn-bp1q8bgx4xnkm2ogj****
&<公共请求参数>
正常返回示例
XML
格式
<ModifyVpnGatewayAttributeResponse>
<EnableBgp>true</EnableBgp>
<RequestId>CA5C51BD-EF81-44FF-8311-5AC81ADECC9D</RequestId>
<EndTime>1592236800000</EndTime>
<VSwitchId>vsw-gw8m2k04wt3onzehf****</VSwitchId>
<CreateTime>1589526435000</CreateTime>
<AutoPropagate>true</AutoPropagate>
<IntranetIp>10.0.0.251</IntranetIp>
<Name>VPN11</Name>
<VpcId>vpc-gw82wgx7a8fakx4co****</VpcId>
<InternetIp>8.xx.xx.192</InternetIp>
<VpnGatewayId>vpn-gw8bvv722zwjht7ia****</VpnGatewayId>
<Spec>5M</Spec>
</ModifyVpnGatewayAttributeResponse>
JSON
格式
{
"EnableBgp": true,
"RequestId": "CA5C51BD-EF81-44FF-8311-5AC81ADECC9D",
"EndTime": 1592236800000,
"VSwitchId": "vsw-gw8m2k04wt3onzehf****",
"CreateTime": 1589526435000,
"AutoPropagate": true,
"IntranetIp": "10.0.0.251",
"Name": "VPN11",
"VpcId": "vpc-gw82wgx7a8fakx4co****",
"InternetIp": "8.xx.xx.192",
"VpnGatewayId": "vpn-gw8bvv722zwjht7ia****",
"Spec": "5M"
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
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. | 指定的 VPN 网关不存在,请您检查 VPN 网关是否正确。 |
400 | InvalidName | The name is not valid | 该名称格式不合法。 |
400 | InvalidDescription | The description is not valid | 描述格式不合法。 |
访问错误中心查看更多错误码。
在文档使用中是否遇到以下问题
更多建议
匿名提交