| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package VMware::vCloud::vApp; |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# ABSTRACT: VMware vCloud Director vApp |
|
4
|
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
7
|
use Data::Dumper; |
|
|
2
|
|
|
|
|
3
|
|
|
|
2
|
|
|
|
|
92
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
7
|
use warnings; |
|
|
2
|
|
|
|
|
3
|
|
|
|
2
|
|
|
|
|
51
|
|
|
8
|
2
|
|
|
2
|
|
6
|
use strict; |
|
|
2
|
|
|
|
|
2
|
|
|
|
2
|
|
|
|
|
528
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '2.405'; # TRIAL VERSION |
|
11
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:NIGELM'; # AUTHORITY |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub new { |
|
15
|
0
|
|
|
0
|
1
|
|
my $class = shift @_; |
|
16
|
0
|
|
|
|
|
|
our $api = shift @_; |
|
17
|
0
|
|
|
|
|
|
our $href = shift @_; |
|
18
|
|
|
|
|
|
|
|
|
19
|
0
|
|
|
|
|
|
my $self = {}; |
|
20
|
0
|
|
|
|
|
|
bless( $self, $class ); |
|
21
|
|
|
|
|
|
|
|
|
22
|
0
|
|
|
|
|
|
our $data = $api->vapp_get($href); |
|
23
|
|
|
|
|
|
|
|
|
24
|
0
|
|
|
|
|
|
return $self; |
|
25
|
|
|
|
|
|
|
} |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub available_actions { |
|
29
|
0
|
|
|
0
|
1
|
|
my %actions; |
|
30
|
0
|
|
|
|
|
|
for my $action ( @{ our $data->{Link} } ) { |
|
|
0
|
|
|
|
|
|
|
|
31
|
0
|
0
|
|
|
|
|
next if $action->{rel} =~ /^(up|down|edit|controlAccess)$/; |
|
32
|
0
|
|
|
|
|
|
$actions{ $action->{rel} } = $action->{href}; |
|
33
|
|
|
|
|
|
|
} |
|
34
|
0
|
0
|
|
|
|
|
return wantarray ? %actions : \%actions; |
|
35
|
|
|
|
|
|
|
} |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub dumper { |
|
39
|
0
|
|
|
0
|
1
|
|
return our $data; |
|
40
|
|
|
|
|
|
|
} |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub power_on { |
|
44
|
0
|
|
|
0
|
1
|
|
my $self = shift @_; |
|
45
|
0
|
|
|
|
|
|
my %actions = $self->available_actions(); |
|
46
|
|
|
|
|
|
|
return "Error: Unable to Power On the vApp at this time.\n" . Dumper( \%actions ) |
|
47
|
0
|
0
|
|
|
|
|
unless defined $actions{'power:powerOn'}; |
|
48
|
|
|
|
|
|
|
|
|
49
|
0
|
|
|
|
|
|
return our $api->post( $actions{'power:powerOn'} ); |
|
50
|
|
|
|
|
|
|
} |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
0
|
1
|
|
sub power_off { |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
} |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
0
|
1
|
|
sub recompose { |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
} |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1; |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
__END__ |