line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Cisco::UCS::Blade::Adaptor; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
6
|
use Scalar::Util qw(weaken); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
169
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.50'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our %V_MAP = ( |
11
|
|
|
|
|
|
|
'adminPowerState' => 'admin_pwoer_state', |
12
|
|
|
|
|
|
|
'baseMac' => 'base_mac', |
13
|
|
|
|
|
|
|
'bladeId' => 'blade_id', |
14
|
|
|
|
|
|
|
'chassisId' => 'chassis_id', |
15
|
|
|
|
|
|
|
'connPath' => 'conn_path', |
16
|
|
|
|
|
|
|
'connStatus' => 'conn_status', |
17
|
|
|
|
|
|
|
'dn' => 'dn', |
18
|
|
|
|
|
|
|
'integrated' => 'integrated', |
19
|
|
|
|
|
|
|
'managingInst' => 'managing_instance', |
20
|
|
|
|
|
|
|
'model' => 'model', |
21
|
|
|
|
|
|
|
'operability' => 'operability', |
22
|
|
|
|
|
|
|
'operState' => 'oper_state', |
23
|
|
|
|
|
|
|
'pciSlot' => 'pci_slot', |
24
|
|
|
|
|
|
|
'partNumber' => 'part_number', |
25
|
|
|
|
|
|
|
'pciAddr' => 'pci_addr', |
26
|
|
|
|
|
|
|
'perf' => 'perf', |
27
|
|
|
|
|
|
|
'power' => 'power', |
28
|
|
|
|
|
|
|
'presence' => 'presence', |
29
|
|
|
|
|
|
|
'reachability' => 'reachability', |
30
|
|
|
|
|
|
|
'revision' => 'revision', |
31
|
|
|
|
|
|
|
'serial' => 'serial', |
32
|
|
|
|
|
|
|
'thermal' => 'thermal', |
33
|
|
|
|
|
|
|
'voltage' => 'voltage', |
34
|
|
|
|
|
|
|
'vendor' => 'vendor' |
35
|
|
|
|
|
|
|
); |
36
|
|
|
|
|
|
|
|
37
|
1
|
|
|
1
|
|
6
|
{ no strict 'refs'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
321
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
while ( my ($attribute, $pseudo) = each %V_MAP ) { |
40
|
|
|
|
|
|
|
*{ __PACKAGE__ .'::'. $pseudo } = sub { |
41
|
0
|
|
|
0
|
|
|
my $self = shift; |
42
|
0
|
|
|
|
|
|
return $self->{$attribute} |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub new { |
48
|
0
|
|
|
0
|
0
|
|
my ( $class, $ucs, $args ) = @_; |
49
|
|
|
|
|
|
|
|
50
|
0
|
|
|
|
|
|
my $self = bless {}, $class; |
51
|
0
|
|
|
|
|
|
weaken( $self->{ucs} = $ucs ); |
52
|
|
|
|
|
|
|
|
53
|
0
|
|
|
|
|
|
foreach my $var ( keys %$args ) { |
54
|
0
|
|
|
|
|
|
$self->{ $var } = $args->{ $var }; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
0
|
|
|
|
|
|
return $self |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub env_stats { |
61
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
return Cisco::UCS::Common::EnvironmentalStats->new( |
64
|
|
|
|
|
|
|
$self->{ucs}->resolve_dn( |
65
|
|
|
|
|
|
|
dn => "$self->{dn}/env-stats" |
66
|
|
|
|
|
|
|
)->{outConfig}->{processorEnvStats} |
67
|
|
|
|
|
|
|
) |
68
|
0
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
1; |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
__END__ |