line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package VM::HetznerCloud::API::Networks; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# ABSTRACT: Networks |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# --- |
6
|
|
|
|
|
|
|
# This class is auto-generated by bin/get_hetzner_info.pl |
7
|
|
|
|
|
|
|
# --- |
8
|
|
|
|
|
|
|
|
9
|
3
|
|
|
3
|
|
1766
|
use v5.24; |
|
3
|
|
|
|
|
22
|
|
10
|
|
|
|
|
|
|
|
11
|
3
|
|
|
3
|
|
22
|
use Moo; |
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
19
|
|
12
|
3
|
|
|
3
|
|
956
|
use Types::Standard qw(:all); |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
21
|
|
13
|
|
|
|
|
|
|
|
14
|
3
|
|
|
3
|
|
71152
|
use Mojo::Base -strict, -signatures; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
64
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
extends 'VM::HetznerCloud::APIBase'; |
17
|
|
|
|
|
|
|
|
18
|
3
|
|
|
3
|
|
734
|
use utf8; |
|
3
|
|
|
|
|
10
|
|
|
3
|
|
|
|
|
13
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
our $VERSION = '0.0.3'; # VERSION |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
has endpoint => ( is => 'ro', isa => Str, default => sub { 'networks' } ); |
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
|
|
|
|
|
|
|
}; |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
return $self->_request( '', \%params, $request_params, { type => 'get', oid => '/networks#get' } ); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
0
|
1
|
|
sub create ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
42
|
0
|
|
|
|
|
|
my $request_params = {}; |
43
|
0
|
|
|
|
|
|
return $self->_request( '', \%params, $request_params, { type => 'post', oid => '/networks#post' } ); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
0
|
1
|
|
sub delete ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
47
|
0
|
|
|
|
|
|
my $request_params = { |
48
|
|
|
|
|
|
|
'id' => { |
49
|
|
|
|
|
|
|
'in' => 'path', |
50
|
|
|
|
|
|
|
'required' => 1, |
51
|
|
|
|
|
|
|
'validate' => 'int64', |
52
|
|
|
|
|
|
|
}, |
53
|
|
|
|
|
|
|
}; |
54
|
|
|
|
|
|
|
|
55
|
0
|
|
|
|
|
|
return $self->_request( '/:id', \%params, $request_params, { type => 'delete', oid => '/networks/{id}#delete' } ); |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
0
|
|
|
0
|
1
|
|
sub get ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
59
|
0
|
|
|
|
|
|
my $request_params = { |
60
|
|
|
|
|
|
|
'id' => { |
61
|
|
|
|
|
|
|
'in' => 'path', |
62
|
|
|
|
|
|
|
'required' => 1, |
63
|
|
|
|
|
|
|
'validate' => 'int64', |
64
|
|
|
|
|
|
|
}, |
65
|
|
|
|
|
|
|
}; |
66
|
|
|
|
|
|
|
|
67
|
0
|
|
|
|
|
|
return $self->_request( '/:id', \%params, $request_params, { type => 'get', oid => '/networks/{id}#get' } ); |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
0
|
|
|
0
|
1
|
|
sub put ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
71
|
0
|
|
|
|
|
|
my $request_params = { |
72
|
|
|
|
|
|
|
'id' => { |
73
|
|
|
|
|
|
|
'in' => 'path', |
74
|
|
|
|
|
|
|
'required' => 1, |
75
|
|
|
|
|
|
|
'validate' => 'int64', |
76
|
|
|
|
|
|
|
}, |
77
|
|
|
|
|
|
|
}; |
78
|
|
|
|
|
|
|
|
79
|
0
|
|
|
|
|
|
return $self->_request( '/:id', \%params, $request_params, { type => 'put', oid => '/networks/{id}#put' } ); |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
0
|
|
|
0
|
1
|
|
sub list_actions ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
83
|
0
|
|
|
|
|
|
my $request_params = { |
84
|
|
|
|
|
|
|
'id' => { |
85
|
|
|
|
|
|
|
'in' => 'path', |
86
|
|
|
|
|
|
|
'required' => 1, |
87
|
|
|
|
|
|
|
'validate' => 'int64', |
88
|
|
|
|
|
|
|
}, |
89
|
|
|
|
|
|
|
'sort' => { |
90
|
|
|
|
|
|
|
'in' => 'query', |
91
|
|
|
|
|
|
|
'required' => 0, |
92
|
|
|
|
|
|
|
'validate' => 'string', |
93
|
|
|
|
|
|
|
}, |
94
|
|
|
|
|
|
|
'status' => { |
95
|
|
|
|
|
|
|
'in' => 'query', |
96
|
|
|
|
|
|
|
'required' => 0, |
97
|
|
|
|
|
|
|
'validate' => 'string', |
98
|
|
|
|
|
|
|
}, |
99
|
|
|
|
|
|
|
}; |
100
|
|
|
|
|
|
|
|
101
|
0
|
|
|
|
|
|
return $self->_request( '/:id/actions', \%params, $request_params, { type => 'get', oid => '/networks/{id}/actions#get' } ); |
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
|
104
|
0
|
|
|
0
|
1
|
|
sub add_route ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
105
|
0
|
|
|
|
|
|
my $request_params = { |
106
|
|
|
|
|
|
|
'id' => { |
107
|
|
|
|
|
|
|
'in' => 'path', |
108
|
|
|
|
|
|
|
'required' => 1, |
109
|
|
|
|
|
|
|
'validate' => 'int64', |
110
|
|
|
|
|
|
|
}, |
111
|
|
|
|
|
|
|
}; |
112
|
|
|
|
|
|
|
|
113
|
0
|
|
|
|
|
|
return $self->_request( '/:id/actions/add_route', \%params, $request_params, { type => 'post', oid => '/networks/{id}/actions/add_route#post' } ); |
114
|
|
|
|
|
|
|
} |
115
|
|
|
|
|
|
|
|
116
|
0
|
|
|
0
|
1
|
|
sub add_subnet ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
117
|
0
|
|
|
|
|
|
my $request_params = { |
118
|
|
|
|
|
|
|
'id' => { |
119
|
|
|
|
|
|
|
'in' => 'path', |
120
|
|
|
|
|
|
|
'required' => 1, |
121
|
|
|
|
|
|
|
'validate' => 'int64', |
122
|
|
|
|
|
|
|
}, |
123
|
|
|
|
|
|
|
}; |
124
|
|
|
|
|
|
|
|
125
|
0
|
|
|
|
|
|
return $self->_request( '/:id/actions/add_subnet', \%params, $request_params, { type => 'post', oid => '/networks/{id}/actions/add_subnet#post' } ); |
126
|
|
|
|
|
|
|
} |
127
|
|
|
|
|
|
|
|
128
|
0
|
|
|
0
|
1
|
|
sub change_ip_range ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
129
|
0
|
|
|
|
|
|
my $request_params = { |
130
|
|
|
|
|
|
|
'id' => { |
131
|
|
|
|
|
|
|
'in' => 'path', |
132
|
|
|
|
|
|
|
'required' => 1, |
133
|
|
|
|
|
|
|
'validate' => 'int64', |
134
|
|
|
|
|
|
|
}, |
135
|
|
|
|
|
|
|
}; |
136
|
|
|
|
|
|
|
|
137
|
0
|
|
|
|
|
|
return $self->_request( '/:id/actions/change_ip_range', \%params, $request_params, { type => 'post', oid => '/networks/{id}/actions/change_ip_range#post' } ); |
138
|
|
|
|
|
|
|
} |
139
|
|
|
|
|
|
|
|
140
|
0
|
|
|
0
|
1
|
|
sub change_protection ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
141
|
0
|
|
|
|
|
|
my $request_params = { |
142
|
|
|
|
|
|
|
'id' => { |
143
|
|
|
|
|
|
|
'in' => 'path', |
144
|
|
|
|
|
|
|
'required' => 1, |
145
|
|
|
|
|
|
|
'validate' => 'int64', |
146
|
|
|
|
|
|
|
}, |
147
|
|
|
|
|
|
|
}; |
148
|
|
|
|
|
|
|
|
149
|
0
|
|
|
|
|
|
return $self->_request( '/:id/actions/change_protection', \%params, $request_params, { type => 'post', oid => '/networks/{id}/actions/change_protection#post' } ); |
150
|
|
|
|
|
|
|
} |
151
|
|
|
|
|
|
|
|
152
|
0
|
|
|
0
|
1
|
|
sub delete_route ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
153
|
0
|
|
|
|
|
|
my $request_params = { |
154
|
|
|
|
|
|
|
'id' => { |
155
|
|
|
|
|
|
|
'in' => 'path', |
156
|
|
|
|
|
|
|
'required' => 1, |
157
|
|
|
|
|
|
|
'validate' => 'int64', |
158
|
|
|
|
|
|
|
}, |
159
|
|
|
|
|
|
|
}; |
160
|
|
|
|
|
|
|
|
161
|
0
|
|
|
|
|
|
return $self->_request( '/:id/actions/delete_route', \%params, $request_params, { type => 'post', oid => '/networks/{id}/actions/delete_route#post' } ); |
162
|
|
|
|
|
|
|
} |
163
|
|
|
|
|
|
|
|
164
|
0
|
|
|
0
|
1
|
|
sub delete_subnet ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
165
|
0
|
|
|
|
|
|
my $request_params = { |
166
|
|
|
|
|
|
|
'id' => { |
167
|
|
|
|
|
|
|
'in' => 'path', |
168
|
|
|
|
|
|
|
'required' => 1, |
169
|
|
|
|
|
|
|
'validate' => 'int64', |
170
|
|
|
|
|
|
|
}, |
171
|
|
|
|
|
|
|
}; |
172
|
|
|
|
|
|
|
|
173
|
0
|
|
|
|
|
|
return $self->_request( '/:id/actions/delete_subnet', \%params, $request_params, { type => 'post', oid => '/networks/{id}/actions/delete_subnet#post' } ); |
174
|
|
|
|
|
|
|
} |
175
|
|
|
|
|
|
|
|
176
|
0
|
|
|
0
|
1
|
|
sub get_actions ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
177
|
0
|
|
|
|
|
|
my $request_params = { |
178
|
|
|
|
|
|
|
'action_id' => { |
179
|
|
|
|
|
|
|
'in' => 'path', |
180
|
|
|
|
|
|
|
'required' => 1, |
181
|
|
|
|
|
|
|
'validate' => 'int64', |
182
|
|
|
|
|
|
|
}, |
183
|
|
|
|
|
|
|
'id' => { |
184
|
|
|
|
|
|
|
'in' => 'path', |
185
|
|
|
|
|
|
|
'required' => 1, |
186
|
|
|
|
|
|
|
'validate' => 'int64', |
187
|
|
|
|
|
|
|
}, |
188
|
|
|
|
|
|
|
}; |
189
|
|
|
|
|
|
|
|
190
|
0
|
|
|
|
|
|
return $self->_request( '/:id/actions/:action_id', \%params, $request_params, { type => 'get', oid => '/networks/{id}/actions/{action_id}#get' } ); |
191
|
|
|
|
|
|
|
} |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
1; |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
__END__ |