Creating VPN services

POST /v2.0/vpn/vpnservices

Create a VPN service.

The service is associated with a router. After you create the service, it can contain multiple VPN connections.

An optional flavor_id attribute can be passed to enable dynamic selection of an appropriate provider if configured by the operator. It is only available when vpn-flavors extension is enabled. The basic selection algorithm chooses the provider in the first service profile currently associated with flavor. This option can only be set in POST operation.

Source: https://docs.openstack.org/api-ref/network/v2/index.html?expanded=create-vpn-service-detail#create-vpn-service

Request

Name In Type Description
vpnservice body object A vpnservice object.
router_id path string The ID of the router.
name (Optional) body string A human-readable name of the resource. Default is an empty string.
description (Optional) body string A human-readable description for the resource. Default is an empty string.
admin_state_up body boolean The administrative state of the resource, which is up (true) or down (false).
subnet_id (Optional) body string If you specify only a subnet UUID, the networking service allocates an available IP from that subnet to the port. If you specify both a subnet UUID and an IP address, the networking service tries to allocate the address to the port.
tenant_id body string The ID of the project.
project_id body string The ID of the project.
flavor_id (Optional) body string The ID of the flavor.

Example

# curl -ks -H 'Content-Type: application/json' -H 'X-Auth-Token: gAAAAA<...>' -d '\
{
    "vpnservice": {
        "subnet_id": null,
        "router_id": "66e3b16c-8ce5-40fb-bb49-ab6d8dc3f2aa",
        "name": "myservice",
        "admin_state_up": true,
        "flavor_id": null
    }
}' https://<node_IP_addr>:9696/v2.0/vpn/vpnservices

Response

Parameters

Name In Type Description
vpnservice body object A vpnservice object.
router_id path string The ID of the router.
status body string Indicates whether the IPsec VPN service is currently operational. Values are ACTIVE, DOWN, BUILD, ERROR, PENDING_CREATE, PENDING_UPDATE, or PENDING_DELETE.
name (Optional) body string A human-readable name of the resource. Default is an empty string.
description (Optional) body string A human-readable description for the resource. Default is an empty string.
external_v4_ip body string The read-only external (public) IPv4 address that is used for the VPN service. The VPN plugin sets this address if an IPv4 interface is available.
external_v6_ip body string The read-only external (public) IPv6 address that is used for the VPN service. The VPN plugin sets this address if an IPv6 interface is available.
admin_state_up body boolean The administrative state of the resource, which is up (true) or down (false).
subnet_id (Optional) body string If you specify only a subnet UUID, the networking service allocates an available IP from that subnet to the port. If you specify both a subnet UUID and an IP address, the networking service tries to allocate the address to the port.
tenant_id body string The ID of the project.
project_id body string The ID of the project.
flavor_id body string The ID of the flavor.
id body string The ID of the VPN service.

Status codes

Success

Code Reason
201 - Created Resource was created and is ready to use.

Error

Code Reason
400 - Bad Request

Some content in the request was invalid.

401 - Unauthorized

User must authenticate before making a request.

Example

{
  "vpnservice": {
    "id": "d6116b75-db78-4d07-9911-226b4655838a",
    "name": "vpnservice",
    "description": "",
    "tenant_id": "284a2547ea8445d1be0e68ef2d76672c",
    "subnet_id": null,
    "router_id": "923f2578-079e-40f1-b0a9-23c2b48dbdcd",
    "flavor_id": null,
    "admin_state_up": true,
    "external_v4_ip": "10.136.18.148",
    "external_v6_ip": null,
    "status": "PENDING_CREATE",
    "project_id": "284a2547ea8445d1be0e68ef2d76672c"
  }
}