File Coverage

blib/lib/API/Docker/API/System.pm
Criterion Covered Total %
statement 23 23 100.0
branch 3 6 50.0
condition n/a
subroutine 8 8 100.0
pod 5 5 100.0
total 39 42 92.8


line stmt bran cond sub pod time code
1             package API::Docker::API::System;
2             # ABSTRACT: Docker Engine System API
3             our $VERSION = '0.001';
4 7     7   51 use Moo;
  7         21  
  7         52  
5 7     7   2902 use Carp qw( croak );
  7         16  
  7         659  
6 7     7   3535 use namespace::clean;
  7         124974  
  7         58  
7              
8              
9             has client => (
10             is => 'ro',
11             required => 1,
12             weak_ref => 1,
13             );
14              
15              
16             sub info {
17 1     1 1 1446 my ($self) = @_;
18 1         15 return $self->client->get('/info');
19             }
20              
21              
22             sub version {
23 2     2 1 1058 my ($self) = @_;
24 2         27 return $self->client->get('/version');
25             }
26              
27              
28             sub ping {
29 1     1 1 36 my ($self) = @_;
30 1         13 return $self->client->get('/_ping');
31             }
32              
33              
34             sub events {
35 1     1 1 44 my ($self, %opts) = @_;
36 1         3 my %params;
37 1 50       8 $params{since} = $opts{since} if defined $opts{since};
38 1 50       4 $params{until} = $opts{until} if defined $opts{until};
39 1 50       5 $params{filters} = $opts{filters} if defined $opts{filters};
40 1         43 return $self->client->get('/events', params => \%params);
41             }
42              
43              
44             sub df {
45 1     1 1 22 my ($self) = @_;
46 1         8 return $self->client->get('/system/df');
47             }
48              
49              
50              
51             1;
52              
53             __END__