Skip to content

IPsec connections

All operations require authentication.

11 operationsv2/publicCloud/project
View as Markdown (opens in a new tab)
Agent setup

List IPsec connectionsAlpha

GET
/v2/publicCloud/project/{projectId}/vpn/gateway/{gatewayId}/connection

Returns the IPsec connections of the VPN gateway.

Path parameters

gatewayId
required
stringuuid

Gateway ID

projectId
required
string

Project ID

Headers

X-Pagination-Cursor
string

Pagination cursor

X-Pagination-Size
integer

Pagination size

Response

200Connection[]successful operation
checksum
read-only
string

Hash of the current target specification. Send it back in the update payload to detect concurrent changes.

createdAt
read-only
stringdate-time

Date and time the IPsec connection was created

currentState
read-only
ConnectionCurrentState

Observed state of the IPsec connection. Null while the IPsec connection is being created.

currentTasks
read-only
CurrentTask[]

Asynchronous operations ongoing on the IPsec connection

id
read-only
stringuuid

Unique identifier of the IPsec connection

resourceStatus
read-only
ResourceStatusEnum

Readiness of the IPsec connection: whether its observed state has converged to its target specification

ValuesCREATINGCREATION_PLANNEDDELETINGERROROUT_OF_SYNCREADYSUSPENDEDUNKNOWNUPDATING
targetSpec
read-only
ConnectionTargetSpec

Last target specification requested for the IPsec connection

updatedAt
read-only
stringdate-time

Date and time the IPsec connection was last updated

404objectError 404 response

Example uses gatewayId = 00000000-0000-0000-0000-000000000000, projectId = string

$ curl https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/vpn/gateway/{gatewayId}/connection \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
[ { "checksum": "string", "createdAt": "2024-01-01T12:00:00Z", "currentState": { "bgp": { "ecmpInboundEnabled": true, "localAsn": 0, "peerAsn": 0 }, "description": "string", "endpointGroup": { "distant": { "id": "00000000-0000-0000-0000-000000000000" }, "local": { "id": "00000000-0000-0000-0000-000000000000" } }, "name": "string", "routingMode": "BGP" }, "currentTasks": [ { "errors": [ { "message": "string" } ], "id": "00000000-0000-0000-0000-000000000000", "link": "string", "status": "ERROR", "type": "string" } ], "id": "00000000-0000-0000-0000-000000000000", "resourceStatus": "CREATING", "targetSpec": { "bgp": { "ecmpInboundEnabled": true, "localAsn": 0, "peerAsn": 0 }, "description": "string", "endpointGroup": { "distant": { "id": "00000000-0000-0000-0000-000000000000" }, "local": { "id": "00000000-0000-0000-0000-000000000000" } }, "name": "string", "routingMode": "BGP" }, "updatedAt": "2024-01-01T12:00:00Z" }]

Get an IPsec connectionAlpha

GET
/v2/publicCloud/project/{projectId}/vpn/gateway/{gatewayId}/connection/{connectionId}

Returns the IPsec connection and its observed state.

Path parameters

connectionId
required
stringuuid

Connection ID

gatewayId
required
stringuuid

Gateway ID

projectId
required
string

Project ID

Response

200Connectionsuccessful operation
checksum
read-only
string

Hash of the current target specification. Send it back in the update payload to detect concurrent changes.

createdAt
read-only
stringdate-time

Date and time the IPsec connection was created

currentState
read-only
ConnectionCurrentState

Observed state of the IPsec connection. Null while the IPsec connection is being created.

currentTasks
read-only
CurrentTask[]

Asynchronous operations ongoing on the IPsec connection

id
read-only
stringuuid

Unique identifier of the IPsec connection

resourceStatus
read-only
ResourceStatusEnum

Readiness of the IPsec connection: whether its observed state has converged to its target specification

ValuesCREATINGCREATION_PLANNEDDELETINGERROROUT_OF_SYNCREADYSUSPENDEDUNKNOWNUPDATING
targetSpec
read-only
ConnectionTargetSpec

Last target specification requested for the IPsec connection

updatedAt
read-only
stringdate-time

Date and time the IPsec connection was last updated

404objectError 404 response

Example uses connectionId = 00000000-0000-0000-0000-000000000000, gatewayId = 00000000-0000-0000-0000-000000000000, projectId = string

$ curl https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/vpn/gateway/{gatewayId}/connection/{connectionId} \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
{ "checksum": "string", "createdAt": "2024-01-01T12:00:00Z", "currentState": { "bgp": { "ecmpInboundEnabled": true, "localAsn": 0, "peerAsn": 0 }, "description": "string", "endpointGroup": { "distant": { "id": "00000000-0000-0000-0000-000000000000" }, "local": { "id": "00000000-0000-0000-0000-000000000000" } }, "name": "string", "routingMode": "BGP" }, "currentTasks": [ { "errors": [ { "message": "string" } ], "id": "00000000-0000-0000-0000-000000000000", "link": "string", "status": "ERROR", "type": "string" } ], "id": "00000000-0000-0000-0000-000000000000", "resourceStatus": "CREATING", "targetSpec": { "bgp": { "ecmpInboundEnabled": true, "localAsn": 0, "peerAsn": 0 }, "description": "string", "endpointGroup": { "distant": { "id": "00000000-0000-0000-0000-000000000000" }, "local": { "id": "00000000-0000-0000-0000-000000000000" } }, "name": "string", "routingMode": "BGP" }, "updatedAt": "2024-01-01T12:00:00Z"}

Create an IPsec connectionAlpha

POST
/v2/publicCloud/project/{projectId}/vpn/gateway/{gatewayId}/connection

Creates an IPsec connection on a VPN gateway: the endpoint groups of the networks on both sides, which must be in the region of the VPN gateway, and how their traffic is routed, shared by the one or two IPsec tunnels to the remote site. A VPN gateway holds several IPsec connections: the networks of their distant endpoint groups must not overlap, and its BGP connections share one local ASN. Creation applies immediately: the response already holds the result.

Path parameters

gatewayId
required
stringuuid

Gateway ID

projectId
required
string

Project ID

Request body (required)

targetSpec
required
ConnectionTargetSpec

Desired specification of the IPsec connection to create

Response

200Connectionsuccessful operation
checksum
read-only
string

Hash of the current target specification. Send it back in the update payload to detect concurrent changes.

createdAt
read-only
stringdate-time

Date and time the IPsec connection was created

currentState
read-only
ConnectionCurrentState

Observed state of the IPsec connection. Null while the IPsec connection is being created.

currentTasks
read-only
CurrentTask[]

Asynchronous operations ongoing on the IPsec connection

id
read-only
stringuuid

Unique identifier of the IPsec connection

resourceStatus
read-only
ResourceStatusEnum

Readiness of the IPsec connection: whether its observed state has converged to its target specification

ValuesCREATINGCREATION_PLANNEDDELETINGERROROUT_OF_SYNCREADYSUSPENDEDUNKNOWNUPDATING
targetSpec
read-only
ConnectionTargetSpec

Last target specification requested for the IPsec connection

updatedAt
read-only
stringdate-time

Date and time the IPsec connection was last updated

400objectError 400 response
404objectError 404 response
409objectError 409 response

Example uses gatewayId = 00000000-0000-0000-0000-000000000000, projectId = string

$ curl https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/vpn/gateway/{gatewayId}/connection \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
{ "checksum": "string", "createdAt": "2024-01-01T12:00:00Z", "currentState": { "bgp": { "ecmpInboundEnabled": true, "localAsn": 0, "peerAsn": 0 }, "description": "string", "endpointGroup": { "distant": { "id": "00000000-0000-0000-0000-000000000000" }, "local": { "id": "00000000-0000-0000-0000-000000000000" } }, "name": "string", "routingMode": "BGP" }, "currentTasks": [ { "errors": [ { "message": "string" } ], "id": "00000000-0000-0000-0000-000000000000", "link": "string", "status": "ERROR", "type": "string" } ], "id": "00000000-0000-0000-0000-000000000000", "resourceStatus": "CREATING", "targetSpec": { "bgp": { "ecmpInboundEnabled": true, "localAsn": 0, "peerAsn": 0 }, "description": "string", "endpointGroup": { "distant": { "id": "00000000-0000-0000-0000-000000000000" }, "local": { "id": "00000000-0000-0000-0000-000000000000" } }, "name": "string", "routingMode": "BGP" }, "updatedAt": "2024-01-01T12:00:00Z"}

Delete an IPsec connectionAlpha

DELETE
/v2/publicCloud/project/{projectId}/vpn/gateway/{gatewayId}/connection/{connectionId}

Deletes the IPsec connection. It is refused while it has IPsec tunnels. Deletion applies immediately: the response already holds the result.

Path parameters

connectionId
required
stringuuid

Connection ID

gatewayId
required
stringuuid

Gateway ID

projectId
required
string

Project ID

Response

200Connectionsuccessful operation
checksum
read-only
string

Hash of the current target specification. Send it back in the update payload to detect concurrent changes.

createdAt
read-only
stringdate-time

Date and time the IPsec connection was created

currentState
read-only
ConnectionCurrentState

Observed state of the IPsec connection. Null while the IPsec connection is being created.

currentTasks
read-only
CurrentTask[]

Asynchronous operations ongoing on the IPsec connection

id
read-only
stringuuid

Unique identifier of the IPsec connection

resourceStatus
read-only
ResourceStatusEnum

Readiness of the IPsec connection: whether its observed state has converged to its target specification

ValuesCREATINGCREATION_PLANNEDDELETINGERROROUT_OF_SYNCREADYSUSPENDEDUNKNOWNUPDATING
targetSpec
read-only
ConnectionTargetSpec

Last target specification requested for the IPsec connection

updatedAt
read-only
stringdate-time

Date and time the IPsec connection was last updated

404objectError 404 response
409objectError 409 response

Example uses connectionId = 00000000-0000-0000-0000-000000000000, gatewayId = 00000000-0000-0000-0000-000000000000, projectId = string

$ curl https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/vpn/gateway/{gatewayId}/connection/{connectionId} \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
{ "checksum": "string", "createdAt": "2024-01-01T12:00:00Z", "currentState": { "bgp": { "ecmpInboundEnabled": true, "localAsn": 0, "peerAsn": 0 }, "description": "string", "endpointGroup": { "distant": { "id": "00000000-0000-0000-0000-000000000000" }, "local": { "id": "00000000-0000-0000-0000-000000000000" } }, "name": "string", "routingMode": "BGP" }, "currentTasks": [ { "errors": [ { "message": "string" } ], "id": "00000000-0000-0000-0000-000000000000", "link": "string", "status": "ERROR", "type": "string" } ], "id": "00000000-0000-0000-0000-000000000000", "resourceStatus": "CREATING", "targetSpec": { "bgp": { "ecmpInboundEnabled": true, "localAsn": 0, "peerAsn": 0 }, "description": "string", "endpointGroup": { "distant": { "id": "00000000-0000-0000-0000-000000000000" }, "local": { "id": "00000000-0000-0000-0000-000000000000" } }, "name": "string", "routingMode": "BGP" }, "updatedAt": "2024-01-01T12:00:00Z"}

Update an IPsec connectionAlpha

PUT
/v2/publicCloud/project/{projectId}/vpn/gateway/{gatewayId}/connection/{connectionId}

The target specification replaces the previous one as a whole: a field left null goes back to its default. Send the checksum of the last GET to reject the update with a checksum mismatch when someone changed the resource in between. Only the name and the description can change: to change the networks or the routing, create another IPsec connection. The update applies immediately: the response already holds the result.

Path parameters

connectionId
required
stringuuid

Connection ID

gatewayId
required
stringuuid

Gateway ID

projectId
required
string

Project ID

Request body (required)

checksum
string

Optional concurrency-control checksum. When supplied, it must match the resource's current checksum or the request is rejected with a 409 checksum-mismatch conflict. When omitted or empty, the concurrency check is skipped and the write is forced (last-write-wins).

targetSpec
required
ConnectionUpdateTargetSpec

Desired specification of the IPsec connection. It replaces the previous one as a whole.

Response

200Connectionsuccessful operation
checksum
read-only
string

Hash of the current target specification. Send it back in the update payload to detect concurrent changes.

createdAt
read-only
stringdate-time

Date and time the IPsec connection was created

currentState
read-only
ConnectionCurrentState

Observed state of the IPsec connection. Null while the IPsec connection is being created.

currentTasks
read-only
CurrentTask[]

Asynchronous operations ongoing on the IPsec connection

id
read-only
stringuuid

Unique identifier of the IPsec connection

resourceStatus
read-only
ResourceStatusEnum

Readiness of the IPsec connection: whether its observed state has converged to its target specification

ValuesCREATINGCREATION_PLANNEDDELETINGERROROUT_OF_SYNCREADYSUSPENDEDUNKNOWNUPDATING
targetSpec
read-only
ConnectionTargetSpec

Last target specification requested for the IPsec connection

updatedAt
read-only
stringdate-time

Date and time the IPsec connection was last updated

400objectError 400 response
404objectError 404 response
409objectError 409 response

Example uses connectionId = 00000000-0000-0000-0000-000000000000, gatewayId = 00000000-0000-0000-0000-000000000000, projectId = string

$ curl https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/vpn/gateway/{gatewayId}/connection/{connectionId} \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
{ "checksum": "string", "createdAt": "2024-01-01T12:00:00Z", "currentState": { "bgp": { "ecmpInboundEnabled": true, "localAsn": 0, "peerAsn": 0 }, "description": "string", "endpointGroup": { "distant": { "id": "00000000-0000-0000-0000-000000000000" }, "local": { "id": "00000000-0000-0000-0000-000000000000" } }, "name": "string", "routingMode": "BGP" }, "currentTasks": [ { "errors": [ { "message": "string" } ], "id": "00000000-0000-0000-0000-000000000000", "link": "string", "status": "ERROR", "type": "string" } ], "id": "00000000-0000-0000-0000-000000000000", "resourceStatus": "CREATING", "targetSpec": { "bgp": { "ecmpInboundEnabled": true, "localAsn": 0, "peerAsn": 0 }, "description": "string", "endpointGroup": { "distant": { "id": "00000000-0000-0000-0000-000000000000" }, "local": { "id": "00000000-0000-0000-0000-000000000000" } }, "name": "string", "routingMode": "BGP" }, "updatedAt": "2024-01-01T12:00:00Z"}

List IPsec tunnelsAlpha

GET
/v2/publicCloud/project/{projectId}/vpn/gateway/{gatewayId}/connection/{connectionId}/tunnel

Returns the IPsec tunnels of the IPsec connection.

Path parameters

connectionId
required
stringuuid

Connection ID

gatewayId
required
stringuuid

Gateway ID

projectId
required
string

Project ID

Headers

X-Pagination-Cursor
string

Pagination cursor

X-Pagination-Size
integer

Pagination size

Response

200Tunnel[]successful operation
checksum
read-only
string

Hash of the current target specification. Send it back in the update payload to detect concurrent changes.

createdAt
read-only
stringdate-time

Date and time the IPsec tunnel was created

currentState
read-only
TunnelCurrentState

Observed state of the IPsec tunnel. Null while the IPsec tunnel is being created.

currentTasks
read-only
CurrentTask[]

Asynchronous operations ongoing on the IPsec tunnel

id
read-only
stringuuid

Unique identifier of the IPsec tunnel

resourceStatus
read-only
ResourceStatusEnum

Readiness of the IPsec tunnel: whether its observed state has converged to its target specification

ValuesCREATINGCREATION_PLANNEDDELETINGERROROUT_OF_SYNCREADYSUSPENDEDUNKNOWNUPDATING
targetSpec
read-only
TunnelReadTargetSpec

Last target specification requested for the IPsec tunnel

updatedAt
read-only
stringdate-time

Date and time the IPsec tunnel was last updated

404objectError 404 response

Example uses connectionId = 00000000-0000-0000-0000-000000000000, gatewayId = 00000000-0000-0000-0000-000000000000, projectId = string

$ curl https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/vpn/gateway/{gatewayId}/connection/{connectionId}/tunnel \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
[ { "checksum": "string", "createdAt": "2024-01-01T12:00:00Z", "currentState": { "bgp": { "peerIp": "192.0.2.0", "tunnelIp": "192.0.2.0/24" }, "description": "string", "dpd": { "action": "CLEAR", "interval": 0 }, "enabled": true, "ike": { "id": "00000000-0000-0000-0000-000000000000" }, "initiator": "BI_DIRECTIONAL", "ipsec": { "id": "00000000-0000-0000-0000-000000000000" }, "localId": "string", "mtu": 0, "name": "string", "operatingStatus": "DISABLED", "peer": { "id": "string", "ip": "192.0.2.0" }, "preSharedKey": "string", "priority": 0, "provisioningStatus": "ACTIVE" }, "currentTasks": [ { "errors": [ { "message": "string" } ], "id": "00000000-0000-0000-0000-000000000000", "link": "string", "status": "ERROR", "type": "string" } ], "id": "00000000-0000-0000-0000-000000000000", "resourceStatus": "CREATING", "targetSpec": { "bgp": { "peerIp": "192.0.2.0", "tunnelIp": "192.0.2.0/24" }, "description": "string", "dpd": { "action": "CLEAR", "interval": 0 }, "enabled": true, "ike": { "id": "00000000-0000-0000-0000-000000000000" }, "initiator": "BI_DIRECTIONAL", "ipsec": { "id": "00000000-0000-0000-0000-000000000000" }, "localId": "string", "mtu": 0, "name": "string", "peer": { "id": "string", "ip": "192.0.2.0" }, "priority": 0 }, "updatedAt": "2024-01-01T12:00:00Z" }]

Get an IPsec tunnelAlpha

GET
/v2/publicCloud/project/{projectId}/vpn/gateway/{gatewayId}/connection/{connectionId}/tunnel/{tunnelId}

Returns the IPsec tunnel and its observed state. currentState.preSharedKey holds the key in clear text only for a caller with the optional vpn/gateway/connection/tunnel/preSharedKey/get IAM action. It is null otherwise.

Path parameters

connectionId
required
stringuuid

Connection ID

gatewayId
required
stringuuid

Gateway ID

projectId
required
string

Project ID

tunnelId
required
stringuuid

Tunnel ID

Response

200Tunnelsuccessful operation
checksum
read-only
string

Hash of the current target specification. Send it back in the update payload to detect concurrent changes.

createdAt
read-only
stringdate-time

Date and time the IPsec tunnel was created

currentState
read-only
TunnelCurrentState

Observed state of the IPsec tunnel. Null while the IPsec tunnel is being created.

currentTasks
read-only
CurrentTask[]

Asynchronous operations ongoing on the IPsec tunnel

id
read-only
stringuuid

Unique identifier of the IPsec tunnel

resourceStatus
read-only
ResourceStatusEnum

Readiness of the IPsec tunnel: whether its observed state has converged to its target specification

ValuesCREATINGCREATION_PLANNEDDELETINGERROROUT_OF_SYNCREADYSUSPENDEDUNKNOWNUPDATING
targetSpec
read-only
TunnelReadTargetSpec

Last target specification requested for the IPsec tunnel

updatedAt
read-only
stringdate-time

Date and time the IPsec tunnel was last updated

404objectError 404 response

Example uses connectionId = 00000000-0000-0000-0000-000000000000, gatewayId = 00000000-0000-0000-0000-000000000000, projectId = string, tunnelId = 00000000-0000-0000-0000-000000000000

$ curl https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/vpn/gateway/{gatewayId}/connection/{connectionId}/tunnel/{tunnelId} \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
{ "checksum": "string", "createdAt": "2024-01-01T12:00:00Z", "currentState": { "bgp": { "peerIp": "192.0.2.0", "tunnelIp": "192.0.2.0/24" }, "description": "string", "dpd": { "action": "CLEAR", "interval": 0 }, "enabled": true, "ike": { "id": "00000000-0000-0000-0000-000000000000" }, "initiator": "BI_DIRECTIONAL", "ipsec": { "id": "00000000-0000-0000-0000-000000000000" }, "localId": "string", "mtu": 0, "name": "string", "operatingStatus": "DISABLED", "peer": { "id": "string", "ip": "192.0.2.0" }, "preSharedKey": "string", "priority": 0, "provisioningStatus": "ACTIVE" }, "currentTasks": [ { "errors": [ { "message": "string" } ], "id": "00000000-0000-0000-0000-000000000000", "link": "string", "status": "ERROR", "type": "string" } ], "id": "00000000-0000-0000-0000-000000000000", "resourceStatus": "CREATING", "targetSpec": { "bgp": { "peerIp": "192.0.2.0", "tunnelIp": "192.0.2.0/24" }, "description": "string", "dpd": { "action": "CLEAR", "interval": 0 }, "enabled": true, "ike": { "id": "00000000-0000-0000-0000-000000000000" }, "initiator": "BI_DIRECTIONAL", "ipsec": { "id": "00000000-0000-0000-0000-000000000000" }, "localId": "string", "mtu": 0, "name": "string", "peer": { "id": "string", "ip": "192.0.2.0" }, "priority": 0 }, "updatedAt": "2024-01-01T12:00:00Z"}

Create an IPsec tunnelAlpha

POST
/v2/publicCloud/project/{projectId}/vpn/gateway/{gatewayId}/connection/{connectionId}/tunnel

Creates an IPsec tunnel in the IPsec connection. A connection holds at most two tunnels, which fail over to each other. The VPN gateway of the connection must have a public address of the family of the peer. The IKE and IPsec policies must be in the region of the VPN gateway. Refused while the VPN gateway of the connection is being created, updated or deleted: retry once it is READY or ERROR. Creation is asynchronous: follow resourceStatus and currentTasks. READY means the tunnel is configured on the VPN gateway, not that it is up.

Path parameters

connectionId
required
stringuuid

Connection ID

gatewayId
required
stringuuid

Gateway ID

projectId
required
string

Project ID

Request body (required)

targetSpec
required
TunnelTargetSpec

Desired specification of the IPsec tunnel to create

Response

200Tunnelsuccessful operation
checksum
read-only
string

Hash of the current target specification. Send it back in the update payload to detect concurrent changes.

createdAt
read-only
stringdate-time

Date and time the IPsec tunnel was created

currentState
read-only
TunnelCurrentState

Observed state of the IPsec tunnel. Null while the IPsec tunnel is being created.

currentTasks
read-only
CurrentTask[]

Asynchronous operations ongoing on the IPsec tunnel

id
read-only
stringuuid

Unique identifier of the IPsec tunnel

resourceStatus
read-only
ResourceStatusEnum

Readiness of the IPsec tunnel: whether its observed state has converged to its target specification

ValuesCREATINGCREATION_PLANNEDDELETINGERROROUT_OF_SYNCREADYSUSPENDEDUNKNOWNUPDATING
targetSpec
read-only
TunnelReadTargetSpec

Last target specification requested for the IPsec tunnel

updatedAt
read-only
stringdate-time

Date and time the IPsec tunnel was last updated

400objectError 400 response
404objectError 404 response
409objectError 409 response

Example uses connectionId = 00000000-0000-0000-0000-000000000000, gatewayId = 00000000-0000-0000-0000-000000000000, projectId = string

$ curl https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/vpn/gateway/{gatewayId}/connection/{connectionId}/tunnel \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
{ "checksum": "string", "createdAt": "2024-01-01T12:00:00Z", "currentState": { "bgp": { "peerIp": "192.0.2.0", "tunnelIp": "192.0.2.0/24" }, "description": "string", "dpd": { "action": "CLEAR", "interval": 0 }, "enabled": true, "ike": { "id": "00000000-0000-0000-0000-000000000000" }, "initiator": "BI_DIRECTIONAL", "ipsec": { "id": "00000000-0000-0000-0000-000000000000" }, "localId": "string", "mtu": 0, "name": "string", "operatingStatus": "DISABLED", "peer": { "id": "string", "ip": "192.0.2.0" }, "preSharedKey": "string", "priority": 0, "provisioningStatus": "ACTIVE" }, "currentTasks": [ { "errors": [ { "message": "string" } ], "id": "00000000-0000-0000-0000-000000000000", "link": "string", "status": "ERROR", "type": "string" } ], "id": "00000000-0000-0000-0000-000000000000", "resourceStatus": "CREATING", "targetSpec": { "bgp": { "peerIp": "192.0.2.0", "tunnelIp": "192.0.2.0/24" }, "description": "string", "dpd": { "action": "CLEAR", "interval": 0 }, "enabled": true, "ike": { "id": "00000000-0000-0000-0000-000000000000" }, "initiator": "BI_DIRECTIONAL", "ipsec": { "id": "00000000-0000-0000-0000-000000000000" }, "localId": "string", "mtu": 0, "name": "string", "peer": { "id": "string", "ip": "192.0.2.0" }, "priority": 0 }, "updatedAt": "2024-01-01T12:00:00Z"}

Delete an IPsec tunnelAlpha

DELETE
/v2/publicCloud/project/{projectId}/vpn/gateway/{gatewayId}/connection/{connectionId}/tunnel/{tunnelId}

Deletes the IPsec tunnel and tears it down. Refused while the VPN gateway of the connection is being created, updated or deleted: retry once it is READY or ERROR. Deletion is asynchronous: the tunnel stays listed with resourceStatus DELETING until it is gone.

Path parameters

connectionId
required
stringuuid

Connection ID

gatewayId
required
stringuuid

Gateway ID

projectId
required
string

Project ID

tunnelId
required
stringuuid

Tunnel ID

Response

200Tunnelsuccessful operation
checksum
read-only
string

Hash of the current target specification. Send it back in the update payload to detect concurrent changes.

createdAt
read-only
stringdate-time

Date and time the IPsec tunnel was created

currentState
read-only
TunnelCurrentState

Observed state of the IPsec tunnel. Null while the IPsec tunnel is being created.

currentTasks
read-only
CurrentTask[]

Asynchronous operations ongoing on the IPsec tunnel

id
read-only
stringuuid

Unique identifier of the IPsec tunnel

resourceStatus
read-only
ResourceStatusEnum

Readiness of the IPsec tunnel: whether its observed state has converged to its target specification

ValuesCREATINGCREATION_PLANNEDDELETINGERROROUT_OF_SYNCREADYSUSPENDEDUNKNOWNUPDATING
targetSpec
read-only
TunnelReadTargetSpec

Last target specification requested for the IPsec tunnel

updatedAt
read-only
stringdate-time

Date and time the IPsec tunnel was last updated

404objectError 404 response
409objectError 409 response

Example uses connectionId = 00000000-0000-0000-0000-000000000000, gatewayId = 00000000-0000-0000-0000-000000000000, projectId = string, tunnelId = 00000000-0000-0000-0000-000000000000

$ curl https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/vpn/gateway/{gatewayId}/connection/{connectionId}/tunnel/{tunnelId} \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
{ "checksum": "string", "createdAt": "2024-01-01T12:00:00Z", "currentState": { "bgp": { "peerIp": "192.0.2.0", "tunnelIp": "192.0.2.0/24" }, "description": "string", "dpd": { "action": "CLEAR", "interval": 0 }, "enabled": true, "ike": { "id": "00000000-0000-0000-0000-000000000000" }, "initiator": "BI_DIRECTIONAL", "ipsec": { "id": "00000000-0000-0000-0000-000000000000" }, "localId": "string", "mtu": 0, "name": "string", "operatingStatus": "DISABLED", "peer": { "id": "string", "ip": "192.0.2.0" }, "preSharedKey": "string", "priority": 0, "provisioningStatus": "ACTIVE" }, "currentTasks": [ { "errors": [ { "message": "string" } ], "id": "00000000-0000-0000-0000-000000000000", "link": "string", "status": "ERROR", "type": "string" } ], "id": "00000000-0000-0000-0000-000000000000", "resourceStatus": "CREATING", "targetSpec": { "bgp": { "peerIp": "192.0.2.0", "tunnelIp": "192.0.2.0/24" }, "description": "string", "dpd": { "action": "CLEAR", "interval": 0 }, "enabled": true, "ike": { "id": "00000000-0000-0000-0000-000000000000" }, "initiator": "BI_DIRECTIONAL", "ipsec": { "id": "00000000-0000-0000-0000-000000000000" }, "localId": "string", "mtu": 0, "name": "string", "peer": { "id": "string", "ip": "192.0.2.0" }, "priority": 0 }, "updatedAt": "2024-01-01T12:00:00Z"}

Update an IPsec tunnelAlpha

PUT
/v2/publicCloud/project/{projectId}/vpn/gateway/{gatewayId}/connection/{connectionId}/tunnel/{tunnelId}

The target specification replaces the previous one as a whole: peer, priority, enabled, dpd, mtu and initiator must be sent, and bgp too when the connection routingMode is BGP. A description left null is removed, and a localId left null goes back to the public address of the VPN gateway. Send the checksum of the last GET to reject the update with a checksum mismatch when someone changed the resource in between. The pre-shared key is the exception: null keeps the current one. The tunnel is configured again with the new settings. Refused while the VPN gateway of the connection is being created, updated or deleted: retry once it is READY or ERROR. The update is asynchronous: follow resourceStatus and currentTasks.

Path parameters

connectionId
required
stringuuid

Connection ID

gatewayId
required
stringuuid

Gateway ID

projectId
required
string

Project ID

tunnelId
required
stringuuid

Tunnel ID

Request body (required)

checksum
string

Optional concurrency-control checksum. When supplied, it must match the resource's current checksum or the request is rejected with a 409 checksum-mismatch conflict. When omitted or empty, the concurrency check is skipped and the write is forced (last-write-wins).

targetSpec
required
TunnelUpdateTargetSpec

Desired specification of the IPsec tunnel. It replaces the previous one as a whole.

Response

200Tunnelsuccessful operation
checksum
read-only
string

Hash of the current target specification. Send it back in the update payload to detect concurrent changes.

createdAt
read-only
stringdate-time

Date and time the IPsec tunnel was created

currentState
read-only
TunnelCurrentState

Observed state of the IPsec tunnel. Null while the IPsec tunnel is being created.

currentTasks
read-only
CurrentTask[]

Asynchronous operations ongoing on the IPsec tunnel

id
read-only
stringuuid

Unique identifier of the IPsec tunnel

resourceStatus
read-only
ResourceStatusEnum

Readiness of the IPsec tunnel: whether its observed state has converged to its target specification

ValuesCREATINGCREATION_PLANNEDDELETINGERROROUT_OF_SYNCREADYSUSPENDEDUNKNOWNUPDATING
targetSpec
read-only
TunnelReadTargetSpec

Last target specification requested for the IPsec tunnel

updatedAt
read-only
stringdate-time

Date and time the IPsec tunnel was last updated

400objectError 400 response
404objectError 404 response
409objectError 409 response

Example uses connectionId = 00000000-0000-0000-0000-000000000000, gatewayId = 00000000-0000-0000-0000-000000000000, projectId = string, tunnelId = 00000000-0000-0000-0000-000000000000

$ curl https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/vpn/gateway/{gatewayId}/connection/{connectionId}/tunnel/{tunnelId} \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
{ "checksum": "string", "createdAt": "2024-01-01T12:00:00Z", "currentState": { "bgp": { "peerIp": "192.0.2.0", "tunnelIp": "192.0.2.0/24" }, "description": "string", "dpd": { "action": "CLEAR", "interval": 0 }, "enabled": true, "ike": { "id": "00000000-0000-0000-0000-000000000000" }, "initiator": "BI_DIRECTIONAL", "ipsec": { "id": "00000000-0000-0000-0000-000000000000" }, "localId": "string", "mtu": 0, "name": "string", "operatingStatus": "DISABLED", "peer": { "id": "string", "ip": "192.0.2.0" }, "preSharedKey": "string", "priority": 0, "provisioningStatus": "ACTIVE" }, "currentTasks": [ { "errors": [ { "message": "string" } ], "id": "00000000-0000-0000-0000-000000000000", "link": "string", "status": "ERROR", "type": "string" } ], "id": "00000000-0000-0000-0000-000000000000", "resourceStatus": "CREATING", "targetSpec": { "bgp": { "peerIp": "192.0.2.0", "tunnelIp": "192.0.2.0/24" }, "description": "string", "dpd": { "action": "CLEAR", "interval": 0 }, "enabled": true, "ike": { "id": "00000000-0000-0000-0000-000000000000" }, "initiator": "BI_DIRECTIONAL", "ipsec": { "id": "00000000-0000-0000-0000-000000000000" }, "localId": "string", "mtu": 0, "name": "string", "peer": { "id": "string", "ip": "192.0.2.0" }, "priority": 0 }, "updatedAt": "2024-01-01T12:00:00Z"}

Run an action on an IPsec tunnelAlpha

POST
/v2/publicCloud/project/{projectId}/vpn/gateway/{gatewayId}/connection/{connectionId}/tunnel/{tunnelId}/action

Runs an action on the IPsec tunnel. The only action is REGENERATE_PRE_SHARED_KEY. It gives the tunnel a new random pre-shared key. Read it in currentState.preSharedKey of the tunnel GET, and configure it on the remote device. The tunnel stays down until both ends use the new key. Refused while the VPN gateway of the connection or the tunnel is being created, updated or deleted. The action is asynchronous: follow resourceStatus and currentTasks.

Path parameters

connectionId
required
stringuuid

Connection ID

gatewayId
required
stringuuid

Gateway ID

projectId
required
string

Project ID

tunnelId
required
stringuuid

Tunnel ID

Request body (required)

checksum
string

Checksum of the last GET. When given, the action is rejected with a checksum mismatch if the tunnel changed in between. When null or empty, the check is skipped.

type
required
TunnelActionTypeEnum

Action to run

ValuesREGENERATE_PRE_SHARED_KEY

Response

200Tunnelsuccessful operation
checksum
read-only
string

Hash of the current target specification. Send it back in the update payload to detect concurrent changes.

createdAt
read-only
stringdate-time

Date and time the IPsec tunnel was created

currentState
read-only
TunnelCurrentState

Observed state of the IPsec tunnel. Null while the IPsec tunnel is being created.

currentTasks
read-only
CurrentTask[]

Asynchronous operations ongoing on the IPsec tunnel

id
read-only
stringuuid

Unique identifier of the IPsec tunnel

resourceStatus
read-only
ResourceStatusEnum

Readiness of the IPsec tunnel: whether its observed state has converged to its target specification

ValuesCREATINGCREATION_PLANNEDDELETINGERROROUT_OF_SYNCREADYSUSPENDEDUNKNOWNUPDATING
targetSpec
read-only
TunnelReadTargetSpec

Last target specification requested for the IPsec tunnel

updatedAt
read-only
stringdate-time

Date and time the IPsec tunnel was last updated

400objectError 400 response
404objectError 404 response
409objectError 409 response

Example uses connectionId = 00000000-0000-0000-0000-000000000000, gatewayId = 00000000-0000-0000-0000-000000000000, projectId = string, tunnelId = 00000000-0000-0000-0000-000000000000

$ curl https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/vpn/gateway/{gatewayId}/connection/{connectionId}/tunnel/{tunnelId}/action \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
{ "checksum": "string", "createdAt": "2024-01-01T12:00:00Z", "currentState": { "bgp": { "peerIp": "192.0.2.0", "tunnelIp": "192.0.2.0/24" }, "description": "string", "dpd": { "action": "CLEAR", "interval": 0 }, "enabled": true, "ike": { "id": "00000000-0000-0000-0000-000000000000" }, "initiator": "BI_DIRECTIONAL", "ipsec": { "id": "00000000-0000-0000-0000-000000000000" }, "localId": "string", "mtu": 0, "name": "string", "operatingStatus": "DISABLED", "peer": { "id": "string", "ip": "192.0.2.0" }, "preSharedKey": "string", "priority": 0, "provisioningStatus": "ACTIVE" }, "currentTasks": [ { "errors": [ { "message": "string" } ], "id": "00000000-0000-0000-0000-000000000000", "link": "string", "status": "ERROR", "type": "string" } ], "id": "00000000-0000-0000-0000-000000000000", "resourceStatus": "CREATING", "targetSpec": { "bgp": { "peerIp": "192.0.2.0", "tunnelIp": "192.0.2.0/24" }, "description": "string", "dpd": { "action": "CLEAR", "interval": 0 }, "enabled": true, "ike": { "id": "00000000-0000-0000-0000-000000000000" }, "initiator": "BI_DIRECTIONAL", "ipsec": { "id": "00000000-0000-0000-0000-000000000000" }, "localId": "string", "mtu": 0, "name": "string", "peer": { "id": "string", "ip": "192.0.2.0" }, "priority": 0 }, "updatedAt": "2024-01-01T12:00:00Z"}