调用ModifyVpnGatewayAttribute接口修改VPN网关的名称和描述信息。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | ModifyVpnGatewayAttribute |
系统规定参数。取值:ModifyVpnGatewayAttribute。 |
RegionId | String | 是 | cn-shanghai |
VPN网关实例所在的地域ID。您可以通过调用DescribeRegions接口获取地域ID。 |
ClientToken | String | 否 | 02fb3da4-130e-11e9-8e44-0016e04115b |
客户端Token,用于保证请求的幂等性。 从您的客户端生成一个参数值,确保不同请求间该参数值唯一。ClientToken只支持ASCII字符。 |
VpnGatewayId | String | 是 | vpn-bp1q8bgx4xnkm2ogj**** |
VPN网关实例的ID。 |
Name | String | 否 | myvpn |
VPN网关的名称。 名称长度为2~100个字符,以大小写字母或中文开始,可包含数字、下划线(_)和短划线(-)。 |
Description | String | 否 | test |
VPN网关的描述信息。 描述信息长度为2~100个字符,以大小写字母或中文开始,可包含数字、下划线(_)和短划线(-)。 |
AutoPropagate | Boolean | 否 | true |
是否将BGP路由自动传播到VPC。取值:
|
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
VpcId | String | vpc-bp1ub1yt9cvakoel**** |
VPN网关实例所属VPC的ID。 |
Status | String | active |
VPN网关的状态。 |
InternetIp | String | 116.62.XX.XX |
VP网关实例的公网IP地址。 |
Spec | String | 5M |
VPN网关实例的带宽规格。单位:Mbps。 |
CreateTime | Long | 1492753580000 |
VPN网关实例的创建时间戳。单位:毫秒。 时间戳的格式采用Unix时间戳,表示从格林威治时间1970年01月01日00时00分00秒至创建VPN网关实例时的总时长。 |
AutoPropagate | Boolean | true |
BGP路由是否自动传播到VPC。取值:
|
VpnGatewayId | String | vpn-bp1q8bgx4xnkm2ogj**** |
VPN网关实例的ID。 |
IntranetIp | String | 172.27.30.24 |
VPN网关的私网IP。 |
EndTime | Long | 1495382400000 |
VPN网关实例的到期时间戳。单位:毫秒。 时间戳的格式采用Unix时间戳,表示从格林威治时间1970年01月01日00时00分00秒至VPN网关实例到期时的总时长。 |
VSwitchId | String | vsw-bp1y9ovl1cu9ou4tv**** |
VPN网关实例所属交换机的ID。 |
RequestId | String | 54B48E3D-DF70-471B-AA93-08E683A1B457 |
请求ID。 |
Description | String | test |
VPN网关实例的描述信息。 |
EnableBgp | Boolean | true |
VPN网关BGP功能的开启状态。取值:
|
BusinessStatus | String | Normal |
VPN网关实例的付费状态。取值:
|
Name | String | test |
VPN网关实例的名称。 |
示例
请求示例
http(s)://[Endpoint]/?Action=ModifyVpnGatewayAttribute
&RegionId=cn-shanghai
&VpnGatewayId=vpn-bp1q8bgx4xnkm2ogj****
&公共请求参数
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<ModifyVpnGatewayAttributeResponse>
<VpcId>vpc-bp1ub1yt9cvakoel****</VpcId>
<Status>active</Status>
<InternetIp>116.62.XX.XX</InternetIp>
<Spec>5M</Spec>
<CreateTime>1492753580000</CreateTime>
<AutoPropagate>true</AutoPropagate>
<VpnGatewayId>vpn-bp1q8bgx4xnkm2ogj****</VpnGatewayId>
<IntranetIp>172.27.30.24</IntranetIp>
<EndTime>1495382400000</EndTime>
<VSwitchId>vsw-bp1y9ovl1cu9ou4tv****</VSwitchId>
<RequestId>54B48E3D-DF70-471B-AA93-08E683A1B457</RequestId>
<Description>test</Description>
<EnableBgp>true</EnableBgp>
<BusinessStatus>Normal</BusinessStatus>
<Name>test</Name>
</ModifyVpnGatewayAttributeResponse>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"VpcId" : "vpc-bp1ub1yt9cvakoel****",
"Status" : "active",
"InternetIp" : "116.62.XX.XX",
"Spec" : "5M",
"CreateTime" : 1492753580000,
"AutoPropagate" : true,
"VpnGatewayId" : "vpn-bp1q8bgx4xnkm2ogj****",
"IntranetIp" : "172.27.30.24",
"EndTime" : 1495382400000,
"VSwitchId" : "vsw-bp1y9ovl1cu9ou4tv****",
"RequestId" : "54B48E3D-DF70-471B-AA93-08E683A1B457",
"Description" : "test",
"EnableBgp" : true,
"BusinessStatus" : "Normal",
"Name" : "test"
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | InvalidName | The name is not valid | 该名称格式不合法。 |
400 | InvalidDescription | The description is not valid | 描述格式不合法。 |
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加入到的CEN开启了FULL模式时,VPN网关不能开启BGP。 |
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. | 您没有权限操作指定资源,请申请权限后再操作。 |
访问错误中心查看更多错误码。