line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package VM::HetznerCloud::API::LoadBalancers; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# ABSTRACT: LoadBalancers |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# --- |
6
|
|
|
|
|
|
|
# This class is auto-generated by bin/get_hetzner_info.pl |
7
|
|
|
|
|
|
|
# --- |
8
|
|
|
|
|
|
|
|
9
|
3
|
|
|
3
|
|
2030
|
use v5.24; |
|
3
|
|
|
|
|
10
|
|
10
|
|
|
|
|
|
|
|
11
|
3
|
|
|
3
|
|
26
|
use Moo; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
20
|
|
12
|
3
|
|
|
3
|
|
971
|
use Types::Standard qw(:all); |
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
22
|
|
13
|
|
|
|
|
|
|
|
14
|
3
|
|
|
3
|
|
70837
|
use Mojo::Base -strict, -signatures; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
30
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
extends 'VM::HetznerCloud::APIBase'; |
17
|
|
|
|
|
|
|
|
18
|
3
|
|
|
3
|
|
809
|
use utf8; |
|
3
|
|
|
|
|
10
|
|
|
3
|
|
|
|
|
14
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
our $VERSION = '0.0.3'; # VERSION |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
has endpoint => ( is => 'ro', isa => Str, default => sub { 'load_balancers' } ); |
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 => '/load_balancers#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 => '/load_balancers#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 => '/load_balancers/{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 => '/load_balancers/{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 => '/load_balancers/{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 => '/load_balancers/{id}/actions#get' } ); |
107
|
|
|
|
|
|
|
} |
108
|
|
|
|
|
|
|
|
109
|
0
|
|
|
0
|
1
|
|
sub add_service ($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/add_service', \%params, $request_params, { type => 'post', oid => '/load_balancers/{id}/actions/add_service#post' } ); |
119
|
|
|
|
|
|
|
} |
120
|
|
|
|
|
|
|
|
121
|
0
|
|
|
0
|
1
|
|
sub add_target ($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/add_target', \%params, $request_params, { type => 'post', oid => '/load_balancers/{id}/actions/add_target#post' } ); |
131
|
|
|
|
|
|
|
} |
132
|
|
|
|
|
|
|
|
133
|
0
|
|
|
0
|
1
|
|
sub attach_to_network ($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/attach_to_network', \%params, $request_params, { type => 'post', oid => '/load_balancers/{id}/actions/attach_to_network#post' } ); |
143
|
|
|
|
|
|
|
} |
144
|
|
|
|
|
|
|
|
145
|
0
|
|
|
0
|
1
|
|
sub change_algorithm ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
146
|
0
|
|
|
|
|
|
my $request_params = { |
147
|
|
|
|
|
|
|
'id' => { |
148
|
|
|
|
|
|
|
'in' => 'path', |
149
|
|
|
|
|
|
|
'required' => 1, |
150
|
|
|
|
|
|
|
'validate' => 'int64', |
151
|
|
|
|
|
|
|
}, |
152
|
|
|
|
|
|
|
}; |
153
|
|
|
|
|
|
|
|
154
|
0
|
|
|
|
|
|
return $self->_request( '/:id/actions/change_algorithm', \%params, $request_params, { type => 'post', oid => '/load_balancers/{id}/actions/change_algorithm#post' } ); |
155
|
|
|
|
|
|
|
} |
156
|
|
|
|
|
|
|
|
157
|
0
|
|
|
0
|
1
|
|
sub change_dns_ptr ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
158
|
0
|
|
|
|
|
|
my $request_params = { |
159
|
|
|
|
|
|
|
'id' => { |
160
|
|
|
|
|
|
|
'in' => 'path', |
161
|
|
|
|
|
|
|
'required' => 1, |
162
|
|
|
|
|
|
|
'validate' => 'int64', |
163
|
|
|
|
|
|
|
}, |
164
|
|
|
|
|
|
|
}; |
165
|
|
|
|
|
|
|
|
166
|
0
|
|
|
|
|
|
return $self->_request( '/:id/actions/change_dns_ptr', \%params, $request_params, { type => 'post', oid => '/load_balancers/{id}/actions/change_dns_ptr#post' } ); |
167
|
|
|
|
|
|
|
} |
168
|
|
|
|
|
|
|
|
169
|
0
|
|
|
0
|
1
|
|
sub change_protection ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
170
|
0
|
|
|
|
|
|
my $request_params = { |
171
|
|
|
|
|
|
|
'id' => { |
172
|
|
|
|
|
|
|
'in' => 'path', |
173
|
|
|
|
|
|
|
'required' => 1, |
174
|
|
|
|
|
|
|
'validate' => 'int64', |
175
|
|
|
|
|
|
|
}, |
176
|
|
|
|
|
|
|
}; |
177
|
|
|
|
|
|
|
|
178
|
0
|
|
|
|
|
|
return $self->_request( '/:id/actions/change_protection', \%params, $request_params, { type => 'post', oid => '/load_balancers/{id}/actions/change_protection#post' } ); |
179
|
|
|
|
|
|
|
} |
180
|
|
|
|
|
|
|
|
181
|
0
|
|
|
0
|
1
|
|
sub change_type ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
182
|
0
|
|
|
|
|
|
my $request_params = { |
183
|
|
|
|
|
|
|
'id' => { |
184
|
|
|
|
|
|
|
'in' => 'path', |
185
|
|
|
|
|
|
|
'required' => 1, |
186
|
|
|
|
|
|
|
'validate' => 'int64', |
187
|
|
|
|
|
|
|
}, |
188
|
|
|
|
|
|
|
}; |
189
|
|
|
|
|
|
|
|
190
|
0
|
|
|
|
|
|
return $self->_request( '/:id/actions/change_type', \%params, $request_params, { type => 'post', oid => '/load_balancers/{id}/actions/change_type#post' } ); |
191
|
|
|
|
|
|
|
} |
192
|
|
|
|
|
|
|
|
193
|
0
|
|
|
0
|
1
|
|
sub delete_service ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
194
|
0
|
|
|
|
|
|
my $request_params = { |
195
|
|
|
|
|
|
|
'id' => { |
196
|
|
|
|
|
|
|
'in' => 'path', |
197
|
|
|
|
|
|
|
'required' => 1, |
198
|
|
|
|
|
|
|
'validate' => 'int64', |
199
|
|
|
|
|
|
|
}, |
200
|
|
|
|
|
|
|
}; |
201
|
|
|
|
|
|
|
|
202
|
0
|
|
|
|
|
|
return $self->_request( '/:id/actions/delete_service', \%params, $request_params, { type => 'post', oid => '/load_balancers/{id}/actions/delete_service#post' } ); |
203
|
|
|
|
|
|
|
} |
204
|
|
|
|
|
|
|
|
205
|
0
|
|
|
0
|
1
|
|
sub detach_from_network ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
206
|
0
|
|
|
|
|
|
my $request_params = { |
207
|
|
|
|
|
|
|
'id' => { |
208
|
|
|
|
|
|
|
'in' => 'path', |
209
|
|
|
|
|
|
|
'required' => 1, |
210
|
|
|
|
|
|
|
'validate' => 'int64', |
211
|
|
|
|
|
|
|
}, |
212
|
|
|
|
|
|
|
}; |
213
|
|
|
|
|
|
|
|
214
|
0
|
|
|
|
|
|
return $self->_request( '/:id/actions/detach_from_network', \%params, $request_params, { type => 'post', oid => '/load_balancers/{id}/actions/detach_from_network#post' } ); |
215
|
|
|
|
|
|
|
} |
216
|
|
|
|
|
|
|
|
217
|
0
|
|
|
0
|
1
|
|
sub disable_public_interface ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
218
|
0
|
|
|
|
|
|
my $request_params = { |
219
|
|
|
|
|
|
|
'id' => { |
220
|
|
|
|
|
|
|
'in' => 'path', |
221
|
|
|
|
|
|
|
'required' => 1, |
222
|
|
|
|
|
|
|
'validate' => 'int64', |
223
|
|
|
|
|
|
|
}, |
224
|
|
|
|
|
|
|
}; |
225
|
|
|
|
|
|
|
|
226
|
0
|
|
|
|
|
|
return $self->_request( '/:id/actions/disable_public_interface', \%params, $request_params, { type => 'post', oid => '/load_balancers/{id}/actions/disable_public_interface#post' } ); |
227
|
|
|
|
|
|
|
} |
228
|
|
|
|
|
|
|
|
229
|
0
|
|
|
0
|
1
|
|
sub enable_public_interface ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
230
|
0
|
|
|
|
|
|
my $request_params = { |
231
|
|
|
|
|
|
|
'id' => { |
232
|
|
|
|
|
|
|
'in' => 'path', |
233
|
|
|
|
|
|
|
'required' => 1, |
234
|
|
|
|
|
|
|
'validate' => 'int64', |
235
|
|
|
|
|
|
|
}, |
236
|
|
|
|
|
|
|
}; |
237
|
|
|
|
|
|
|
|
238
|
0
|
|
|
|
|
|
return $self->_request( '/:id/actions/enable_public_interface', \%params, $request_params, { type => 'post', oid => '/load_balancers/{id}/actions/enable_public_interface#post' } ); |
239
|
|
|
|
|
|
|
} |
240
|
|
|
|
|
|
|
|
241
|
0
|
|
|
0
|
1
|
|
sub remove_target ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
242
|
0
|
|
|
|
|
|
my $request_params = { |
243
|
|
|
|
|
|
|
'id' => { |
244
|
|
|
|
|
|
|
'in' => 'path', |
245
|
|
|
|
|
|
|
'required' => 1, |
246
|
|
|
|
|
|
|
'validate' => 'int64', |
247
|
|
|
|
|
|
|
}, |
248
|
|
|
|
|
|
|
}; |
249
|
|
|
|
|
|
|
|
250
|
0
|
|
|
|
|
|
return $self->_request( '/:id/actions/remove_target', \%params, $request_params, { type => 'post', oid => '/load_balancers/{id}/actions/remove_target#post' } ); |
251
|
|
|
|
|
|
|
} |
252
|
|
|
|
|
|
|
|
253
|
0
|
|
|
0
|
1
|
|
sub update_service ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
254
|
0
|
|
|
|
|
|
my $request_params = { |
255
|
|
|
|
|
|
|
'id' => { |
256
|
|
|
|
|
|
|
'in' => 'path', |
257
|
|
|
|
|
|
|
'required' => 1, |
258
|
|
|
|
|
|
|
'validate' => 'int64', |
259
|
|
|
|
|
|
|
}, |
260
|
|
|
|
|
|
|
}; |
261
|
|
|
|
|
|
|
|
262
|
0
|
|
|
|
|
|
return $self->_request( '/:id/actions/update_service', \%params, $request_params, { type => 'post', oid => '/load_balancers/{id}/actions/update_service#post' } ); |
263
|
|
|
|
|
|
|
} |
264
|
|
|
|
|
|
|
|
265
|
0
|
|
|
0
|
1
|
|
sub get_actions ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
266
|
0
|
|
|
|
|
|
my $request_params = { |
267
|
|
|
|
|
|
|
'action_id' => { |
268
|
|
|
|
|
|
|
'in' => 'path', |
269
|
|
|
|
|
|
|
'required' => 1, |
270
|
|
|
|
|
|
|
'validate' => 'int64', |
271
|
|
|
|
|
|
|
}, |
272
|
|
|
|
|
|
|
'id' => { |
273
|
|
|
|
|
|
|
'in' => 'path', |
274
|
|
|
|
|
|
|
'required' => 1, |
275
|
|
|
|
|
|
|
'validate' => 'int64', |
276
|
|
|
|
|
|
|
}, |
277
|
|
|
|
|
|
|
}; |
278
|
|
|
|
|
|
|
|
279
|
0
|
|
|
|
|
|
return $self->_request( '/:id/actions/:action_id', \%params, $request_params, { type => 'get', oid => '/load_balancers/{id}/actions/{action_id}#get' } ); |
280
|
|
|
|
|
|
|
} |
281
|
|
|
|
|
|
|
|
282
|
0
|
|
|
0
|
1
|
|
sub list_metrics ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
283
|
0
|
|
|
|
|
|
my $request_params = { |
284
|
|
|
|
|
|
|
'end' => { |
285
|
|
|
|
|
|
|
'in' => 'query', |
286
|
|
|
|
|
|
|
'required' => 1, |
287
|
|
|
|
|
|
|
'validate' => 'string', |
288
|
|
|
|
|
|
|
}, |
289
|
|
|
|
|
|
|
'id' => { |
290
|
|
|
|
|
|
|
'in' => 'path', |
291
|
|
|
|
|
|
|
'required' => 1, |
292
|
|
|
|
|
|
|
'validate' => 'int64', |
293
|
|
|
|
|
|
|
}, |
294
|
|
|
|
|
|
|
'start' => { |
295
|
|
|
|
|
|
|
'in' => 'query', |
296
|
|
|
|
|
|
|
'required' => 1, |
297
|
|
|
|
|
|
|
'validate' => 'string', |
298
|
|
|
|
|
|
|
}, |
299
|
|
|
|
|
|
|
'step' => { |
300
|
|
|
|
|
|
|
'in' => 'query', |
301
|
|
|
|
|
|
|
'required' => 0, |
302
|
|
|
|
|
|
|
'validate' => 'string', |
303
|
|
|
|
|
|
|
}, |
304
|
|
|
|
|
|
|
'type' => { |
305
|
|
|
|
|
|
|
'in' => 'query', |
306
|
|
|
|
|
|
|
'required' => 1, |
307
|
|
|
|
|
|
|
'validate' => 'string', |
308
|
|
|
|
|
|
|
}, |
309
|
|
|
|
|
|
|
}; |
310
|
|
|
|
|
|
|
|
311
|
0
|
|
|
|
|
|
return $self->_request( '/:id/metrics', \%params, $request_params, { type => 'get', oid => '/load_balancers/{id}/metrics#get' } ); |
312
|
|
|
|
|
|
|
} |
313
|
|
|
|
|
|
|
|
314
|
|
|
|
|
|
|
|
315
|
|
|
|
|
|
|
1; |
316
|
|
|
|
|
|
|
|
317
|
|
|
|
|
|
|
__END__ |