#696 complete implementation of #688

This commit is contained in:
Oliver Gorwits
2020-01-25 18:07:43 +00:00
parent e09ae10fb3
commit db6e89607d

View File

@@ -442,7 +442,8 @@ Results are ordered by the Device DNS and IP fields.
=item *
Related rows from the C<device_vlan> table will be prefetched.
Column C<pcount> gives a count of the number of ports on the device
that are actually configured to carry the VLAN.
=back
@@ -460,13 +461,16 @@ sub carrying_vlan_name {
return $rs
->search_rs({}, {
order_by => [qw/ me.dns me.ip /],
columns => [
'me.ip', 'me.dns',
'me.model', 'me.os',
'me.vendor', 'vlans.vlan',
'vlans.description'
],
join => 'vlans'
select => [{ count => 'ports.vlan' }],
as => ['pcount'],
columns => [
'me.ip', 'me.dns',
'me.model', 'me.os',
'me.vendor', 'vlans.vlan',
'vlans.description'
],
join => {'vlans' => 'ports'},
distinct => 1,
})
->search($cond, $attrs);
}