Modifies the name, description, or automatic route propagation feature of a VPN gateway.
Operation description
- The ModifyVpnGatewayAttribute operation is asynchronous. The system returns the information of the VPN gateway before the configuration is modified. The modification task is still running in the background. You can call the DescribeVpnGateway operation to query the modification status of the VPN gateway configuration:
If the VPN gateway is in the updating state, the configuration of the VPN gateway is being modified.
If the VPN gateway is in the active state, the configuration of the VPN gateway is modified.
The ModifyVpnGatewayAttribute operation does not support concurrent modifications to the configuration of the same VPN gateway.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
vpc:ModifyVpnGatewayAttribute |
update |
*VpnGateway
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID of the VPN gateway. You can call the DescribeRegions operation to obtain the region ID. |
cn-hangzhou |
| ClientToken |
string |
No |
The client token that is used to ensure the idempotence of the request. You can generate the parameter value on your client to ensure that the value is unique among different requests. The client token supports only ASCII characters. Note
If you do not specify this parameter, the system automatically uses the RequestId of the API request as the client token. The RequestId of each API request is unique. |
123e4567-e89b-12d3-a456-4266**** |
| VpnGatewayId |
string |
Yes |
The ID of the VPN gateway. |
vpn-bp1q8bgx4xnkm2ogj**** |
| Name |
string |
No |
The new name of the VPN gateway. The name must be 2 to 100 characters in length, and cannot start with |
myvpn |
| Description |
string |
No |
The new description of the VPN gateway. The description must be 1 to 100 characters in length. |
test |
| AutoPropagate |
boolean |
No |
Specifies whether to enable the automatic route propagation feature for the VPN gateway. Valid values:
|
true |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response. |
||
| VpcId |
string |
The ID of the VPC to which the VPN gateway belongs. |
vpc-bp1ub1yt9cvakoel**** |
| Status |
string |
The status of the VPN gateway. Valid values:
|
active |
| InternetIp |
string |
|
116.62.XX.XX |
| Spec |
string |
The bandwidth specification of the VPN gateway. Unit: Mbit/s. |
5M |
| CreateTime |
integer |
The timestamp of when the VPN gateway was created. Unit: milliseconds. The timestamp follows the UNIX time format. It is the total number of milliseconds that have elapsed since 00:00:00 Thursday, January 1, 1970 (UTC). |
1492753580000 |
| AutoPropagate |
boolean |
Specifies whether BGP routes are automatically propagated to the VPC. Valid values:
|
true |
| VpnGatewayId |
string |
The ID of the VPN gateway. |
vpn-bp1q8bgx4xnkm2ogj**** |
| IntranetIp |
string |
The private IP address of the vSwitch that is occupied when the system deploys the VPN gateway. This parameter is returned only for VPN gateways that support only single-tunnel IPsec-VPN connections and have the IPsec-VPN feature enabled. |
172.16.10.46 |
| EndTime |
integer |
The expiration UNIX timestamp of the VPN gateway. Unit: milliseconds. The UNIX timestamp follows the UNIX time format. It is the total number of milliseconds that have elapsed since 00:00:00 Thursday, January 1, 1970 (UTC) until the VPN gateway expires. |
1495382400000 |
| VSwitchId |
string |
The ID of the vSwitch associated with the VPN gateway. |
vsw-bp1y9ovl1cu9ou4tv**** |
| RequestId |
string |
The request ID. |
54B48E3D-DF70-471B-AA93-08E683A1B457 |
| Description |
string |
The description of the VPN gateway. |
test |
| EnableBgp |
boolean |
Specifies whether the BGP feature is enabled for the VPN gateway. Valid values:
|
true |
| BusinessStatus |
string |
The billing status of the VPN gateway. Valid values:
|
Normal |
| Name |
string |
The name of the VPN gateway. |
test |
| DisasterRecoveryInternetIp |
string |
The second IP address assigned by the system to the VPN gateway for creating an IPsec-VPN connection. This parameter is returned only for VPN gateways that support dual-tunnel IPsec-VPN connections. |
116.11.XX.XX |
| DisasterRecoveryVSwitchId |
string |
The ID of the second vSwitch associated with the VPN gateway. This parameter is returned only for VPN gateways that support dual-tunnel IPsec-VPN connections. |
vsw-p0w95ql6tmr2ludkt**** |
| SslVpnInternetIp |
string |
The IP address of the SSL-VPN connection. This parameter is returned only after the SSL-VPN feature is enabled for a VPN gateway of the public network type that supports dual-tunnel IPsec-VPN connections. |
116.33.XX.XX |
| ResourceGroupId |
string |
The ID of the resource group to which the VPN gateway belongs. You can call the ListResourceGroups operation to query resource group information. |
rg-acfmzs372yg**** |
Examples
Success response
JSON format
{
"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****"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 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. | The current version of the VPN gateway does not support BGP. |
| 400 | OperationFailed.VpnConnectionExist | Auto propagate cannot be closed when VPN connections with BGP enabled exist. | Auto propagation cannot be closed when VPN connections with BGP enabled exist. |
| 400 | InvalidVpnGatewayInstanceId.NotFound | The specified vpn gateway instance id does not exist. | The specified VPN gateway does not exist. Check whether the specified VPN gateway is valid. |
| 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. | When the VPC to which the VPN gateway belongs is attached to a FULL-mode CEN, the VPN gateway cannot enable BGP. |
| 400 | OperationFailed.VpcRoutePropagationDisable | The VPC system routing table does not enable the acceptance of propagated routes. | The VPC system route table is not enabled to accept the propagation route. |
| 400 | OperationFailed.VpcRoutePublishEnabledInTR | A VPC supports at most one dynamic route learning source. In the forwarding router, disable route synchronization for the VPC. | A VPC supports at most one dynamic route learning source. In the forwarding router, disable route synchronization for the VPC. |
| 400 | OperationFailed.VpcRoutePublishEnabledInECR | VPC supports only one dynamic route learning source at most. Please remove the VPC from ECR. | A VPC supports at most one dynamic route learning source. Remove the VPC from ECR |
| 400 | OperationFailed.BondingVpnNotSupportBGP | The architecture does not support BGP capabilities (single tunnel bonding architecture VPN gateway). | the architecture does not support the bgp capability (single-tunnel bonding vpn gateway) |
| 400 | OperationFailed.StaleBGPRoutes | BGP routes are still there and automatic route propagation cannot be disabled. | Automatic route propagation cannot be disabled because a BGP route is left. |
| 403 | Forbidden.SubUser | User not authorized to operate on the specified resource as your account is created by another user. | The error message returned because you are unauthorized to perform this operation on the specified resource. Acquire the required permissions and try again. |
| 403 | Forbidden | User not authorized to operate on the specified resource. | You do not have the permissions to manage the specified resource. Apply for the permissions and try again. |
| 404 | InvalidVpnGatewayInstanceId.NotFound | The specified vpn gateway instance id does not exist. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.