line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Cisco::UCS::MgmtEntity; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
34
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
6
|
use Carp qw(croak); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
55
|
|
7
|
1
|
|
|
1
|
|
6
|
use Scalar::Util qw(weaken); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
336
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.50'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @ATTRIBUTES = qw(chassis1 chassis2 chassis3 dn id leadership state); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our %ATTRIBUTES = ( |
14
|
|
|
|
|
|
|
chassis1_device_io_state => 'chassisDeviceIoState1', |
15
|
|
|
|
|
|
|
chassis2_device_io_state => 'chassisDeviceIoState2', |
16
|
|
|
|
|
|
|
chassis3_device_io_state => 'chassisDeviceIoState3', |
17
|
|
|
|
|
|
|
ha_failure_reason => 'haFailureReason', |
18
|
|
|
|
|
|
|
ha_readiness => 'haReadiness', |
19
|
|
|
|
|
|
|
ha_ready => 'haReady', |
20
|
|
|
|
|
|
|
mgmt_services_state => 'mgmtServicesState', |
21
|
|
|
|
|
|
|
umbilical_state => 'umbilicalState', |
22
|
|
|
|
|
|
|
version_mismatch => 'versionMismatch' |
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub new { |
26
|
0
|
|
|
0
|
0
|
|
my ( $class, %args ) = @_; |
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
|
|
|
my $self = {}; |
29
|
0
|
|
|
|
|
|
bless $self, $class; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
defined $args{dn} |
32
|
|
|
|
|
|
|
? $self->{dn} = $args{dn} |
33
|
0
|
0
|
|
|
|
|
: croak 'dn not defined'; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
defined $args{ucs} |
36
|
|
|
|
|
|
|
? weaken($self->{ucs} = $args{ucs}) |
37
|
0
|
0
|
|
|
|
|
: croak 'dn not defined'; |
38
|
|
|
|
|
|
|
|
39
|
0
|
|
|
|
|
|
my %attr = %{ $self->{ucs}->resolve_dn( |
40
|
|
|
|
|
|
|
dn => $self->{dn} |
41
|
0
|
|
|
|
|
|
)->{outConfig}->{mgmtEntity} }; |
42
|
|
|
|
|
|
|
|
43
|
0
|
|
|
|
|
|
while ( my ($k, $v) = each %attr ) { $self->{$k} = $v } |
|
0
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
0
|
|
|
|
|
|
return $self |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
{ |
49
|
1
|
|
|
1
|
|
7
|
no strict 'refs'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
201
|
|
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
while ( my ( $pseudo, $attribute ) = each %ATTRIBUTES ) { |
52
|
|
|
|
|
|
|
*{ __PACKAGE__ . '::' . $pseudo } = sub { |
53
|
0
|
|
|
0
|
|
|
my $self = shift; |
54
|
0
|
|
|
|
|
|
return $self->{$attribute} |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
foreach my $attribute ( @ATTRIBUTES ) { |
59
|
|
|
|
|
|
|
*{ __PACKAGE__ . '::' . $attribute } = sub { |
60
|
0
|
|
|
0
|
|
|
my $self = shift; |
61
|
0
|
|
|
|
|
|
return $self->{$attribute} |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
1; |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
__END__ |