This shows you the differences between two versions of the page.
esmith:networksdb [2015/05/22 08:06] stephdl [local_access_spec ([$access])] |
esmith:networksdb [2019/06/05 19:48] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== esmith:: | ||
- | esmith:: | ||
- | |||
- | if you want the latest documentation, | ||
- | |||
- | perldoc -U esmith:: | ||
- | ===== NAME ===== | ||
- | |||
- | | ||
- | |||
- | ===== SYNOPSIS ===== | ||
- | |||
- | use esmith:: | ||
- | my $c = esmith:: | ||
- | |||
- | # everything else works just like esmith:: | ||
- | |||
- | ===== DESCRIPTION ===== | ||
- | |||
- | This module provides an abstracted interface to the esmith networks database. | ||
- | |||
- | Unless otherwise noted, esmith:: | ||
- | |||
- | Original network database methods | ||
- | ==== open ==== | ||
- | |||
- | Like esmith:: | ||
- | |||
- | ==== open_ro ==== | ||
- | |||
- | Like esmith:: | ||
- | |||
- | ==== networks ==== | ||
- | |||
- | Return a list of all objects of type " | ||
- | |||
- | ==== local_access_spec ([$access]) ==== | ||
- | |||
- | Compute the network/ | ||
- | |||
- | There is also an optional access parameter which can further restrict the values returned. If " | ||
- | |||
- | If called in scalar context, the returned string is suitable for use in / | ||
- | |||
- | | ||
- | |||
- | Note: The elements are space separated, which is suitable for use in hosts.allow, | ||
- | |||
- | If called in list context, returns the array of addresses and network/ | ||
- | my $ndb = esmith:: | ||
- | my @access = $ndb-> | ||
- | then | ||
- | my $access = join ( ",", | ||
- | |||
- | ===== Network interfaces methods ===== | ||
- | |||
- | ==== interfaces ==== | ||
- | |||
- | my @interfaces = $interfaces-> | ||
- | |||
- | Returns a list of all interface records in the database. | ||
- | |||
- | ==== zones ==== | ||
- | |||
- | my @zones = $interfaces-> | ||
- | Returns a list of all records of type ’zone’. | ||
- | |||
- | ==== ethernets ==== | ||
- | |||
- | my @interfaces = $interfaces-> | ||
- | |||
- | Returns a list of all interfaces of type ’ethernet’. | ||
- | |||
- | ==== bridges ==== | ||
- | |||
- | my @interfaces = $interfaces-> | ||
- | |||
- | Returns a list of all interfaces of type ’bridges’. | ||
- | |||
- | ==== bonds ==== | ||
- | |||
- | my @interfaces = $interfaces-> | ||
- | |||
- | Returns a list of all interfaces of type ’bond’. | ||
- | |||
- | ==== aliases ==== | ||
- | |||
- | my @interfaces = $interfaces-> | ||
- | |||
- | Returns a list of all interfaces of type ’aliases’. | ||
- | |||
- | ==== ipsecs ==== | ||
- | |||
- | my @interfaces = $interfaces-> | ||
- | Returns a list of all interfaces of type ’ipsecs’. | ||
- | |||
- | ==== get_by_role ==== | ||
- | |||
- | my @interfaces = $interfaces-> | ||
- | |||
- | Returns the interface(s) with the given role, if exsists. Returns undef, otherwise. | ||
- | |||
- | The return type is context sensible. In array context a list is returned, in scalar context a Record is returned, if at least one exists. | ||
- | |||
- | === green === | ||
- | |||
- | Returns the interface(s) with green role. | ||
- | |||
- | === orange === | ||
- | |||
- | Returns the interface(s) with orange role. | ||
- | |||
- | === blue === | ||
- | |||
- | Returns the interface(s) with blue role. | ||
- | |||
- | === yellow === | ||
- | |||
- | Returns the interface(s) with yellowe role. | ||
- | |||
- | == red == | ||
- | |||
- | Returns the interface(s) with red role. | ||
- | |||
- | AUTHOR | ||
- | | ||
- | |||
- | SEE ALSO | ||
- | | ||
- | |||
- | perl v5.10.1 | ||
- | (END) | ||
- | |||
- | {{tag> neth-development }} |