line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Cisco::UCS::Fault; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
33
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
35
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
7
|
use Carp qw(croak); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
69
|
|
7
|
1
|
|
|
1
|
|
7
|
use Scalar::Util qw(weaken); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
414
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.50'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @ATTRIBUTES = qw(ack code cause created dn id occur rule severity tags |
12
|
|
|
|
|
|
|
type); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our %ATTRIBUTES = ( |
15
|
|
|
|
|
|
|
last_transition => 'lastTransition', |
16
|
|
|
|
|
|
|
highest_severity => 'highestSeverity', |
17
|
|
|
|
|
|
|
original_severity => 'origSeverity', |
18
|
|
|
|
|
|
|
previous_severity => 'prevSeverity', |
19
|
|
|
|
|
|
|
desc => 'descr' |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub new { |
23
|
0
|
|
|
0
|
0
|
|
my ( $class, %args ) = @_; |
24
|
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
|
my $self = {}; |
26
|
0
|
|
|
|
|
|
bless $self, $class; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
defined $args{dn} |
29
|
|
|
|
|
|
|
? $self->{dn} = $args{dn} |
30
|
0
|
0
|
|
|
|
|
: croak 'dn not defined'; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
defined $args{ucs} |
33
|
|
|
|
|
|
|
? weaken($self->{ucs} = $args{ucs}) |
34
|
0
|
0
|
|
|
|
|
: croak 'ucs not defined'; |
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
my %attr = %{ $self->{ucs}->resolve_dn( |
37
|
|
|
|
|
|
|
dn => $self->{dn} |
38
|
0
|
|
|
|
|
|
)->{outConfig}->{faultInst}}; |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
while ( my ($k, $v) = each %attr ) { $self->{$k} = $v } |
|
0
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
|
|
|
return $self |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
{ |
46
|
1
|
|
|
1
|
|
8
|
no strict 'refs'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
214
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
while ( my ( $pseudo, $attribute ) = each %ATTRIBUTES ) { |
49
|
|
|
|
|
|
|
*{ __PACKAGE__ . '::' . $pseudo } = sub { |
50
|
0
|
|
|
0
|
|
|
my $self = shift; |
51
|
0
|
|
|
|
|
|
return $self->{$attribute} |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
foreach my $attribute ( @ATTRIBUTES ) { |
56
|
|
|
|
|
|
|
*{ __PACKAGE__ . '::' . $attribute } = sub { |
57
|
0
|
|
|
0
|
|
|
my $self = shift; |
58
|
0
|
|
|
|
|
|
return $self->{$attribute} |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
1; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
__END__ |