调用ModifyVpnGatewayAttribute接口修改VPN网关的配置。
使用说明
- ModifyVpnGatewayAttribute接口属于异步接口,即系统先返回VPN网关的信息,但该VPN网关的配置尚未修改成功,系统后台的修改任务仍在进行。您可以调用DescribeVpnGateway查询VPN网关的配置的修改状态:
- 当VPN网关处于updating状态时,表示VPN网关的配置正在修改中。
- 当VPN网关处于active状态时,表示VPN网关的配置修改成功。
- ModifyVpnGatewayAttribute接口不支持并发修改同一个VPN网关的配置。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | ModifyVpnGatewayAttribute |
系统规定参数。取值:ModifyVpnGatewayAttribute。 |
RegionId | String | 是 | cn-shanghai |
VPN网关实例所在的地域ID。您可以通过调用DescribeRegions接口获取地域ID。 |
ClientToken | String | 否 | 123e4567-e89b-12d3-a456-4266**** |
客户端Token,用于保证请求的幂等性。 从您的客户端生成一个参数值,确保不同请求间该参数值唯一。ClientToken只支持ASCII字符。 说明 若您未指定,则系统自动使用API请求的RequestId作为ClientToken标识。每次API请求的RequestId可能不一样。
|
VpnGatewayId | String | 是 | vpn-bp1q8bgx4xnkm2ogj**** |
VPN网关实例的ID。 |
Name | String | 否 | myvpn |
VPN网关的新名称。 名称长度为1~100个字符,不能以 |
Description | String | 否 | test |
VPN网关新的描述信息。 描述信息长度为1~100个字符,不能以 |
AutoPropagate | Boolean | 否 | true |
是否将BGP路由自动传播到VPC。取值:
|
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
VpcId | String | vpc-bp1ub1yt9cvakoel**** |
VPN网关实例所属VPC的ID。 |
Status | String | active |
VPN网关的状态。
|
InternetIp | String | 116.62.XX.XX |
VPN网关实例的公网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
&ClientToken=123e4567-e89b-12d3-a456-4266****
&VpnGatewayId=vpn-bp1q8bgx4xnkm2ogj****
&Name=myvpn
&Description=test
&公共请求参数
正常返回示例
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 | 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加入到的CEN开启了FULL模式时,VPN网关不能开启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. | 您没有权限操作指定资源,请申请权限后再操作。 |
访问错误中心查看更多错误码。