line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Podman::Containers; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
514645
|
use Mojo::Base 'Podman::Client'; |
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
13
|
|
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
228
|
use Mojo::Collection qw(c); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
121
|
|
6
|
2
|
|
|
2
|
|
13
|
use Scalar::Util qw(blessed); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
77
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
382
|
use Podman::Container; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
617
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
has 'names_only' => undef; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub list { |
13
|
1
|
|
|
1
|
1
|
28030
|
my $self = shift; |
14
|
|
|
|
|
|
|
|
15
|
1
|
50
|
|
|
|
34
|
if (!blessed($self)) { |
16
|
0
|
|
|
|
|
0
|
$self = __PACKAGE__->new(); |
17
|
0
|
|
|
|
|
0
|
my %opts = @_; |
18
|
0
|
|
|
|
|
0
|
$self->names_only($opts{names_only}); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
1
|
|
|
|
|
56
|
my $containers = $self->get('containers/json', parameters => {all => 1})->json; |
22
|
|
|
|
|
|
|
my @list = map { |
23
|
1
|
|
33
|
|
|
12
|
my $name = $_->{Names}->[0] || $_->{Id}; |
24
|
1
|
50
|
|
|
|
77
|
$self->names_only ? $name : Podman::Container->new(name => $name); |
25
|
1
|
|
|
|
|
192
|
} @{$containers}; |
|
1
|
|
|
|
|
6
|
|
26
|
|
|
|
|
|
|
|
27
|
1
|
|
|
|
|
65
|
return c(@list); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub prune { |
31
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
32
|
|
|
|
|
|
|
|
33
|
0
|
0
|
|
|
|
|
$self = __PACKAGE__->new() unless blessed($self); |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
|
$self->post('containers/prune'); |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
return 1; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
__END__ |