Modifies the name and description of a VPN gateway.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ModifyVpnGatewayAttribute

The operation that you want to perform. Set the value to ModifyVpnGatewayAttribute.

RegionId String Yes cn-shanghai

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

ClientToken String No 02fb3da4-130e-11e9-8e44-0016e04115b

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

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

VpnGatewayId String Yes vpn-bp1q8bgx4xnkm2ogj****

The ID of the VPN gateway.

Name String No myvpn

The name of the VPN gateway.

The name must be 2 to 100 characters in length, and can contain digits, underscores (_), and hyphens (-). It must start with a letter.

Description String No test

The description of the VPN gateway.

The description must be 2 to 100 characters in length, and can contain digits, underscores (_), and hyphens (-). It must start with a letter.

AutoPropagate Boolean No true

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

  • true: yes
  • false: no

Response parameters

Parameter Type Example Description
VpcId String vpc-bp1ub1yt9cvakoel****

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

Status String active

The status of the VPN gateway.

InternetIp String 116.62.XX.XX

The public IP address of the VPN gateway.

Spec String 5M

The specification of the VPN gateway. Unit: Mbit/s.

CreateTime Long 1492753580000

The timestamp generated when the VPN gateway was created. 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.

AutoPropagate Boolean true

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

  • true: yes
  • false: no
VpnGatewayId String vpn-bp1q8bgx4xnkm2ogj****

The ID of the VPN gateway.

IntranetIp String 172.27.30.24

The private IP address of the VPN gateway.

EndTime Long 1495382400000

The timestamp generated 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.

VSwitchId String vsw-bp1y9ovl1cu9ou4tv****

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

RequestId String 54B48E3D-DF70-471B-AA93-08E683A1B457

The ID of the request.

Description String test

The description of the VPN gateway.

EnableBgp Boolean true

The BGP status of the VPN gateway. Valid values:

  • true: enabled
  • false: disabled
BusinessStatus String Normal

The payment status of the VPN gateway. Valid values:

  • Normal: normal
  • FinancialLocked: locked due to overdue payments
Name String test

The name of the VPN gateway.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ModifyVpnGatewayAttribute
&RegionId=cn-shanghai
&VpnGatewayId=vpn-bp1q8bgx4xnkm2ogj****
&<Common request parameters>

Sample success responses

XML format

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 format

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"
}

Error codes

HttpCode Error code Error message Description
400 InvalidName The name is not valid The error message returned because the format of the name is invalid.
400 InvalidDescription The description is not valid The error message returned because the format of the description is invalid.
400 OperationFailed.VpnConnectionExist Auto propagate cannot be closed when VPN connections with BGP enabled exist. The error message returned because you cannot disable automatic route advertising when an existing VPN connection has BGP enabled.
400 InvalidVpnGatewayInstanceId.NotFound The specified vpn gateway instance id does not exist. The error message returned because the specified VPN gateway does not exist. Check whether the specified VPN gateway is valid.
400 VpnGateway.Configuring The specified service is configuring. The error message returned because the operation is not allowed when the specified service is being configured. Try again later.
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. The error message returned because the VPC of the VPN gateway is attached to a Cloud Enterprise Network (CEN) instance that uses the FULL mode. Therefore, you cannot enable BGP for the VPN gateway.
403 Forbbiden.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. The error message returned because you are unauthorized to perform the operation on the specified resource. Acquire the required permissions and try again.

For a list of error codes, visit the API Error Center.