line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WebService::DigitalOcean::Role::Domains; |
2
|
|
|
|
|
|
|
# ABSTRACT: Domains role for DigitalOcean WebService |
3
|
2
|
|
|
2
|
|
1426
|
use utf8; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
18
|
|
4
|
2
|
|
|
2
|
|
70
|
use Moo::Role; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
15
|
|
5
|
2
|
|
|
2
|
|
536
|
use feature 'state'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
200
|
|
6
|
2
|
|
|
2
|
|
8
|
use Types::Standard qw/Str Object Dict/; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
20
|
|
7
|
2
|
|
|
2
|
|
6457
|
use Type::Utils; |
|
2
|
|
|
|
|
11386
|
|
|
2
|
|
|
|
|
22
|
|
8
|
2
|
|
|
2
|
|
6060
|
use Type::Params qw/compile/; |
|
2
|
|
|
|
|
32293
|
|
|
2
|
|
|
|
|
23
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
requires 'make_request'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '0.024'; # VERSION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub domain_create { |
15
|
0
|
|
|
0
|
1
|
|
state $check = compile(Object, |
16
|
|
|
|
|
|
|
Dict[ |
17
|
|
|
|
|
|
|
name => Str, |
18
|
|
|
|
|
|
|
ip_address => Str, |
19
|
|
|
|
|
|
|
], |
20
|
|
|
|
|
|
|
); |
21
|
0
|
|
|
|
|
|
my ($self, $opts) = $check->(@_); |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
|
return $self->make_request(POST => '/domains', $opts); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub domain_list { |
27
|
0
|
|
|
0
|
1
|
|
state $check = compile(Object); |
28
|
0
|
|
|
|
|
|
my ($self) = $check->(@_); |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
|
return $self->make_request(GET => '/domains'); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub domain_get { |
34
|
0
|
|
|
0
|
1
|
|
state $check = compile(Object, Str); |
35
|
0
|
|
|
|
|
|
my ($self, $domain) = $check->(@_); |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
return $self->make_request(GET => "/domains/$domain"); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub domain_delete { |
41
|
0
|
|
|
0
|
1
|
|
state $check = compile(Object, Str); |
42
|
0
|
|
|
|
|
|
my ($self, $domain) = $check->(@_); |
43
|
|
|
|
|
|
|
|
44
|
0
|
|
|
|
|
|
return $self->make_request(DELETE => "/domains/$domain"); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
__END__ |