wireguard_peers
Creates, updates, deletes, gets or lists a wireguard_peers resource.
Overview​
| Name | wireguard_peers |
| Type | Resource |
| Id | ovh.over_the_box.wireguard_peers |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
name | string | Wireguard peer name |
peer_id | string | Wireguard peer id (wire: peerId) |
active | boolean | Wireguard peer status |
description | string | Wireguard peer description |
private_ipv_4 | string (ipv4-block) | Wireguard peer private IP (example: 192.0.2.0/24) (wire: privateIpv4) |
public_key | string | Wireguard peer public key (wire: publicKey) |
Service Wiregard peer details
| Name | Datatype | Description |
|---|---|---|
name | string | Wireguard peer name |
peer_id | string | Wireguard peer id (wire: peerId) |
active | boolean | Wireguard peer status |
description | string | Wireguard peer description |
private_ipv_4 | string (ipv4-block) | Wireguard peer private IP (example: 192.0.2.0/24) (wire: privateIpv4) |
public_key | string | Wireguard peer public key (wire: publicKey) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | peer_id, service_name | Returns a WireGuard peer with its name, description, public key, private IPv4 and whether it is active. (Beta version) | |
list | select | service_name | x_pagination_mode | Returns the IDs of the WireGuard peers configured on the OverTheBox service. (Beta version) |
create | insert | service_name, description, name, private_ipv_4, public_key | Adds a WireGuard peer to the service from its name, description, public key and private IPv4. Returns the created peer. (Beta version) | |
update | update | peer_id, service_name | Changes the name, description, public key, private IPv4 or active status of a WireGuard peer. Returns the task that applies the change. (Beta version) | |
delete | delete | peer_id, service_name | Removes the WireGuard peer from the service. Returns the task that performs the removal. (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.
| Name | Datatype | Description |
|---|---|---|
api_host | string | The 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"}}) |
peer_id | string | Peer ID (wire: peerId) |
service_name | string | Service name (wire: serviceName) |
x_pagination_mode | string | Sent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode) |
SELECT examples​
- get
- list
Returns a WireGuard peer with its name, description, public key, private IPv4 and whether it is active. (Beta version)
SELECT
name,
peer_id,
active,
description,
private_ipv_4,
public_key
FROM ovh.over_the_box.wireguard_peers
WHERE peer_id = '{{ peer_id }}' -- required
AND service_name = '{{ service_name }}' -- required
;
Returns the IDs of the WireGuard peers configured on the OverTheBox service. (Beta version)
SELECT
name,
peer_id,
active,
description,
private_ipv_4,
public_key
FROM ovh.over_the_box.wireguard_peers
WHERE service_name = '{{ service_name }}' -- required
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
INSERT examples​
- create
- Manifest
Adds a WireGuard peer to the service from its name, description, public key and private IPv4. Returns the created peer. (Beta version)
INSERT INTO ovh.over_the_box.wireguard_peers (
description,
name,
private_ipv_4,
public_key,
service_name
)
SELECT
'{{ description }}' /* required */,
'{{ name }}' /* required */,
'{{ private_ipv_4 }}' /* required */,
'{{ public_key }}' /* required */,
'{{ service_name }}'
RETURNING
name,
peer_id,
active,
description,
private_ipv_4,
public_key
;
# Description fields are for documentation purposes
- name: wireguard_peers
props:
- name: service_name
value: "{{ service_name }}"
description: Required parameter for the wireguard_peers resource.
- name: description
value: "{{ description }}"
description: |
Wireguard peer description
- name: name
value: "{{ name }}"
description: |
Wireguard peer name
- name: private_ipv_4
value: "{{ private_ipv_4 }}"
description: |
Wireguard peer private IP
- name: public_key
value: "{{ public_key }}"
description: |
Wireguard peer public key
UPDATE examples​
- update
Changes the name, description, public key, private IPv4 or active status of a WireGuard peer. Returns the task that applies the change. (Beta version)
UPDATE ovh.over_the_box.wireguard_peers
SET
active = {{ active }},
description = '{{ description }}',
name = '{{ name }}',
private_ipv_4 = '{{ private_ipv_4 }}',
public_key = '{{ public_key }}'
WHERE
peer_id = '{{ peer_id }}' --required
AND service_name = '{{ service_name }}' --required
RETURNING
name,
task_id,
status;
DELETE examples​
- delete
Removes the WireGuard peer from the service. Returns the task that performs the removal. (Beta version)
DELETE FROM ovh.over_the_box.wireguard_peers
WHERE peer_id = '{{ peer_id }}' --required
AND service_name = '{{ service_name }}' --required
;