VPN

static OPNsenseClient.wireguard_is_connected(past_time)

Determine whether a WireGuard session is still considered active.

Parameters:

past_time (datetime | None) – Timestamp of the most recent WireGuard handshake.

Returns:

True if a wireguard session is still considered active; otherwise, False.

Return type:

bool

async OPNsenseClient.get_openvpn()

Return OpenVPN information.

Returns:

Normalized data returned by the related OPNsense endpoint.

Return type:

MutableMapping[str, Any]

async OPNsenseClient.get_wireguard()

Get the details of the WireGuard services.

Returns:

Normalized data returned by the related OPNsense endpoint.

Return type:

MutableMapping[str, Any]

async OPNsenseClient.toggle_vpn_instance(vpn_type, clients_servers, uuid)

Toggle the specified VPN instance on or off.

Parameters:
  • vpn_type (str) – Vpn type used by this operation.

  • clients_servers (str) – Mapping that links WireGuard clients to servers.

  • uuid (str) – Unique identifier of the target OPNsense resource.

Returns:

True when the toggle operation completes successfully; otherwise, False.

Return type:

bool