Update a VPN Endpoint
/vpnendpoint/{name}
After you've configured your VPN connection, you can update the connection to enable or disable the VPN tunnel, or to change other connection details.
Required Role: To complete this task, you must have the Compute_Operations
role. If this role isn't assigned to you or you're not sure, then ask your system administrator to ensure that the role is assigned to you in Oracle Cloud My Services. See Modifying User Roles in Managing and Monitoring Oracle Cloud.
Request
- application/oracle-compute-v3+json
-
name: string
Two-part name of the object (
/Compute-acme/object
)
-
Cookie: string
The Cookie: header must be included with every request to the service. It must be set to the value of the set-cookie header in the response received to the POST /authenticate/ call.
object
-
customer_vpn_gateway:
string
The peer address of customers VPN device
-
enabled(optional):
boolean
Enables the VPN endpoint. To start a VPN connection, set to
true
. A connection is established immediately, if possible. If you do not specify this option, the VPN endpoint is disabled and the connection is not established. -
name:
string
Three-part name of the object (
/Compute-acme/object
). -
psk:
string
Pre-shared VPN key. Enter the pre-shared key. This must be the same key that you provided when you requested the service. This secret key is shared between your network gateway and the Oracle Cloud network for authentication. Specify the full path and name of the text file that contains the pre-shared key. Ensure that the permission level of the text file is set to 400. The pre-shared VPN key must not exceed 256 characters.
-
reachable_routes:
array reachable_routes
Specify a list of customers subnets (CIDR prefixes) that are reachable through this VPN tunnel. You can specify a maximum of 20 IP subnet addresses. Specify IPv4 addresses in dot-decimal notation with or without mask.
array
Response
- application/oracle-compute-v3+json
200 Response
-
set-cookie: string
The cookie value is returned if the session is extended
object
-
customer_vpn_gateway(optional):
string
IP address of the VPN gateway in your data center through which you want to connect to the Oracle Cloud VPN gateway.
-
enabled(optional):
boolean
true
indicates that the VPN endpoint is enabled and a connection is established immediately, if possible. -
name(optional):
string
Two-part name of the object (
/Compute-acme/object
) -
psk(optional):
string
Pre-shared VPN key.
-
reachable_routes(optional):
array reachable_routes
List of subnets (CIDR prefixes) that are reachable through this VPN tunnel.
-
status(optional):
string
Current status of the VPN tunnel.
-
status_desc(optional):
string
Describes the current status of the VPN tunnel.
-
uri(optional):
string
Uniform Resource Identifier
-
vpn_statistics(optional):
object vpn_statistics
Additional Properties Allowed: additionalPropertiesStatistics of VPN tunnels
array
object
object
Examples
cURL Command
The following example shows how to update a VPN endpoint, /Compute-acme/vpn-to-LA
, by submitting a PUT request on the REST resource using cURL. For more information about cURL, see Use cURL.
Enter the command on a single line. Line breaks are used in this example for readability.
curl -i -X PUT -H "Cookie: $COMPUTE_COOKIE" -H "Content-Type: application/oracle-compute-v3+json" -H "Accept: application/oracle-compute-v3+json" -d "@requestbody.json" https://api-z999.compute.us0.oraclecloud.com/vpnendpoint/Compute-acme/vpn-to-LA
-
COMPUTE_COOKIE
is the name of the variable in which you stored the authentication cookie earlier. For information about retrieving the authentication cookie and storing it in a variable, see Authentication. -
api-z999.compute.us0.oraclecloud.com
is an example REST endpoint URL. Change this value to the REST endpoint URL of your Compute Classic site. For information about finding out REST endpoint URL for your site, see Send Requests. -
acme
is an example value. Replaceacme
with the identity domain ID of your Compute Classic account.
Example of Request Body
The following shows an example of the request body content in the requestbody.json
file to update a VPN enpoint and enable it.
{ "psk": "********", "name": "/Compute-acme/vpn-to-LA", "reachable_routes": "192.168.155.0/24", "enabled": true, "customer_vpn_gateway": "192.168.111.2" }
Example of Response Body
The following example shows the response body in JSON format when you update a VPN endpoint.
Some lines may be truncated with ellipses (...) for readability.
{ "status": "UP", "psk": "********", "name": "/Compute-acme/vpn-to-LA", "reachable_routes": "192.168.155.0/24", "enabled": true, "uri": "http://api.oc.example.com/vpnendpoint/Compute-acme/vpn-to-LA", "status_desc": "", "customer_vpn_gateway": "192.168.111.2" }