Vouchers
- async OPNsenseClient.generate_vouchers(data)
Generate captive portal vouchers from a voucher server.
- Parameters:
data (MutableMapping[str, Any]) – Voucher generation options passed to OPNsense. Include
voucher_serverto choose a specific server when more than one provider exists.- Returns:
- Generated vouchers with keys ordered for
consumers and with
expirytimeconverted to a timestamped datetime plusexpiry_timestampand human-readablevalidity_strwhen those values are available.
- Return type:
- Raises:
OPNsenseConnectionError – Re-raised when voucher generation fails for a reason other than an unavailable endpoint.
OPNsenseVoucherServerError – No voucher servers are available, or the request omits a server while multiple servers are available.