diff --git a/lib/App/Netdisco/DB.pm b/lib/App/Netdisco/DB.pm index 9becdfb3..6848f4d0 100644 --- a/lib/App/Netdisco/DB.pm +++ b/lib/App/Netdisco/DB.pm @@ -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'; diff --git a/lib/App/Netdisco/DB/Result/DevicePort.pm b/lib/App/Netdisco/DB/Result/DevicePort.pm index 93b936dd..d23de02c 100644 --- a/lib/App/Netdisco/DB/Result/DevicePort.pm +++ b/lib/App/Netdisco/DB/Result/DevicePort.pm @@ -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 diff --git a/lib/App/Netdisco/DB/Result/DevicePortProperties.pm b/lib/App/Netdisco/DB/Result/DevicePortProperties.pm index 26175eb5..bc909187 100644 --- a/lib/App/Netdisco/DB/Result/DevicePortProperties.pm +++ b/lib/App/Netdisco/DB/Result/DevicePortProperties.pm @@ -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", diff --git a/lib/App/Netdisco/DB/ResultSet/DevicePort.pm b/lib/App/Netdisco/DB/ResultSet/DevicePort.pm index 4339ea70..f4319d3a 100644 --- a/lib/App/Netdisco/DB/ResultSet/DevicePort.pm +++ b/lib/App/Netdisco/DB/ResultSet/DevicePort.pm @@ -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', }); diff --git a/share/schema_versions/App-Netdisco-DB-70-71-PostgreSQL.sql b/share/schema_versions/App-Netdisco-DB-70-71-PostgreSQL.sql new file mode 100644 index 00000000..2051cd0c --- /dev/null +++ b/share/schema_versions/App-Netdisco-DB-70-71-PostgreSQL.sql @@ -0,0 +1,5 @@ +BEGIN; + +ALTER TABLE device_port_properties ADD COLUMN "remote_is_discoverable" bool DEFAULT true; + +COMMIT;