support for storing remote_is_discoverable on a port

This commit is contained in:
Oliver Gorwits
2022-05-15 22:17:36 +01:00
parent 96f3923ab0
commit 1a810d89f3
5 changed files with 21 additions and 2 deletions

View File

@@ -11,7 +11,7 @@ __PACKAGE__->load_namespaces(
);
our # try to hide from kwalitee
$VERSION = 70; # schema version used for upgrades, keep as integer
$VERSION = 71; # schema version used for upgrades, keep as integer
use Path::Class;
use File::ShareDir 'dist_dir';

View File

@@ -331,6 +331,15 @@ state, or else `undef` if the port is not in an error state.
sub error_disable_cause { return (shift)->get_column('error_disable_cause') }
=head2 remote_is_discoverable
Returns true if Netdisco is permitted to discover the remote device with
the configuration of the local poller doing the local device discovery.
=cut
sub remote_is_discoverable { return (shift)->get_column('remote_is_discoverable') }
=head2 remote_is_wap
Returns true if the remote LLDP neighbor has reported Wireless Access Point

View File

@@ -13,6 +13,8 @@ __PACKAGE__->add_columns(
{ data_type => "text", is_nullable => 0 },
"error_disable_cause",
{ data_type => "text", is_nullable => 1 },
"remote_is_discoverable",
{ data_type => "boolean", default_value => \"true", is_nullable => 1 },
"remote_is_wap",
{ data_type => "boolean", default_value => \"false", is_nullable => 1 },
"remote_is_phone",

View File

@@ -126,6 +126,8 @@ will add the following additional synthesized columns to the result set:
=item error_disable_cause
=item remote_is_discoverable (boolean)
=item remote_is_wap (boolean)
=item remote_is_phone (boolean)
@@ -143,12 +145,13 @@ sub with_properties {
{
'+select' => [qw/
properties.error_disable_cause
properties.remote_is_discoverable
properties.remote_is_wap
properties.remote_is_phone
/],
'+as' => [qw/
error_disable_cause
remote_is_wap remote_is_phone
remote_is_discoverable remote_is_wap remote_is_phone
/],
join => 'properties',
});

View File

@@ -0,0 +1,5 @@
BEGIN;
ALTER TABLE device_port_properties ADD COLUMN "remote_is_discoverable" bool DEFAULT true;
COMMIT;