Domain name for API request: vpc.tencentcloudapi.com.
This API (CreateVpnGateway) is used to create a VPN gateway.
A maximum of 100 requests can be initiated per second for this API.
Note: This API supports Finance regions. If the common parameter Region is a Finance region, a domain name with the Finance region needs to be specified, for example: vpc.ap-shanghai-fsi.tencentcloudapi.com
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
Parameter Name | Required | Type | Description |
---|---|---|---|
Action | Yes | String | Common parameter. The value used for this API: CreateVpnGateway. |
Version | Yes | String | Common parameter. The value used for this API: 2017-03-12. |
Region | Yes | String | Common parameter. For more information, please see the list of regions supported by the product. |
VpcId | Yes | String | VPC instance ID, which can be obtained from the VpcId field in the response of the DescribeVpcs API. |
VpnGatewayName | Yes | String | The VPN gateway name. The maximum length is 60 bytes. |
InternetMaxBandwidthOut | Yes | Integer | The public network bandwidth configuration. Available bandwidth specifications: 5, 10, 20, 50, and 100. Unit: Mbps |
InstanceChargeType | No | String | The VPN gateway billing mode. PREPAID: prepaid means monthly subscription. POSTPAID_BY_HOUR: postpaid means pay-as-you-go. Default: POSTPAID_BY_HOUR. If prepaid mode is specified, the InstanceChargePrepaid parameter must be entered. |
InstanceChargePrepaid | No | InstanceChargePrepaid | Parameter settings for prepaid billing mode, also known as monthly subscription. This parameter can specify the purchase period and other attributes such as auto-renewal. This parameter is mandatory for prepaid instances. |
Zone | No | String | The availability zone, such as ap-guangzhou-2 . |
Type | No | String | VPN gateway type. Value: CCN , indicates CCN-type VPN gateway |
Tags.N | No | Array of Tag | Bound tags, such as [{"Key": "city", "Value": "shanghai"}]. |
Parameter Name | Type | Description |
---|---|---|
VpnGateway | VpnGateway | VPN gateway object. |
RequestId | String | The unique request ID, which is returned for each request. RequestId is required for locating a problem. |
https://vpc.tencentcloudapi.com/?Action=CreateVpnGateway
&VpcId=vpc-ngenl4az
&VpnGatewayName=TEST_POSTPAID_VPNGW
&InstanceChargeType=POSTPAID_BY_HOUR
&InternetMaxBandwidthOut=5
&Tags.0.Key=city
&Tags.0.Value=shanghai
&<Common request parameters>
{
"Response": {
"VpnGateway": {
"VpcId": "vpc-ngenl4az",
"VpnGatewayId": "vpngw-test1234",
"VpnGatewayName": "TEST_POSTPAID_VPNGW",
"Type": "IPSEC",
"State": "AVAILABLE",
"PublicIpAddress": "xxx.xxx.xxx.xxx",
"RenewFlag": "NOTIFY_AND_AUTO_RENEW",
"InstanceChargeType": "POSTPAID_BY_HOUR",
"InternetMaxBandwidthOut": 5,
"CreatedTime": "2020-10-13 19:03:26",
"ExpiredTime": "2020-12-13 19:04:54",
"IsAddressBlocked": false,
"NewPurchasePlan": "",
"RestrictState": "NORMAL",
"Zone": "ap-shanghai-1",
"Version": "ver2.0",
"NetworkInstanceId": "vpc-i9otxqn5",
"VpnGatewayQuotaSet": [
{
"Bandwidth": 5,
"Cname": "Mini type",
"Name": "qcmini"
},
{
"Bandwidth": 50,
"Cname": "Large type",
"Name": "qclarge"
},
{
"Bandwidth": 200,
"Cname": "Superlarge type 2",
"Name": "qcsuperLarge2"
},
{
"Bandwidth": 100,
"Cname": "Superlarge type",
"Name": "qcsuperLarge"
},
{
"Bandwidth": 500,
"Cname": "Superlarge type 3",
"Name": "qcsuperLarge3"
},
{
"Bandwidth": 10,
"Cname": "Small type",
"Name": "qcsmall"
},
{
"Bandwidth": 20,
"Cname": "Middle type",
"Name": "qcmiddle"
},
{
"Bandwidth": 1000,
"Cname": "Superlarge type 4",
"Name": "qcsuperLarge4"
}
]
},
"RequestId": "ea4bc0de-5093-423e-96ae-08f0fd4889be"
}
}
https://vpc.tencentcloudapi.com/?Action=CreateVpnGateway
&VpcId=vpc-5rkcp0wb
&VpnGatewayName=TEST_PREPAID_VPNGW
&InstanceChargeType=PREPAID
&InternetMaxBandwidthOut=5
&InstanceChargePrepaid.Period=1
&Tags.0.Key=city
&Tags.0.Value=shanghai
&<Common request parameters>
{
"Response": {
"VpnGateway": {
"VpcId": "vpc-5rkcp0wb",
"VpnGatewayId": "vpngw-test1234",
"VpnGatewayName": "TEST_PREPAID_VPNGW",
"Type": "IPSEC",
"State": "AVAILABLE",
"PublicIpAddress": "xxx.xxx.xxx.xxx",
"RenewFlag": "NOTIFY_AND_AUTO_RENEW",
"InstanceChargeType": "PREPAID",
"InternetMaxBandwidthOut": 5,
"CreatedTime": "2020-10-13 19:03:26",
"ExpiredTime": "2020-12-13 19:04:54",
"IsAddressBlocked": false,
"NewPurchasePlan": "",
"RestrictState": "NORMAL",
"Zone": "ap-shanghai-1",
"Version": "ver2.0",
"NetworkInstanceId": "vpc-i9otxqn5",
"VpnGatewayQuotaSet": [
{
"Bandwidth": 5,
"Cname": "Mini type",
"Name": "qcmini"
},
{
"Bandwidth": 50,
"Cname": "Large type",
"Name": "qclarge"
},
{
"Bandwidth": 200,
"Cname": "Superlarge type 2",
"Name": "qcsuperLarge2"
},
{
"Bandwidth": 100,
"Cname": "Superlarge type",
"Name": "qcsuperLarge"
},
{
"Bandwidth": 500,
"Cname": "Superlarge type 3",
"Name": "qcsuperLarge3"
},
{
"Bandwidth": 10,
"Cname": "Small type",
"Name": "qcsmall"
},
{
"Bandwidth": 20,
"Cname": "Middle type",
"Name": "qcmiddle"
},
{
"Bandwidth": 1000,
"Cname": "Superlarge type 4",
"Name": "qcsuperLarge4"
}
]
},
"RequestId": "ea4bc0de-5093-423e-96ae-08f0fd4889be"
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
Error Code | Description |
---|---|
InvalidParameterValue | Incorrect parameter value. |
InvalidParameterValue.VpnConnCidrConflict | Destination IP address range conflicts with CIDR block of the current VPC tunnel. |
InvalidVpcId.Malformed | Invalid VPC. The VPC instance ID is invalid. |
InvalidVpcId.NotFound | Invalid VPC. The VPC resource does not exist. |
LimitExceeded | Quota limit is reached. |
ResourceNotFound | The resource does not exist. |
UnsupportedOperation.InsufficientFunds | Insufficient account balance. |
Was this page helpful?