ADDITIONAL METHODS
search_by_mac( \%cond, \%attrs? )
my $set = $rs->search_by_mac({mac => '00:11:22:33:44:55', active => 1});
Like search(), this returns a ResultSet of matching rows from the Node table.
The
condparameter must be a hashref containing a keymacwith the value to search for.Results are ordered by time last seen.
Additional columns
time_first_stampandtime_last_stampprovide preformatted timestamps of thetime_firstandtime_lastfields.A JOIN is performed on the Device table and the Device
dnscolumn prefetched.
To limit results only to active nodes, set {active => 1} in cond.
with_port_context
my $set = $rs->search(...)->with_port_context;
Adds columns describing the switch port of each Node, so that API clients can tell access ports from transit ports (uplinks, LAGs) without fetching the ports of every switch:
port_is_uplink,port_remote_ip,port_is_master,port_slave_offromdevice_port, andport_remote_is_wap,port_remote_is_phonefromdevice_port_properties.lag_remote_ipis a member'sremote_ipfor a LAG master, or the master's for a LAG member.neighbor_is_deviceis true when the port's remote IP, or one of its LAG members', is a known device address.port_mac_countis the number of distinct active MACs on the port, across all VLANs.
The columns use correlated subqueries per row, so callers should make this opt-in for searches that can return many rows.
SPECIAL METHODS
delete( \%options? )
Overrides the built-in DBIx::Class delete method to more efficiently handle the removal or archiving of nodes.