This API is used to update a VPN connection with a specified connection ID.
For details, see Calling APIs.
PUT /v5/{project_id}/vpn-connection/{vpn_connection_id}
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. |
vpn_connection_id |
String |
Yes |
Specifies a VPN connection ID. |
Parameter |
Type |
Mandatory |
Description |
|---|---|---|---|
vpn_connection |
Yes |
Specifies the VPN connection object. |
Parameter |
Type |
Mandatory |
Description |
|---|---|---|---|
name |
String |
No |
|
cgw_id |
String |
No |
|
peer_subnets |
Array of String |
No |
|
tunnel_local_address |
String |
No |
|
tunnel_peer_address |
String |
No |
|
enable_hub |
Boolean |
No |
|
psk |
String |
No |
|
policy_rules |
Array of PolicyRule object |
No |
Specifies IPv4 policy rules. A maximum of five policy rules can be specified. This parameter is mandatory only when style is set to policy and ip_version of the VPN gateway is set to ipv4. |
ikepolicy |
UpdateIkePolicy object |
No |
Specifies the IKE policy object. |
ipsecpolicy |
UpdateIpsecPolicy object |
No |
Specifies the IPsec policy object. |
Parameter |
Type |
Mandatory |
Description |
|---|---|---|---|
source |
String |
No |
|
destination |
Array of String |
No |
Parameter |
Type |
Mandatory |
Description |
|---|---|---|---|
ike_version |
String |
No |
|
phase1_negotiation_mode |
String |
No |
|
authentication_algorithm |
String |
No |
|
encryption_algorithm |
String |
No |
|
dh_group |
String |
No |
|
lifetime_seconds |
Integer |
No |
|
local_id_type |
String |
No |
|
local_id |
String |
No |
|
peer_id_type |
String |
No |
|
peer_id |
String |
No |
|
dpd |
UpdateDpd object |
No |
Specifies the DPD object. |
Parameter |
Type |
Mandatory |
Description |
|---|---|---|---|
timeout |
Integer |
No |
|
interval |
Integer |
No |
|
msg |
String |
No |
Parameter |
Type |
Mandatory |
Description |
|---|---|---|---|
authentication_algorithm |
String |
No |
|
encryption_algorithm |
String |
No |
|
pfs |
String |
No |
|
transform_protocol |
String |
No |
|
lifetime_seconds |
Integer |
No |
|
encapsulation_mode |
String |
No |
PUT https://{Endpoint}/v5/{project_id}/vpn-connection/{vpn_connection_id}
{
"vpn_connection": {
"peer_subnets": [
"192.168.1.0/24"
]
}
}
PUT https://{Endpoint}/v5/{project_id}/vpn-connection/{vpn_connection_id}
{
"vpn_connection": {
"policy_rules": [{
"source": "10.0.0.0/24",
"destination": [
"192.168.1.0/24"
]
}]
}
}
PUT https://{Endpoint}/v5/{project_id}/vpn-connection/{vpn_connection_id}
{
"vpn_connection": {
"ikepolicy": {
"lifetime_seconds": 3600
},
"ipsecpolicy": {
"lifetime_seconds": 3600
}
}
}
PUT https://{Endpoint}/v5/{project_id}/vpn-connection/{vpn_connection_id}
{
"vpn_connection": {
"name": "vpn_connection_name"
}
}
Returned status code 200: successful operation
Parameter |
Type |
Description |
|---|---|---|
vpn_connection |
ResponseVpnConnection object |
Specifies the VPN connection object. |
request_id |
String |
Specifies a request ID. |
Parameter |
Type |
Description |
|---|---|---|
id |
String |
|
name |
String |
|
vgw_id |
String |
|
vgw_ip |
String |
|
style |
String |
|
cgw_id |
String |
|
peer_subnets |
Array of String |
Specifies an IPv4 customer subnet. This parameter is not returned when attachment_type of the VPN gateway is set to ER and style is set to BGP or POLICY. |
tunnel_local_address |
String |
Specifies the tunnel interface address configured on the VPN gateway in route-based mode. This parameter is valid only when style is STATIC or BGP. |
tunnel_peer_address |
String |
Specifies the tunnel interface address configured on the customer gateway device in route-based mode. This parameter is valid only when style is STATIC or BGP. |
enable_nqa |
Boolean |
|
enable_hub |
Boolean |
|
policy_rules |
Array of PolicyRule objects |
Specifies IPv4 policy rules, which are returned only when style is set to POLICY and ip_version of the VPN gateway is set to ipv4. |
ikepolicy |
IkePolicy object |
Specifies the IKE policy object. |
ipsecpolicy |
IpsecPolicy object |
Specifies the IPsec policy object. |
created_at |
String |
|
updated_at |
String |
|
enterprise_project_id |
String |
|
connection_monitor_id |
String |
|
ha_role |
String |
|
tags |
Array of VpnResourceTag objects |
Specifies a tag list. |
eip_id |
String |
|
type |
String |
|
route_mode |
String |
Parameter |
Type |
Description |
|---|---|---|
source |
String |
Specifies a source CIDR block. |
destination |
Array of String |
Specifies a destination CIDR block. An example IPv4 CIDR block is 192.168.52.0/24. A maximum of 50 destination CIDR blocks can be returned for each policy rule. |
Parameter |
Type |
Description |
|---|---|---|
ike_version |
String |
|
phase1_negotiation_mode |
String |
|
authentication_algorithm |
String |
|
encryption_algorithm |
String |
|
dh_group |
String |
|
authentication_method |
String |
|
lifetime_seconds |
Integer |
|
local_id_type |
String |
|
local_id |
String |
Specifies the local ID. When local_id_type is set to ip, the local ID specified when the VPN connection is created or updated is returned. If no local ID is specified, the VPN gateway IP address corresponding to the VPN connection is returned. |
peer_id_type |
String |
|
peer_id |
String |
Specifies the peer ID. When peer_id_type is set to ip, the peer ID specified when the VPN connection is created or updated is returned. If no peer ID is specified, the IP address of the customer gateway is returned. |
dpd |
Dpd object |
Specifies the DPD object. |
Parameter |
Type |
Description |
|---|---|---|
timeout |
Integer |
|
interval |
Integer |
|
msg |
String |
Parameter |
Type |
Description |
|---|---|---|
authentication_algorithm |
String |
|
encryption_algorithm |
String |
|
pfs |
String |
Specifies the DH key group used by PFS.
|
transform_protocol |
String |
|
lifetime_seconds |
Integer |
|
encapsulation_mode |
String |
Parameter |
Type |
Description |
|---|---|---|
key |
String |
|
value |
String |
|
{
"vpn_connection": {
"id": "98c5af8a-demo-a8df-va86-ae2280a6f4c3",
"name": "vpn-1655",
"vgw_id": "b32d91a4-demo-a8df-va86-e907174eb11d",
"vgw_ip": "0c464dad-demo-a8df-va86-c22bb0eb0bde",
"style": "POLICY",
"cgw_id": "5247ae10-demo-a8df-va86-dd36659a7f5d",
"peer_subnets": ["192.168.1.0/24"],
"tunnel_local_address": "169.254.56.225/30",
"tunnel_peer_address": "169.254.56.226/30",
"policy_rules": [{
"source": "10.0.0.0/24",
"destination": [
"192.168.1.0/24"
]
}],
"ikepolicy": {
"ike_version": "v2",
"authentication_algorithm": "sha2-256",
"encryption_algorithm": "aes-128",
"dh_group": "group15",
"authentication_method": "pre-share",
"lifetime_seconds": 86400,
"local_id_type": "ip",
"local_id": "10.***.***.134",
"peer_id_type": "ip",
"peer_id": "88.***.***.164",
"dpd": {
"timeout": 15,
"interval": 30,
"msg": "seq-hash-notify"
}
},
"ipsecpolicy": {
"authentication_algorithm": "sha2-256",
"encryption_algorithm": "aes-128",
"pfs": "group15",
"transform_protocol": "esp",
"lifetime_seconds": 3600,
"encapsulation_mode": "tunnel"
},
"created_at": "2025-06-26T13:41:34.626Z",
"updated_at": "2025-06-26T13:41:34.626Z",
"enterprise_project_id": "0",
"ha_role": "master"
},
"request_id": "f91082d4-6d49-479c-ad1d-4e552a9f5cae"
}
{
"error_code": "VPN.0001",
"error_msg": "invalid request: ILLEGAL not allowed update vpnConnection",
"request_id": "8c833634-4560-7897-7740-a7462f5bcbd4"
}
For details, see Status Codes.