All Products
Search
Document Center

VPN Gateway:ModifyVpnGatewayAttribute

Last Updated:Nov 13, 2024

Modifies the name and description of a VPN gateway.

Operation description

  • ModifyVpnGatewayAttribute is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call DescribeVpnGateway to query the status of the task.

    • If the VPN gateway is in the updating state, the VPN gateway is being modified.
    • If the VPN gateway is in the active state, the VPN gateway is modified.
  • You cannot repeatedly call ModifyVpnGatewayAttribute to modify a VPN gateway within the specified period of time.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
vpc:ModifyVpnGatewayAttributeupdate
  • VpnGateway
    acs:vpc:{#regionId}:{#accountId}:vpngateway/{#VpnGatewayId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The ID of the region where the VPN gateway is created. You can call the DescribeRegions operation to query the most recent region list.

cn-shanghai
ClientTokenstringNo

The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The client token can contain only ASCII characters.

Note If you do not specify this parameter, the system automatically uses the request ID as the client token. The request ID may be different for each request.
123e4567-e89b-12d3-a456-4266****
VpnGatewayIdstringYes

The ID of the VPN gateway.

vpn-bp1q8bgx4xnkm2ogj****
NamestringNo

The new name of the VPN gateway.

The name must be 2 to 100 characters in length and cannot start with http:// or https://. It must start with a letter and can contain letters, digits, underscores (_), hyphens (-), and periods (.). Other characters are not supported.

myvpn
DescriptionstringNo

The new description of the VPN gateway.

The description must be 1 to 100 characters in length and cannot start with http:// or https://.

test
AutoPropagatebooleanNo

Specifies whether to automatically advertise BGP routes to the virtual private cloud (VPC). Valid values:

  • true
  • false
true

Response parameters

ParameterTypeDescriptionExample
object

The returned data.

VpcIdstring

The ID of the VPC to which the VPN gateway belongs.

vpc-bp1ub1yt9cvakoel****
Statusstring

The status of the VPN gateway. Valid values:

  • init
  • provisioning
  • active
  • updating
  • deleting
active
InternetIpstring
  • If the VPN gateway supports IPsec-VPN connections in single-tunnel mode, the address is the IP address of the VPN gateway and can be used to create an IPsec-VPN connection or an SSL-VPN connection.

  • If the VPN gateway supports IPsec-VPN connections in dual-tunnel mode, the address is the first IP address used to create an IPsec-VPN connection. The address cannot be used to create an SSL-VPN connection.

    If the VPN gateway supports IPsec-VPN connections in dual-tunnel mode, the system assigns two IP addresses to the VPN gateway to create two encrypted tunnels.

116.62.XX.XX
Specstring

The maximum bandwidth of the VPN gateway. Unit: Mbit/s.

5M
CreateTimelong

The time when the VPN gateway was created. Unit: milliseconds.

This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

1492753580000
AutoPropagateboolean

Indicates whether BGP routes are automatically advertised to the VPC. Valid values:

  • true
  • false
true
VpnGatewayIdstring

The ID of the VPN gateway.

vpn-bp1q8bgx4xnkm2ogj****
IntranetIpstring

The IP address of the VPN gateway.

This parameter is returned only when the VPN gateway is a private VPN gateway and supports only the single-tunnel mode.

172.27.30.24
EndTimelong

The time when the VPN gateway expires. Unit: milliseconds.

This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.

1495382400000
VSwitchIdstring

The ID of the vSwitch associated with the VPN gateway.

vsw-bp1y9ovl1cu9ou4tv****
RequestIdstring

The request ID.

54B48E3D-DF70-471B-AA93-08E683A1B457
Descriptionstring

The description of the VPN gateway.

test
EnableBgpboolean

Indicates whether BGP is enabled for the VPN gateway. Valid values:

  • true
  • false
true
BusinessStatusstring

The payment status of the VPN gateway. Valid values:

  • Normal
  • FinancialLocked
Normal
Namestring

The name of the VPN gateway.

test
DisasterRecoveryInternetIpstring

The second IP address assigned by the system to create an IPsec-VPN connection.

This parameter is returned only when the VPN gateway supports the dual-tunnel mode.

116.11.XX.XX
DisasterRecoveryVSwitchIdstring

The ID of the second vSwitch associated with the VPN gateway.

This parameter is returned only when the VPN gateway supports the dual-tunnel mode.

vsw-p0w95ql6tmr2ludkt****
SslVpnInternetIpstring

The IP address of the SSL-VPN connection.

This parameter is returned only when the VPN gateway is a public VPN gateway and supports only the single-tunnel mode. In addition, the VPN gateway must have the SSL-VPN feature enabled.

116.33.XX.XX

Examples

Sample success responses

JSONformat

{
  "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",
  "DisasterRecoveryInternetIp": "116.11.XX.XX",
  "DisasterRecoveryVSwitchId": "vsw-p0w95ql6tmr2ludkt****",
  "SslVpnInternetIp": "116.33.XX.XX",
  "ResourceGroupId": "rg-acfmzs372yg****"
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidNameThe name is not validThe name format is invalid.
400InvalidDescriptionThe description is not validThe format of the description is invalid.
400OperationUnsupported.EnableBgpCurrent version of the VPN does not support enable BGP.The current version of the VPN gateway does not support BGP.
400OperationFailed.VpnConnectionExistAuto propagate cannot be closed when VPN connections with BGP enabled exist.Auto propagation cannot be closed when VPN connections with BGP enabled exist.
400InvalidVpnGatewayInstanceId.NotFoundThe specified vpn gateway instance id does not exist.The specified VPN gateway does not exist. Check whether the specified VPN gateway is valid.
400VpnGateway.ConfiguringThe specified service is configuring.The service is being configured. Try again later.
400OperationFailed.CenLevelNotSupportWhen 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.
403Forbidden.SubUserUser 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.
403ForbiddenUser 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.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-10-19API Description Update. The API operation is not deprecated.. The Error code has changed. The response structure of the API has changedView Change Details
2023-06-30The Error code has changed. The response structure of the API has changedView Change Details