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