line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package VM::HetznerCloud::API::Firewalls; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# ABSTRACT: Firewalls |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# --- |
6
|
|
|
|
|
|
|
# This class is auto-generated by bin/get_hetzner_info.pl |
7
|
|
|
|
|
|
|
# --- |
8
|
|
|
|
|
|
|
|
9
|
3
|
|
|
3
|
|
2152
|
use v5.24; |
|
3
|
|
|
|
|
13
|
|
10
|
|
|
|
|
|
|
|
11
|
3
|
|
|
3
|
|
20
|
use Moo; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
26
|
|
12
|
3
|
|
|
3
|
|
1048
|
use Types::Standard qw(:all); |
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
22
|
|
13
|
|
|
|
|
|
|
|
14
|
3
|
|
|
3
|
|
74557
|
use Mojo::Base -strict, -signatures; |
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
34
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
extends 'VM::HetznerCloud::APIBase'; |
17
|
|
|
|
|
|
|
|
18
|
3
|
|
|
3
|
|
1092
|
use utf8; |
|
3
|
|
|
|
|
13
|
|
|
3
|
|
|
|
|
22
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
our $VERSION = '0.0.3'; # VERSION |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
has endpoint => ( is => 'ro', isa => Str, default => sub { 'firewalls' } ); |
23
|
|
|
|
|
|
|
|
24
|
0
|
|
|
0
|
1
|
|
sub list ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
|
my $request_params = { |
26
|
|
|
|
|
|
|
'label_selector' => { |
27
|
|
|
|
|
|
|
'in' => 'query', |
28
|
|
|
|
|
|
|
'required' => 0, |
29
|
|
|
|
|
|
|
'validate' => 'string', |
30
|
|
|
|
|
|
|
}, |
31
|
|
|
|
|
|
|
'name' => { |
32
|
|
|
|
|
|
|
'in' => 'query', |
33
|
|
|
|
|
|
|
'required' => 0, |
34
|
|
|
|
|
|
|
'validate' => 'string', |
35
|
|
|
|
|
|
|
}, |
36
|
|
|
|
|
|
|
'sort' => { |
37
|
|
|
|
|
|
|
'in' => 'query', |
38
|
|
|
|
|
|
|
'required' => 0, |
39
|
|
|
|
|
|
|
'validate' => 'string', |
40
|
|
|
|
|
|
|
}, |
41
|
|
|
|
|
|
|
}; |
42
|
|
|
|
|
|
|
|
43
|
0
|
|
|
|
|
|
return $self->_request( '', \%params, $request_params, { type => 'get', oid => '/firewalls#get' } ); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
0
|
1
|
|
sub create ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
47
|
0
|
|
|
|
|
|
my $request_params = {}; |
48
|
0
|
|
|
|
|
|
return $self->_request( '', \%params, $request_params, { type => 'post', oid => '/firewalls#post' } ); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
0
|
|
|
0
|
1
|
|
sub delete ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
52
|
0
|
|
|
|
|
|
my $request_params = { |
53
|
|
|
|
|
|
|
'id' => { |
54
|
|
|
|
|
|
|
'in' => 'path', |
55
|
|
|
|
|
|
|
'required' => 1, |
56
|
|
|
|
|
|
|
'validate' => 'int64', |
57
|
|
|
|
|
|
|
}, |
58
|
|
|
|
|
|
|
}; |
59
|
|
|
|
|
|
|
|
60
|
0
|
|
|
|
|
|
return $self->_request( '/:id', \%params, $request_params, { type => 'delete', oid => '/firewalls/{id}#delete' } ); |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
0
|
|
|
0
|
1
|
|
sub get ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
64
|
0
|
|
|
|
|
|
my $request_params = { |
65
|
|
|
|
|
|
|
'id' => { |
66
|
|
|
|
|
|
|
'in' => 'path', |
67
|
|
|
|
|
|
|
'required' => 1, |
68
|
|
|
|
|
|
|
'validate' => 'int64', |
69
|
|
|
|
|
|
|
}, |
70
|
|
|
|
|
|
|
}; |
71
|
|
|
|
|
|
|
|
72
|
0
|
|
|
|
|
|
return $self->_request( '/:id', \%params, $request_params, { type => 'get', oid => '/firewalls/{id}#get' } ); |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
0
|
|
|
0
|
1
|
|
sub put ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
76
|
0
|
|
|
|
|
|
my $request_params = { |
77
|
|
|
|
|
|
|
'id' => { |
78
|
|
|
|
|
|
|
'in' => 'path', |
79
|
|
|
|
|
|
|
'required' => 1, |
80
|
|
|
|
|
|
|
'validate' => 'int64', |
81
|
|
|
|
|
|
|
}, |
82
|
|
|
|
|
|
|
}; |
83
|
|
|
|
|
|
|
|
84
|
0
|
|
|
|
|
|
return $self->_request( '/:id', \%params, $request_params, { type => 'put', oid => '/firewalls/{id}#put' } ); |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
0
|
|
|
0
|
1
|
|
sub list_actions ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
88
|
0
|
|
|
|
|
|
my $request_params = { |
89
|
|
|
|
|
|
|
'id' => { |
90
|
|
|
|
|
|
|
'in' => 'path', |
91
|
|
|
|
|
|
|
'required' => 1, |
92
|
|
|
|
|
|
|
'validate' => 'int64', |
93
|
|
|
|
|
|
|
}, |
94
|
|
|
|
|
|
|
'sort' => { |
95
|
|
|
|
|
|
|
'in' => 'query', |
96
|
|
|
|
|
|
|
'required' => 0, |
97
|
|
|
|
|
|
|
'validate' => 'string', |
98
|
|
|
|
|
|
|
}, |
99
|
|
|
|
|
|
|
'status' => { |
100
|
|
|
|
|
|
|
'in' => 'query', |
101
|
|
|
|
|
|
|
'required' => 0, |
102
|
|
|
|
|
|
|
'validate' => 'string', |
103
|
|
|
|
|
|
|
}, |
104
|
|
|
|
|
|
|
}; |
105
|
|
|
|
|
|
|
|
106
|
0
|
|
|
|
|
|
return $self->_request( '/:id/actions', \%params, $request_params, { type => 'get', oid => '/firewalls/{id}/actions#get' } ); |
107
|
|
|
|
|
|
|
} |
108
|
|
|
|
|
|
|
|
109
|
0
|
|
|
0
|
1
|
|
sub apply_to_resources ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
110
|
0
|
|
|
|
|
|
my $request_params = { |
111
|
|
|
|
|
|
|
'id' => { |
112
|
|
|
|
|
|
|
'in' => 'path', |
113
|
|
|
|
|
|
|
'required' => 1, |
114
|
|
|
|
|
|
|
'validate' => 'int64', |
115
|
|
|
|
|
|
|
}, |
116
|
|
|
|
|
|
|
}; |
117
|
|
|
|
|
|
|
|
118
|
0
|
|
|
|
|
|
return $self->_request( '/:id/actions/apply_to_resources', \%params, $request_params, { type => 'post', oid => '/firewalls/{id}/actions/apply_to_resources#post' } ); |
119
|
|
|
|
|
|
|
} |
120
|
|
|
|
|
|
|
|
121
|
0
|
|
|
0
|
1
|
|
sub remove_from_resources ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
122
|
0
|
|
|
|
|
|
my $request_params = { |
123
|
|
|
|
|
|
|
'id' => { |
124
|
|
|
|
|
|
|
'in' => 'path', |
125
|
|
|
|
|
|
|
'required' => 1, |
126
|
|
|
|
|
|
|
'validate' => 'int64', |
127
|
|
|
|
|
|
|
}, |
128
|
|
|
|
|
|
|
}; |
129
|
|
|
|
|
|
|
|
130
|
0
|
|
|
|
|
|
return $self->_request( '/:id/actions/remove_from_resources', \%params, $request_params, { type => 'post', oid => '/firewalls/{id}/actions/remove_from_resources#post' } ); |
131
|
|
|
|
|
|
|
} |
132
|
|
|
|
|
|
|
|
133
|
0
|
|
|
0
|
1
|
|
sub set_rules ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
134
|
0
|
|
|
|
|
|
my $request_params = { |
135
|
|
|
|
|
|
|
'id' => { |
136
|
|
|
|
|
|
|
'in' => 'path', |
137
|
|
|
|
|
|
|
'required' => 1, |
138
|
|
|
|
|
|
|
'validate' => 'int64', |
139
|
|
|
|
|
|
|
}, |
140
|
|
|
|
|
|
|
}; |
141
|
|
|
|
|
|
|
|
142
|
0
|
|
|
|
|
|
return $self->_request( '/:id/actions/set_rules', \%params, $request_params, { type => 'post', oid => '/firewalls/{id}/actions/set_rules#post' } ); |
143
|
|
|
|
|
|
|
} |
144
|
|
|
|
|
|
|
|
145
|
0
|
|
|
0
|
1
|
|
sub get_actions ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
146
|
0
|
|
|
|
|
|
my $request_params = { |
147
|
|
|
|
|
|
|
'action_id' => { |
148
|
|
|
|
|
|
|
'in' => 'path', |
149
|
|
|
|
|
|
|
'required' => 1, |
150
|
|
|
|
|
|
|
'validate' => 'int64', |
151
|
|
|
|
|
|
|
}, |
152
|
|
|
|
|
|
|
'id' => { |
153
|
|
|
|
|
|
|
'in' => 'path', |
154
|
|
|
|
|
|
|
'required' => 1, |
155
|
|
|
|
|
|
|
'validate' => 'int64', |
156
|
|
|
|
|
|
|
}, |
157
|
|
|
|
|
|
|
}; |
158
|
|
|
|
|
|
|
|
159
|
0
|
|
|
|
|
|
return $self->_request( '/:id/actions/:action_id', \%params, $request_params, { type => 'get', oid => '/firewalls/{id}/actions/{action_id}#get' } ); |
160
|
|
|
|
|
|
|
} |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
1; |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
__END__ |