System
- async OPNsenseClient.toggle_interface(if_name, toggle_on_off=None)
Toggle an interface’s enabled state and apply the resulting configuration.
Requires firmware >= 26.7.6 and sends only the enable flag. Refuses pending or unreadable interface work; coordinate concurrent changes. Failure or cancellation can leave pending work: resolve it in the OPNsense UI before retrying. Applying changes can reset queued interfaces’ advanced/file-based DHCP settings or disconnect this client.
- Parameters:
- Returns:
- True when already matching, or when the Router
acknowledged the save (
saved) and confirmed the apply; False when refused, the save was not acknowledged (no apply is sent) or the apply was not confirmed. A suppressed exception returns None. Withthrow_errorsenabled, invalid arguments raiseOPNsenseInvalidArgumentand transport failures raiseOPNsenseErrorsubclasses.
- Return type:
bool | None
- async OPNsenseClient.get_device_unique_id(expected_id=None)
Return the stable device identifier derived from physical MAC addresses.
- Parameters:
expected_id (str | None, optional) – Previously known identifier to prefer when it is still present among physical interface MAC addresses.
- Returns:
- MAC-address-based identifier with colons replaced by
underscores. Returns
expected_idwhen it still matches a physical interface, otherwise the first sorted physical MAC identifier. ReturnsNonewhen no physical MAC addresses are available andthrow_errorsis disabled.
- Return type:
str | None
- async OPNsenseClient.get_system_info()
Return basic OPNsense system identity information.
- async OPNsenseClient.get_carp()
Fetch one CARP snapshot and return both interfaces and aggregate summary.
- async OPNsenseClient.system_reboot()
Reboot OPNsense.
- Returns:
True when the operation succeeds; otherwise, False.
- Return type:
- async OPNsenseClient.system_halt()
Shutdown OPNsense.
- Return type:
None
- async OPNsenseClient.toggle_carp_maintenance_mode()
Toggle persistent CARP maintenance mode.
- Returns:
True when the operation succeeds; otherwise, False.
- Return type:
- async OPNsenseClient.send_wol(interface, mac)
Send a wake on lan packet to the specified MAC address.
- async OPNsenseClient.get_notices()
Return active OPNsense dashboard notices.
- async OPNsenseClient.close_notice(id)
Close selected notices.
- async OPNsenseClient.reload_interface(if_name)
Reload the specified interface.