implement port search

This commit is contained in:
Oliver Gorwits
2012-01-08 19:17:27 +00:00
parent d6985e25cd
commit ef9c6e8452
3 changed files with 59 additions and 5 deletions

View File

@@ -21,5 +21,23 @@ sub by_mac {
);
}
# confusingly the "name" field is set using IOS "descrption"
# command but should not be confused with the "descr" field
sub by_name {
my ($set, $name) = @_;
return $set unless $name;
return $set->search(
{
'me.name' => { '-ilike' => $name },
},
{
order_by => [qw/ me.ip me.port /],
columns => [qw/ ip port descr name vlan device.dns /],
join => 'device',
},
);
}
1;