line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Cisco::UCS::FEX; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
33
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
6
|
use Carp qw(croak); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
58
|
|
7
|
1
|
|
|
1
|
|
5
|
use Scalar::Util qw(weaken); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
165
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.50'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @ATTRIBUTES = qw(discovery dn id model operability perf power presence |
12
|
|
|
|
|
|
|
revision serial side thermal vendor voltage); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our %ATTRIBUTES = ( |
15
|
|
|
|
|
|
|
chassis_id => 'chassisId', |
16
|
|
|
|
|
|
|
config_state => 'configState', |
17
|
|
|
|
|
|
|
oper_state => 'operState', |
18
|
|
|
|
|
|
|
peer_status => 'peerCommStatus', |
19
|
|
|
|
|
|
|
switch_id => 'switchId', |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
{ |
23
|
1
|
|
|
1
|
|
10
|
no strict 'refs'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
401
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
while ( my ( $pseudo, $attribute ) = each %ATTRIBUTES ) { |
26
|
|
|
|
|
|
|
*{ __PACKAGE__ . '::' . $pseudo } = sub { |
27
|
0
|
|
|
0
|
|
|
my $self = shift; |
28
|
0
|
|
|
|
|
|
return $self->{$attribute} |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
foreach my $attribute ( @ATTRIBUTES ) { |
33
|
|
|
|
|
|
|
*{ __PACKAGE__ . '::' . $attribute } = sub { |
34
|
0
|
|
|
0
|
|
|
my $self = shift; |
35
|
0
|
|
|
|
|
|
return $self->{$attribute} |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub new { |
42
|
0
|
|
|
0
|
0
|
|
my ( $class, %args ) = @_; |
43
|
|
|
|
|
|
|
|
44
|
0
|
|
|
|
|
|
my $self = {}; |
45
|
0
|
|
|
|
|
|
bless $self, $class; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
defined $args{dn} |
48
|
|
|
|
|
|
|
? $self->{dn} = $args{dn} |
49
|
0
|
0
|
|
|
|
|
: croak 'dn not defined'; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
defined $args{ucs} |
52
|
|
|
|
|
|
|
? weaken($self->{ucs} = $args{ucs}) |
53
|
0
|
0
|
|
|
|
|
: croak 'ucs not defined'; |
54
|
|
|
|
|
|
|
|
55
|
0
|
|
|
|
|
|
my %attr = %{ $self->{ucs}->resolve_dn( |
56
|
|
|
|
|
|
|
dn => $self->{dn} |
57
|
0
|
|
|
|
|
|
)->{outConfig}->{equipmentIOCard}}; |
58
|
|
|
|
|
|
|
|
59
|
0
|
|
|
|
|
|
while ( my ($k, $v) = each %attr ) { $self->{$k} = $v } |
|
0
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
|
61
|
0
|
|
|
|
|
|
return $self; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
1; |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
__END__ |