| 1 | package VM::HetznerCloud::API::Servers; | ||
| 2 | |||
| 3 | # ABSTRACT: Servers | ||
| 4 | |||
| 5 | # --- | ||
| 6 | # This class is auto-generated by bin/get_hetzner_info.pl | ||
| 7 | # --- | ||
| 8 | |||
| 9 | 4 | ▶ | use v5.24; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | 4 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | 4 | ▶ | use Types::Standard qw(:all); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | |||
| 14 | 4 | ▶ | use Mojo::Base -strict, -signatures; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 15 | |||
| 16 | 4 | extends 'VM::HetznerCloud::APIBase'; | |
| 17 | |||
| 18 | 4 | ▶ | use utf8; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 19 | |||
| 20 | 4 | our $VERSION = '0.0.3'; # VERSION | |
| 21 | |||
| 22 | 4 | ▶ | has endpoint => ( is => 'ro', isa => Str, default => sub { 'servers' } ); |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 23 | |||
| 24 | 4 | ▶ | sub list ($self, %params) { |
|
Subroutine
list: called CC=1 SCAR=0.0
Pod
documented
| |||
| 25 | 4 | 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 | 'status' => { | ||
| 42 | 'in' => 'query', | ||
| 43 | 'required' => 0, | ||
| 44 | 'validate' => 'string', | ||
| 45 | }, | ||
| 46 | }; | ||
| 47 | |||
| 48 | 4 | return $self->_request( '', \%params, $request_params, { type => 'get', oid => '/servers#get' } ); | |
| 49 | } | ||
| 50 | |||
| 51 | 0 | ▶ | sub create ($self, %params) { |
|
Subroutine
create: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 52 | 0 | my $request_params = {}; | |
| 53 | 0 | return $self->_request( '', \%params, $request_params, { type => 'post', oid => '/servers#post' } ); | |
| 54 | } | ||
| 55 | |||
| 56 | 0 | ▶ | sub delete ($self, %params) { |
|
Subroutine
delete: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 57 | 0 | my $request_params = { | |
| 58 | 'id' => { | ||
| 59 | 'in' => 'path', | ||
| 60 | 'required' => 1, | ||
| 61 | 'validate' => 'int64', | ||
| 62 | }, | ||
| 63 | }; | ||
| 64 | |||
| 65 | 0 | return $self->_request( '/:id', \%params, $request_params, { type => 'delete', oid => '/servers/{id}#delete' } ); | |
| 66 | } | ||
| 67 | |||
| 68 | 3 | ▶ | sub get ($self, %params) { |
|
Subroutine
get: called CC=1 SCAR=0.0
Pod
documented
| |||
| 69 | 3 | my $request_params = { | |
| 70 | 'id' => { | ||
| 71 | 'in' => 'path', | ||
| 72 | 'required' => 1, | ||
| 73 | 'validate' => 'int64', | ||
| 74 | }, | ||
| 75 | }; | ||
| 76 | |||
| 77 | 3 | return $self->_request( '/:id', \%params, $request_params, { type => 'get', oid => '/servers/{id}#get' } ); | |
| 78 | } | ||
| 79 | |||
| 80 | 0 | ▶ | sub put ($self, %params) { |
|
Subroutine
put: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 81 | 0 | my $request_params = { | |
| 82 | 'id' => { | ||
| 83 | 'in' => 'path', | ||
| 84 | 'required' => 1, | ||
| 85 | 'validate' => 'int64', | ||
| 86 | }, | ||
| 87 | }; | ||
| 88 | |||
| 89 | 0 | return $self->_request( '/:id', \%params, $request_params, { type => 'put', oid => '/servers/{id}#put' } ); | |
| 90 | } | ||
| 91 | |||
| 92 | 0 | ▶ | sub list_actions ($self, %params) { |
|
Subroutine
list_actions: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 93 | 0 | my $request_params = { | |
| 94 | 'id' => { | ||
| 95 | 'in' => 'path', | ||
| 96 | 'required' => 1, | ||
| 97 | 'validate' => 'int64', | ||
| 98 | }, | ||
| 99 | 'sort' => { | ||
| 100 | 'in' => 'query', | ||
| 101 | 'required' => 0, | ||
| 102 | 'validate' => 'string', | ||
| 103 | }, | ||
| 104 | 'status' => { | ||
| 105 | 'in' => 'query', | ||
| 106 | 'required' => 0, | ||
| 107 | 'validate' => 'string', | ||
| 108 | }, | ||
| 109 | }; | ||
| 110 | |||
| 111 | 0 | return $self->_request( '/:id/actions', \%params, $request_params, { type => 'get', oid => '/servers/{id}/actions#get' } ); | |
| 112 | } | ||
| 113 | |||
| 114 | 0 | ▶ | sub add_to_placement_group ($self, %params) { |
|
Subroutine
add_to_placement_group: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 115 | 0 | my $request_params = { | |
| 116 | 'id' => { | ||
| 117 | 'in' => 'path', | ||
| 118 | 'required' => 1, | ||
| 119 | 'validate' => 'int64', | ||
| 120 | }, | ||
| 121 | }; | ||
| 122 | |||
| 123 | 0 | return $self->_request( '/:id/actions/add_to_placement_group', \%params, $request_params, { type => 'post', oid => '/servers/{id}/actions/add_to_placement_group#post' } ); | |
| 124 | } | ||
| 125 | |||
| 126 | 0 | ▶ | sub attach_iso ($self, %params) { |
|
Subroutine
attach_iso: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 127 | 0 | my $request_params = { | |
| 128 | 'id' => { | ||
| 129 | 'in' => 'path', | ||
| 130 | 'required' => 1, | ||
| 131 | 'validate' => 'int64', | ||
| 132 | }, | ||
| 133 | }; | ||
| 134 | |||
| 135 | 0 | return $self->_request( '/:id/actions/attach_iso', \%params, $request_params, { type => 'post', oid => '/servers/{id}/actions/attach_iso#post' } ); | |
| 136 | } | ||
| 137 | |||
| 138 | 0 | ▶ | sub attach_to_network ($self, %params) { |
|
Subroutine
attach_to_network: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 139 | 0 | my $request_params = { | |
| 140 | 'id' => { | ||
| 141 | 'in' => 'path', | ||
| 142 | 'required' => 1, | ||
| 143 | 'validate' => 'int64', | ||
| 144 | }, | ||
| 145 | }; | ||
| 146 | |||
| 147 | 0 | return $self->_request( '/:id/actions/attach_to_network', \%params, $request_params, { type => 'post', oid => '/servers/{id}/actions/attach_to_network#post' } ); | |
| 148 | } | ||
| 149 | |||
| 150 | 0 | ▶ | sub change_alias_ips ($self, %params) { |
|
Subroutine
change_alias_ips: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 151 | 0 | my $request_params = { | |
| 152 | 'id' => { | ||
| 153 | 'in' => 'path', | ||
| 154 | 'required' => 1, | ||
| 155 | 'validate' => 'int64', | ||
| 156 | }, | ||
| 157 | }; | ||
| 158 | |||
| 159 | 0 | return $self->_request( '/:id/actions/change_alias_ips', \%params, $request_params, { type => 'post', oid => '/servers/{id}/actions/change_alias_ips#post' } ); | |
| 160 | } | ||
| 161 | |||
| 162 | 0 | ▶ | sub change_dns_ptr ($self, %params) { |
|
Subroutine
change_dns_ptr: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 163 | 0 | my $request_params = { | |
| 164 | 'id' => { | ||
| 165 | 'in' => 'path', | ||
| 166 | 'required' => 1, | ||
| 167 | 'validate' => 'int64', | ||
| 168 | }, | ||
| 169 | }; | ||
| 170 | |||
| 171 | 0 | return $self->_request( '/:id/actions/change_dns_ptr', \%params, $request_params, { type => 'post', oid => '/servers/{id}/actions/change_dns_ptr#post' } ); | |
| 172 | } | ||
| 173 | |||
| 174 | 0 | ▶ | sub change_protection ($self, %params) { |
|
Subroutine
change_protection: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 175 | 0 | my $request_params = { | |
| 176 | 'id' => { | ||
| 177 | 'in' => 'path', | ||
| 178 | 'required' => 1, | ||
| 179 | 'validate' => 'int64', | ||
| 180 | }, | ||
| 181 | }; | ||
| 182 | |||
| 183 | 0 | return $self->_request( '/:id/actions/change_protection', \%params, $request_params, { type => 'post', oid => '/servers/{id}/actions/change_protection#post' } ); | |
| 184 | } | ||
| 185 | |||
| 186 | 0 | ▶ | sub change_type ($self, %params) { |
|
Subroutine
change_type: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 187 | 0 | my $request_params = { | |
| 188 | 'id' => { | ||
| 189 | 'in' => 'path', | ||
| 190 | 'required' => 1, | ||
| 191 | 'validate' => 'int64', | ||
| 192 | }, | ||
| 193 | }; | ||
| 194 | |||
| 195 | 0 | return $self->_request( '/:id/actions/change_type', \%params, $request_params, { type => 'post', oid => '/servers/{id}/actions/change_type#post' } ); | |
| 196 | } | ||
| 197 | |||
| 198 | 0 | ▶ | sub create_image ($self, %params) { |
|
Subroutine
create_image: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 199 | 0 | my $request_params = { | |
| 200 | 'id' => { | ||
| 201 | 'in' => 'path', | ||
| 202 | 'required' => 1, | ||
| 203 | 'validate' => 'int64', | ||
| 204 | }, | ||
| 205 | }; | ||
| 206 | |||
| 207 | 0 | return $self->_request( '/:id/actions/create_image', \%params, $request_params, { type => 'post', oid => '/servers/{id}/actions/create_image#post' } ); | |
| 208 | } | ||
| 209 | |||
| 210 | 0 | ▶ | sub detach_from_network ($self, %params) { |
|
Subroutine
detach_from_network: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 211 | 0 | my $request_params = { | |
| 212 | 'id' => { | ||
| 213 | 'in' => 'path', | ||
| 214 | 'required' => 1, | ||
| 215 | 'validate' => 'int64', | ||
| 216 | }, | ||
| 217 | }; | ||
| 218 | |||
| 219 | 0 | return $self->_request( '/:id/actions/detach_from_network', \%params, $request_params, { type => 'post', oid => '/servers/{id}/actions/detach_from_network#post' } ); | |
| 220 | } | ||
| 221 | |||
| 222 | 0 | ▶ | sub detach_iso ($self, %params) { |
|
Subroutine
detach_iso: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 223 | 0 | my $request_params = { | |
| 224 | 'id' => { | ||
| 225 | 'in' => 'path', | ||
| 226 | 'required' => 1, | ||
| 227 | 'validate' => 'int64', | ||
| 228 | }, | ||
| 229 | }; | ||
| 230 | |||
| 231 | 0 | return $self->_request( '/:id/actions/detach_iso', \%params, $request_params, { type => 'post', oid => '/servers/{id}/actions/detach_iso#post' } ); | |
| 232 | } | ||
| 233 | |||
| 234 | 0 | ▶ | sub disable_backup ($self, %params) { |
|
Subroutine
disable_backup: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 235 | 0 | my $request_params = { | |
| 236 | 'id' => { | ||
| 237 | 'in' => 'path', | ||
| 238 | 'required' => 1, | ||
| 239 | 'validate' => 'int64', | ||
| 240 | }, | ||
| 241 | }; | ||
| 242 | |||
| 243 | 0 | return $self->_request( '/:id/actions/disable_backup', \%params, $request_params, { type => 'post', oid => '/servers/{id}/actions/disable_backup#post' } ); | |
| 244 | } | ||
| 245 | |||
| 246 | 0 | ▶ | sub disable_rescue ($self, %params) { |
|
Subroutine
disable_rescue: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 247 | 0 | my $request_params = { | |
| 248 | 'id' => { | ||
| 249 | 'in' => 'path', | ||
| 250 | 'required' => 1, | ||
| 251 | 'validate' => 'int64', | ||
| 252 | }, | ||
| 253 | }; | ||
| 254 | |||
| 255 | 0 | return $self->_request( '/:id/actions/disable_rescue', \%params, $request_params, { type => 'post', oid => '/servers/{id}/actions/disable_rescue#post' } ); | |
| 256 | } | ||
| 257 | |||
| 258 | 0 | ▶ | sub enable_backup ($self, %params) { |
|
Subroutine
enable_backup: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 259 | 0 | my $request_params = { | |
| 260 | 'id' => { | ||
| 261 | 'in' => 'path', | ||
| 262 | 'required' => 1, | ||
| 263 | 'validate' => 'int64', | ||
| 264 | }, | ||
| 265 | }; | ||
| 266 | |||
| 267 | 0 | return $self->_request( '/:id/actions/enable_backup', \%params, $request_params, { type => 'post', oid => '/servers/{id}/actions/enable_backup#post' } ); | |
| 268 | } | ||
| 269 | |||
| 270 | 0 | ▶ | sub enable_rescue ($self, %params) { |
|
Subroutine
enable_rescue: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 271 | 0 | my $request_params = { | |
| 272 | 'id' => { | ||
| 273 | 'in' => 'path', | ||
| 274 | 'required' => 1, | ||
| 275 | 'validate' => 'int64', | ||
| 276 | }, | ||
| 277 | }; | ||
| 278 | |||
| 279 | 0 | return $self->_request( '/:id/actions/enable_rescue', \%params, $request_params, { type => 'post', oid => '/servers/{id}/actions/enable_rescue#post' } ); | |
| 280 | } | ||
| 281 | |||
| 282 | 0 | ▶ | sub poweroff ($self, %params) { |
|
Subroutine
poweroff: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 283 | 0 | my $request_params = { | |
| 284 | 'id' => { | ||
| 285 | 'in' => 'path', | ||
| 286 | 'required' => 1, | ||
| 287 | 'validate' => 'int64', | ||
| 288 | }, | ||
| 289 | }; | ||
| 290 | |||
| 291 | 0 | return $self->_request( '/:id/actions/poweroff', \%params, $request_params, { type => 'post', oid => '/servers/{id}/actions/poweroff#post' } ); | |
| 292 | } | ||
| 293 | |||
| 294 | 0 | ▶ | sub poweron ($self, %params) { |
|
Subroutine
poweron: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 295 | 0 | my $request_params = { | |
| 296 | 'id' => { | ||
| 297 | 'in' => 'path', | ||
| 298 | 'required' => 1, | ||
| 299 | 'validate' => 'int64', | ||
| 300 | }, | ||
| 301 | }; | ||
| 302 | |||
| 303 | 0 | return $self->_request( '/:id/actions/poweron', \%params, $request_params, { type => 'post', oid => '/servers/{id}/actions/poweron#post' } ); | |
| 304 | } | ||
| 305 | |||
| 306 | 0 | ▶ | sub reboot ($self, %params) { |
|
Subroutine
reboot: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 307 | 0 | my $request_params = { | |
| 308 | 'id' => { | ||
| 309 | 'in' => 'path', | ||
| 310 | 'required' => 1, | ||
| 311 | 'validate' => 'int64', | ||
| 312 | }, | ||
| 313 | }; | ||
| 314 | |||
| 315 | 0 | return $self->_request( '/:id/actions/reboot', \%params, $request_params, { type => 'post', oid => '/servers/{id}/actions/reboot#post' } ); | |
| 316 | } | ||
| 317 | |||
| 318 | 0 | ▶ | sub rebuild ($self, %params) { |
|
Subroutine
rebuild: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 319 | 0 | my $request_params = { | |
| 320 | 'id' => { | ||
| 321 | 'in' => 'path', | ||
| 322 | 'required' => 1, | ||
| 323 | 'validate' => 'int64', | ||
| 324 | }, | ||
| 325 | }; | ||
| 326 | |||
| 327 | 0 | return $self->_request( '/:id/actions/rebuild', \%params, $request_params, { type => 'post', oid => '/servers/{id}/actions/rebuild#post' } ); | |
| 328 | } | ||
| 329 | |||
| 330 | 0 | ▶ | sub remove_from_placement_group ($self, %params) { |
|
Subroutine
remove_from_placement_group: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 331 | 0 | my $request_params = { | |
| 332 | 'id' => { | ||
| 333 | 'in' => 'path', | ||
| 334 | 'required' => 1, | ||
| 335 | 'validate' => 'int64', | ||
| 336 | }, | ||
| 337 | }; | ||
| 338 | |||
| 339 | 0 | return $self->_request( '/:id/actions/remove_from_placement_group', \%params, $request_params, { type => 'post', oid => '/servers/{id}/actions/remove_from_placement_group#post' } ); | |
| 340 | } | ||
| 341 | |||
| 342 | 0 | ▶ | sub request_console ($self, %params) { |
|
Subroutine
request_console: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 343 | 0 | my $request_params = { | |
| 344 | 'id' => { | ||
| 345 | 'in' => 'path', | ||
| 346 | 'required' => 1, | ||
| 347 | 'validate' => 'int64', | ||
| 348 | }, | ||
| 349 | }; | ||
| 350 | |||
| 351 | 0 | return $self->_request( '/:id/actions/request_console', \%params, $request_params, { type => 'post', oid => '/servers/{id}/actions/request_console#post' } ); | |
| 352 | } | ||
| 353 | |||
| 354 | 0 | ▶ | sub reset ($self, %params) { |
|
Subroutine
reset: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 355 | 0 | my $request_params = { | |
| 356 | 'id' => { | ||
| 357 | 'in' => 'path', | ||
| 358 | 'required' => 1, | ||
| 359 | 'validate' => 'int64', | ||
| 360 | }, | ||
| 361 | }; | ||
| 362 | |||
| 363 | 0 | return $self->_request( '/:id/actions/reset', \%params, $request_params, { type => 'post', oid => '/servers/{id}/actions/reset#post' } ); | |
| 364 | } | ||
| 365 | |||
| 366 | 0 | ▶ | sub reset_password ($self, %params) { |
|
Subroutine
reset_password: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 367 | 0 | my $request_params = { | |
| 368 | 'id' => { | ||
| 369 | 'in' => 'path', | ||
| 370 | 'required' => 1, | ||
| 371 | 'validate' => 'int64', | ||
| 372 | }, | ||
| 373 | }; | ||
| 374 | |||
| 375 | 0 | return $self->_request( '/:id/actions/reset_password', \%params, $request_params, { type => 'post', oid => '/servers/{id}/actions/reset_password#post' } ); | |
| 376 | } | ||
| 377 | |||
| 378 | 0 | ▶ | sub shutdown ($self, %params) { |
|
Subroutine
shutdown: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 379 | 0 | my $request_params = { | |
| 380 | 'id' => { | ||
| 381 | 'in' => 'path', | ||
| 382 | 'required' => 1, | ||
| 383 | 'validate' => 'int64', | ||
| 384 | }, | ||
| 385 | }; | ||
| 386 | |||
| 387 | 0 | return $self->_request( '/:id/actions/shutdown', \%params, $request_params, { type => 'post', oid => '/servers/{id}/actions/shutdown#post' } ); | |
| 388 | } | ||
| 389 | |||
| 390 | 0 | ▶ | sub get_actions ($self, %params) { |
|
Subroutine
get_actions: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 391 | 0 | my $request_params = { | |
| 392 | 'action_id' => { | ||
| 393 | 'in' => 'path', | ||
| 394 | 'required' => 1, | ||
| 395 | 'validate' => 'int64', | ||
| 396 | }, | ||
| 397 | 'id' => { | ||
| 398 | 'in' => 'path', | ||
| 399 | 'required' => 1, | ||
| 400 | 'validate' => 'int64', | ||
| 401 | }, | ||
| 402 | }; | ||
| 403 | |||
| 404 | 0 | return $self->_request( '/:id/actions/:action_id', \%params, $request_params, { type => 'get', oid => '/servers/{id}/actions/{action_id}#get' } ); | |
| 405 | } | ||
| 406 | |||
| 407 | 0 | ▶ | sub list_metrics ($self, %params) { |
|
Subroutine
list_metrics: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 408 | 0 | my $request_params = { | |
| 409 | 'end' => { | ||
| 410 | 'in' => 'query', | ||
| 411 | 'required' => 1, | ||
| 412 | 'validate' => 'string', | ||
| 413 | }, | ||
| 414 | 'id' => { | ||
| 415 | 'in' => 'path', | ||
| 416 | 'required' => 1, | ||
| 417 | 'validate' => 'int64', | ||
| 418 | }, | ||
| 419 | 'start' => { | ||
| 420 | 'in' => 'query', | ||
| 421 | 'required' => 1, | ||
| 422 | 'validate' => 'string', | ||
| 423 | }, | ||
| 424 | 'step' => { | ||
| 425 | 'in' => 'query', | ||
| 426 | 'required' => 0, | ||
| 427 | 'validate' => 'string', | ||
| 428 | }, | ||
| 429 | 'type' => { | ||
| 430 | 'in' => 'query', | ||
| 431 | 'required' => 1, | ||
| 432 | 'validate' => 'string', | ||
| 433 | }, | ||
| 434 | }; | ||
| 435 | |||
| 436 | 0 | return $self->_request( '/:id/metrics', \%params, $request_params, { type => 'get', oid => '/servers/{id}/metrics#get' } ); | |
| 437 | } | ||
| 438 | |||
| 439 | |||
| 440 | 4 | 1; | |
| 441 | |||
| 442 | __END__ | ||