Skip to main content

wireguards

Creates, updates, deletes, gets or lists a wireguards resource.

Overview​

Namewireguards
TypeResource
Idovh.over_the_box.wireguards

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
endpointobjectWireguard server connection endpoint
max_peer_activeintegerMaximum peers simultaneously active (wire: maxPeerActive)
max_peer_allowedintegerMaximum peers simultaneously configured (wire: maxPeerAllowed)
private_ipv_4string (ipv4-block)Wireguard server private IP block (example: 192.0.2.0/24) (wire: privateIpv4)
public_keystringWireguard server public key (wire: publicKey)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectservice_nameReturns the WireGuard server configuration: its public key, private IPv4 block, connection endpoint (IPv4 and port), and the maximum number of peers configured and simultaneously active. (Beta version)
regenerateexecserviceNameRegenerates the key of the WireGuard server of the service, which changes the server public key the peers use. Returns the task that performs the change. (Beta version)
resetexecserviceNameResets the WireGuard configuration of the service to its default. Returns the task that performs the reset. (Beta version)

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
api_hoststringThe OVHcloud API host. Selected by OVH_ENDPOINT (ovh-eu, ovh-ca or ovh-us; default ovh-eu). (default: api.eu.ovhcloud.com, x-stackQL-envVarSelector: {"envVar":"OVH_ENDPOINT","default":"ovh-eu","values":{"ovh-eu":"api.eu.ovhcloud.com","ovh-ca":"api.ca.ovhcloud.com","ovh-us":"api.us.ovhcloud.com"}})
serviceNamestringService name
service_namestringService name (wire: serviceName)

SELECT examples​

Returns the WireGuard server configuration: its public key, private IPv4 block, connection endpoint (IPv4 and port), and the maximum number of peers configured and simultaneously active. (Beta version)

SELECT
endpoint,
max_peer_active,
max_peer_allowed,
private_ipv_4,
public_key
FROM ovh.over_the_box.wireguards
WHERE service_name = '{{ service_name }}' -- required
;

Lifecycle Methods​

EXEC variables use wire (API) names.

Regenerates the key of the WireGuard server of the service, which changes the server public key the peers use. Returns the task that performs the change. (Beta version)

EXEC ovh.over_the_box.wireguards.regenerate
@serviceName='{{ serviceName }}' --required
;