Revert "Search device by CDP/LLDP advertised ID or Type"

This reverts commit 7411cf6cdd.
This commit is contained in:
Oliver Gorwits
2014-08-25 14:54:15 +01:00
parent 7411cf6cdd
commit f6b854f99f
5 changed files with 3 additions and 45 deletions

View File

@@ -177,17 +177,6 @@ __PACKAGE__->has_many(
'ip', { join_type => 'RIGHT' }
);
=head2 neighbor_ports
Returns the set of ports on other devices which connect to this device
=cut
__PACKAGE__->has_many(
neighbor_ports => 'App::Netdisco::DB::Result::DevicePort',
{ 'foreign.remote_ip' => 'self.ip' },
);
=head2 community
Returns the row from the community string table, if one exists.

View File

@@ -176,14 +176,6 @@ Will match exactly the C<os_ver> field, which is the operating sytem software ve
Will match exactly the C<vendor> (manufacturer).
=item neighbor_id
Will match the device if it has advertised this ID to a CDP/LLDP neighbor.
=item neighbor_type
Will match the device if it has advertised this Type to a CDP/LLDP neighbor.
=item dns
Can match any of the Device IP address aliases as a substring.
@@ -242,11 +234,6 @@ sub search_by_field {
($p->{layers} ? ('me.layers' =>
{ '-ilike' => "\%$layer_string" }) : ()),
($p->{neighbor_id} ? ('neighbor_ports.remote_id' =>
{ '-ilike' => "\%$p->{neighbor_id}\%" }) : ()),
($p->{neighbor_type} ? ('neighbor_ports.remote_type' =>
{ '-ilike' => "\%$p->{neighbor_type}\%" }) : ()),
($p->{model} ? ('me.model' =>
{ '-in' => $p->{model} }) : ()),
($p->{os_ver} ? ('me.os_ver' =>
@@ -269,8 +256,8 @@ sub search_by_field {
},
{
order_by => [qw/ me.dns me.ip /],
(($p->{dns} or $p->{ip} or $p->{neighbor_id} or $p->{neighbor_type}) ? (
join => [qw/device_ips neighbor_ports/],
(($p->{dns} or $p->{ip}) ? (
join => 'device_ips',
distinct => 1,
) : ()),
}

View File

@@ -14,8 +14,7 @@ register_search_tab(
# device with various properties or a default match-all
get '/ajax/content/search/device' => require_login sub {
my $has_opt = List::MoreUtils::any { param($_) }
qw/name location dns ip description model os_ver vendor layers
neighbor_id neighbor_type/;
qw/name location dns ip description model os_ver vendor layers/;
my $rs;
if ($has_opt) {