« lib/WWW/Hetzner/CLI/Cmd/StorageBox/Cmd/DisableSnapshotPlan.pm
↑ Summary
lib/WWW/Hetzner/CLI/Cmd/StorageBox/Cmd/ChangeType.pm »
| 1 | package WWW::Hetzner::CLI::Cmd::StorageBox::Cmd::EnableProtection; | ||||||||||
| 2 | # ABSTRACT: Enable Storage Box delete protection | ||||||||||
| 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 enable-protection <storage-box>'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 1 | with 'WWW::Hetzner::CLI::Role::WaitsForAction'; | |||||||||
| 10 | |||||||||||
| 11 | 1 | ▶ | sub execute { | ||||||||
|
Subroutine
execute: called CC=3 SCAR=11.3
Pod
undocumented
| |||||||||||
| 12 | 1 | my ($self, $args, $chain) = @_; | |||||||||
| 13 | 1 | ▶ | my $id = $args->[0] or die "Usage: hcloud.pl storage-box enable-protection <storage-box>\n"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 14 | 1 | my $action = $chain->[0]->storage->storage_boxes->change_protection($id, delete => 1); | |||||||||
| 15 | 1 | $self->handle_action($action); | |||||||||
| 16 | 1 | ▶ | print $self->no_wait ? "Storage Box protection change requested.\n" : "Storage Box protection enabled.\n"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 17 | } | ||||||||||
| 18 | |||||||||||
| 19 | 1 | 1; | |||||||||
| 20 | |||||||||||
| 21 | __END__ | ||||||||||