VPN

async OPNsenseClient.get_openvpn()

Return OpenVPN server and client status information.

Returns:

Mapping with servers and clients

keyed by UUID. Server entries combine instance, provider, session, route, tunnel-address, DNS, status, byte-counter, and connected-client data when available.

Return type:

MutableMapping[str, Any]

async OPNsenseClient.get_wireguard()

Return WireGuard server and client status information.

Returns:

Mapping with servers and clients

keyed by UUID. Entries combine configured tunnel addresses, peer links, enabled state, interface names, handshake status, byte counters, and connected peer counts where available.

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) – WireGuard collection to toggle. Use clients for a client entry or servers for a server entry. Ignored for OpenVPN.

  • uuid (str) – UUID of the VPN instance to toggle.

Returns:

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

Return type:

bool