line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WebService::DigitalOcean::Role::Domains; |
2
|
|
|
|
|
|
|
# ABSTRACT: Domains role for DigitalOcean WebService |
3
|
2
|
|
|
2
|
|
1352
|
use utf8; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
14
|
|
4
|
2
|
|
|
2
|
|
65
|
use Moo::Role; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
14
|
|
5
|
2
|
|
|
2
|
|
607
|
use feature 'state'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
287
|
|
6
|
2
|
|
|
2
|
|
14
|
use Types::Standard qw/Str Object Dict/; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
22
|
|
7
|
2
|
|
|
2
|
|
2625
|
use Type::Utils; |
|
2
|
|
|
|
|
8649
|
|
|
2
|
|
|
|
|
19
|
|
8
|
2
|
|
|
2
|
|
3501
|
use Type::Params qw/compile/; |
|
2
|
|
|
|
|
21905
|
|
|
2
|
|
|
|
|
21
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
requires 'make_request'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '0.026'; # 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__ |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=pod |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=encoding UTF-8 |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 NAME |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
WebService::DigitalOcean::Role::Domains - Domains role for DigitalOcean WebService |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 VERSION |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
version 0.026 |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 DESCRIPTION |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
Implements the domain methods. |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 METHODS |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head2 domain_create |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head2 domain_delete |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head2 domain_get |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head2 domain_list |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
See main documentation in L<WebService::DigitalOcean>. |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head1 AUTHOR |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
André Walker <andre@cpan.org> |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
This software is Copyright (c) 2015 by André Walker. |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
This is free software, licensed under: |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
The GNU General Public License, Version 2, June 1991 |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=cut |