line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Marathon::Deployment; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
sub new { |
4
|
0
|
|
|
0
|
0
|
|
my ($class, $args, $parent) = @_; |
5
|
|
|
|
|
|
|
my $self = bless { |
6
|
|
|
|
|
|
|
applications => {}, |
7
|
|
|
|
|
|
|
id => $args->{id}, |
8
|
|
|
|
|
|
|
parent => $parent, |
9
|
|
|
|
|
|
|
steps => [], |
10
|
|
|
|
|
|
|
version => $args->{version}, |
11
|
0
|
|
|
|
|
|
}; |
12
|
0
|
|
|
|
|
|
foreach my $application ( @{$args->{affectedApplications}} ) { |
|
0
|
|
|
|
|
|
|
13
|
0
|
|
|
|
|
|
$self->applications->{$application} = $parent->get_app($application); |
14
|
|
|
|
|
|
|
} |
15
|
0
|
|
|
|
|
|
foreach my $step ( @{$args->{steps}} ) { |
|
0
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# documentation has an odd format, each step being wrapped inside an array. |
17
|
|
|
|
|
|
|
# defensive: |
18
|
0
|
0
|
|
|
|
|
if ( ref $step eq 'HASH' ) { |
19
|
0
|
|
|
|
|
|
$step = [ $step ]; |
20
|
|
|
|
|
|
|
} |
21
|
0
|
|
|
|
|
|
foreach ( @{$step} ) { |
|
0
|
|
|
|
|
|
|
22
|
0
|
|
|
|
|
|
push @{$self->{steps}}, Net::Marathon::Deployment::Step->new($_->{action}, $self->{applications}->{$_->{application}}); |
|
0
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
} |
25
|
0
|
|
|
|
|
|
return $self; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
package Net::Marathon::Deployment::Step; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub new { |
31
|
0
|
|
|
0
|
|
|
my ($class, $action, $application) = @_; |
32
|
0
|
|
|
|
|
|
my $self = bless { |
33
|
|
|
|
|
|
|
action => $action, |
34
|
|
|
|
|
|
|
application => $application, |
35
|
|
|
|
|
|
|
}; |
36
|
0
|
|
|
|
|
|
return $self; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub action { |
40
|
0
|
|
|
0
|
|
|
my $self = shift; |
41
|
0
|
|
|
|
|
|
return $self->{action}; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub app { |
45
|
0
|
|
|
0
|
|
|
my $self = shift; |
46
|
0
|
|
|
|
|
|
return $self->application; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub application { |
50
|
0
|
|
|
0
|
|
|
my $self = shift; |
51
|
0
|
|
|
|
|
|
return $self->{application}; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |