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.002';
4 8     8   59 use Moo;
  8         17  
  8         60  
5 8     8   2889 use Carp qw( croak );
  8         18  
  8         648  
6 8     8   3552 use namespace::clean;
  8         119240  
  8         62  
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 1500 my ($self) = @_;
18 1         15 return $self->client->get('/info');
19             }
20              
21              
22             sub version {
23 2     2 1 1023 my ($self) = @_;
24 2         28 return $self->client->get('/version');
25             }
26              
27              
28             sub ping {
29 1     1 1 38 my ($self) = @_;
30 1         13 return $self->client->get('/_ping');
31             }
32              
33              
34             sub events {
35 1     1 1 41 my ($self, %opts) = @_;
36 1         2 my %params;
37 1 50       7 $params{since} = $opts{since} if defined $opts{since};
38 1 50       5 $params{until} = $opts{until} if defined $opts{until};
39 1 50       4 $params{filters} = $opts{filters} if defined $opts{filters};
40 1         15 return $self->client->get('/events', params => \%params);
41             }
42              
43              
44             sub df {
45 1     1 1 33 my ($self) = @_;
46 1         11 return $self->client->get('/system/df');
47             }
48              
49              
50              
51             1;
52              
53             __END__