All Products
Search
Document Center

:ModifyVpnGatewayAttribute

更新時間:Aug 15, 2023

Modifies the name and description of a VPN gateway.

Usage notes

  • 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

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

ap-southeast-2

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

123e4567-e89b-12d3-a456-4266****

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.

VpnGatewayId

String

Yes

vpn-bp1q8bgx4xnkm2ogj****

The ID of the VPN gateway.

Name

String

No

myvpn

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.

Description

String

No

test

The new description of the VPN gateway.

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

AutoPropagate

Boolean

No

true

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

  • true

  • false

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.

  • init

  • provisioning

  • active

  • updating

  • deleting

InternetIp

String

116.62.XX.XX

  • 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.

Spec

String

5M

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

CreateTime

Long

1492753580000

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.

AutoPropagate

Boolean

true

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

  • true

  • false

VpnGatewayId

String

vpn-bp1q8bgx4xnkm2ogj****

The ID of the VPN gateway.

IntranetIp

String

172.27.30.24

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.

EndTime

Long

1495382400000

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

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

VSwitchId

String

vsw-bp1y9ovl1cu9ou4tv****

The ID of the vSwitch associated with the VPN gateway.

RequestId

String

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

The request ID.

Description

String

test

The description of the VPN gateway.

EnableBgp

Boolean

true

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

  • true

  • false

BusinessStatus

String

Normal

The payment status of the VPN gateway. Valid values:

  • Normal

  • FinancialLocked

Name

String

test

The name of the VPN gateway.

DisasterRecoveryInternetIp

String

116.11.XX.XX

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.

DisasterRecoveryVSwitchId

String

vsw-p0w95ql6tmr2ludkt****

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.

SslVpnInternetIp

String

116.33.XX.XX

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.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ModifyVpnGatewayAttribute
&RegionId=ap-southeast-2
&ClientToken=123e4567-e89b-12d3-a456-4266****
&VpnGatewayId=vpn-bp1q8bgx4xnkm2ogj****
&Name=myvpn
&Description=test
&AutoPropagate=true
&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>
    <EndTime>1495382400000</EndTime>
    <VSwitchId>vsw-bp1y9ovl1cu9ou4tv****</VSwitchId>
    <RequestId>54B48E3D-DF70-471B-AA93-08E683A1B457</RequestId>
    <Description>test</Description>
    <EnableBgp>true</EnableBgp>
    <BusinessStatus>Normal</BusinessStatus>
    <DisasterRecoveryVSwitchId>vsw-p0w95ql6tmr2ludkt****</DisasterRecoveryVSwitchId>
    <DisasterRecoveryInternetIp>116.11.XX.XX</DisasterRecoveryInternetIp>
    <SslVpnInternetIp>116.33.XX.XX</SslVpnInternetIp>
    <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****",
  "EndTime" : 1495382400000,
  "VSwitchId" : "vsw-bp1y9ovl1cu9ou4tv****",
  "RequestId" : "54B48E3D-DF70-471B-AA93-08E683A1B457",
  "Description" : "test",
  "EnableBgp" : true,
  "BusinessStatus" : "Normal",
  "DisasterRecoveryVSwitchId" : "vsw-p0w95ql6tmr2ludkt****",
  "DisasterRecoveryInternetIp" : "116.11.XX.XX",
  "SslVpnInternetIp" : "116.33.XX.XX",
  "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

OperationUnsupported.EnableBgp

Current version of the VPN does not support enable BGP.

The error message returned because 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.

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 you cannot enable BGP for a VPN gateway when the FULL mode is enabled for the Cloud Enterprise Network (CEN) instance to which the VPC of the VPN gateway is attached.

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 do not have permissions 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 do not have permissions to perform the operation on the specified resource. Acquire the required permissions and try again.

For a list of error codes, see Service error codes.