« lib/WWW/Hetzner/CLI/Cmd/StorageBox/Cmd/EnableProtection.pm
↑ Summary
lib/WWW/Hetzner/CLI/Cmd/StorageBox/Cmd/ResetPassword.pm »
| 1 | package WWW::Hetzner::CLI::Cmd::StorageBox::Cmd::ChangeType; | ||||||||||
| 2 | # ABSTRACT: Change a Storage Box type | ||||||||||
| 3 | |||||||||||
| 4 | 1 | our $VERSION = '0.102'; | |||||||||
| 5 | |||||||||||
| 6 | 1 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 1 | ▶ | use MooX::Cmd; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 1 | ▶ | use MooX::Options protect_argv => 0, usage_string => 'USAGE: hcloud.pl storage-box change-type --type <type> <storage-box>'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 1 | with 'WWW::Hetzner::CLI::Role::WaitsForAction'; | |||||||||
| 10 | |||||||||||
| 11 | 1 | option type => ( is => 'ro', format => 's', required => 1, doc => 'Target Storage Box type ID or name' ); | |||||||||
| 12 | |||||||||||
| 13 | 2 | ▶ | sub execute { | ||||||||
|
Subroutine
execute: called CC=3 SCAR=11.3
Pod
undocumented
| |||||||||||
| 14 | 2 | my ($self, $args, $chain) = @_; | |||||||||
| 15 | 2 | ▶ | my $id = $args->[0] or die "Usage: hcloud.pl storage-box change-type --type <type> <storage-box>\n"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 16 | 2 | my $action = $chain->[0]->storage->storage_boxes->change_type($id, storage_box_type => $self->type); | |||||||||
| 17 | 2 | $self->handle_action($action); | |||||||||
| 18 | 1 | ▶ | print $self->no_wait ? "Storage Box type change requested.\n" : "Storage Box type changed.\n"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | } | ||||||||||
| 20 | |||||||||||
| 21 | 1 | 1; | |||||||||
| 22 | |||||||||||
| 23 | __END__ | ||||||||||