lib/WWW/Hetzner/CLI/Cmd/Server/Cmd/Reboot.pm untested

filter: Statementstmt 0.0% 0 / 18 Branchbran n/a Conditioncond 0.0% 0 / 2 MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 25 CC 1 SCAR 6.9
CC
1
Cov
0%
execute
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package WWW::Hetzner::CLI::Cmd::Server::Cmd::Reboot;
2 # ABSTRACT: Reboot a server (soft)
3  
4 our $VERSION = '0.100';
5  
6 use Moo;
7 use MooX::Cmd;
8 use MooX::Options protect_argv => 0, usage_string => 'USAGE: hcloud.pl server reboot <id>';
9  
10 sub execute {
11 my ($self, $args, $chain) = @_;
12 my $id = $args->[0] or die "Usage: hcloud.pl server reboot <id>\n";
13  
14 my $main = $chain->[0];
15 my $cloud = $main->cloud;
16  
17 print "Rebooting server $id...\n";
18 $cloud->servers->reboot($id);
19 print "Server reboot initiated.\n";
20 }
21  
22 1;
23  
24 __END__