This API is used to create a VPN gateway.
For details, see Calling APIs.
Parameter |
Type |
Mandatory |
Description |
---|---|---|---|
project_id |
String |
Yes |
Specifies a project ID. You can obtain the project ID by referring to Obtaining the Project ID. |
Parameter |
Type |
Mandatory |
Description |
---|---|---|---|
vpn_gateway |
CreateVgwRequestBodyContent object |
Yes |
Specifies the VPN gateway object. |
Parameter |
Type |
Mandatory |
Description |
---|---|---|---|
name |
String |
No |
|
network_type |
String |
No |
|
attachment_type |
String |
No |
|
er_id |
String |
No |
|
vpc_id |
String |
No |
You can obtain the VPC ID by querying VPCs. |
local_subnets |
Array of String |
No |
|
connect_subnet |
String |
No |
|
bgp_asn |
Long |
No |
|
flavor |
String |
No |
NOTE:
|
availability_zone_ids |
Array of String |
No |
|
enterprise_project_id |
String |
No |
|
eip1 |
CreateRequestEip object |
No |
|
eip2 |
CreateRequestEip object |
No |
|
access_vpc_id |
String |
No |
|
access_subnet_id |
String |
No |
|
ha_mode |
String |
No |
|
access_private_ip_1 |
String |
No |
|
access_private_ip_2 |
String |
No |
|
tags |
Array of VpnResourceTag objects |
No |
|
Parameter |
Type |
Mandatory |
Description |
---|---|---|---|
key |
String |
Yes |
|
value |
String |
Yes |
|
POST https://{Endpoint}/v5/{project_id}/vpn-gateways { "vpn_gateway": { "vpc_id": "cb4a631d-demo-a8df-va86-ca3fa348c36c", "local_subnets": [ "192.168.0.0/24", "192.168.1.0/24" ], "connect_subnet": "f5741286-demo-a8df-va86-2c82bd9ee114", "eip1": { "id": "cff40e5e-demo-a8df-va86-7366077bf097" }, "eip2": { "id": "d290f1ee-demo-a8df-va86-d701748f0851" } } }
POST https://{Endpoint}/v5/{project_id}/vpn-gateways { "vpn_gateway": { "name": "vpngw-1234", "attachment_type": "er", "er_id": "cb4a631d-demo-a8df-va86-ca3fa348c36c", "vpc_id": "584a238f-demo-a8df-va86-edca746f6277", "connect_subnet": "f5741286-demo-a8df-va86-2c82bd9ee114", "bgp_asn": 65533, "flavor": "Professional2", "availability_zone_ids": [ "eu-de-01" "eu-de-02" ], "eip1": { "type": "5_bgp", "charge_mode": "traffic", "bandwidth_size": 1000, "bandwidth_name": "vpngw-bandwidth-1391" }, "eip2": { "type": "5_bgp", "charge_mode": "traffic", "bandwidth_size": 1000, "bandwidth_name": "vpngw-bandwidth-1392" } } }
POST https://{Endpoint}/v5/{project_id}/vpn-gateways { "vpn_gateway": { "vpc_id": "cb4a631d-demo-a8df-va86-ca3fa348c36c", "local_subnets": [ "192.168.0.0/24", "192.168.1.0/24" ], "connect_subnet": "f5741286-demo-a8df-va86-2c82bd9ee114", "network_type": "private" } }
Returned status code 201: successful operation
Parameter |
Type |
Description |
---|---|---|
vpn_gateway |
ResponseVpnGateway object |
Specifies the VPN gateway object. |
request_id |
String |
Specifies a request ID. |
Parameter |
Type |
Description |
---|---|---|
id |
String |
|
name |
String |
|
network_type |
String |
|
attachment_type |
String |
|
er_id |
String |
Specifies the ID of the enterprise router instance to which the VPN gateway connects. This parameter is available only when attachment_type is set to er. |
vpc_id |
String |
When attachment_type is set to vpc, vpc_id specifies the ID of the service VPC associated with the VPN gateway. This parameter is not returned when attachment_type is set to er. To view the ID of the access VPC used by the VPN gateway, check the access_vpc_id field. |
local_subnets |
Array of String |
Specifies a local subnet. This subnet is a cloud-side subnet that needs to communicate with an on-premises network through a VPN. For example, a local subnet can be 192.168.52.0/24. This parameter is available only when attachment_type is set to vpc. |
connect_subnet |
String |
Specifies the ID of the VPC subnet used by the VPN gateway. |
bgp_asn |
Long |
Specifies the BGP AS number of the VPN gateway. |
flavor |
String |
|
connection_number |
Integer |
Specifies the maximum number of VPN connections supported for the VPN gateway. |
used_connection_number |
Integer |
Specifies the number of VPN connections that have been used by the VPN gateway. |
used_connection_group |
Integer |
Specifies the number of VPN connection groups that have been used by the VPN gateway. A connection group consists of two connections between a customer gateway and a VPN gateway. By default, 10 VPN connection groups are included free of charge with the purchase of a VPN gateway. |
enterprise_project_id |
String |
|
access_vpc_id |
String |
|
access_subnet_id |
String |
|
ha_mode |
String |
|
policy_template |
PolicyTemplate object |
Specifies a policy template. This parameter is returned only for a VPN gateway that supports access via non-fixed IP addresses. |
tags |
Array of VpnResourceTag objects |
Specifies a tag list. |
Parameter |
Type |
Description |
---|---|---|
key |
String |
|
value |
String |
|
Parameter |
Type |
Description |
---|---|---|
ike_policy |
IkePolicy object |
Specifies the IKE policy object. |
ipsec_policy |
IpsecPolicy object |
Specifies the IPsec policy object. |
Parameter |
Type |
Description |
---|---|---|
encryption_algorithm |
String |
|
dh_group |
String |
|
authentication_algorithm |
String |
|
lifetime_seconds |
Integer |
|
Parameter |
Type |
Description |
---|---|---|
authentication_algorithm |
String |
|
encryption_algorithm |
String |
|
pfs |
String |
|
lifetime_seconds |
Integer |
|
{ "vpn_gateway": { "id": "134f9fb1-demo-a8df-va86-2040a5c13325", "name": "vpngw-9f24", "network_type": "public", "attachment_type": "vpc", "vpc_id": "0cf79a3f-demo-a8df-va86-d7ace626b0fa", "local_subnets": ["192.168.0.0/24"], "connect_subnet": "f5741286-demo-a8df-va86-2c82bd9ee114", "bgp_asn": 64512, "flavor": "Professional1", "connection_number": 200, "used_connection_number": 0, "used_connection_group": 0, "enterprise_project_id": "0", "access_vpc_id": "0cf79a3f-demo-a8df-va86-d7ace626b0fa", "access_subnet_id": "f5741286-demo-a8df-va86-2c82bd9ee114", "ha_mode": "active-active" }, "request_id": "7b37532a-d6e4-46b9-98dc-9169ec2ca58f" }
{ "vpn_gateway": { "id": "80ac167b-demo-a8df-va86-a9a2a23223b8", "name": "vpngw-1234", "network_type": "public", "attachment_type": "er", "er_id": "cb4a631d-demo-a8df-va86-ca3fa348c36c", "bgp_asn": 65533, "flavor": "Professional2", "connection_number": 200, "used_connection_number": 0, "used_connection_group": 0, "enterprise_project_id": "0", "access_vpc_id": "0cf79a3f-demo-a8df-va86-d7ace626b0fa", "access_subnet_id": "f5741286-demo-a8df-va86-2c82bd9ee114", "ha_mode": "active-active" }, "request_id": "cd71cade-bfbd-410b-b672-4bfe46cfc311" }
{ "vpn_gateway": { "id": "80ac167b-demo-a8df-va86-a9a2a23223b8", "name": "vpngw-1234", "network_type": "private", "attachment_type": "vpc", "vpc_id": "cb4a631d-demo-a8df-va86-ca3fa348c36c", "local_subnets": ["192.168.0.0/24", "192.168.1.0/24"], "connect_subnet": "f5741286-demo-a8df-va86-2c82bd9ee114", "bgp_asn": 65533, "flavor": "Professional2", "connection_number": 200, "used_connection_number": 0, "used_connection_group": 0, "enterprise_project_id": "0", "access_vpc_id": "cb4a631d-demo-a8df-va86-ca3fa348c36c", "access_subnet_id": "f5741286-demo-a8df-va86-2c82bd9ee114", "ha_mode": "active-active" }, "request_id": "cd71cade-bfbd-410b-b672-4bfe46cfc311" }
For details, see Status Codes.