« lib/WWW/Hetzner/CLI/Cmd/StorageBox/Cmd/ChangeType.pm
↑ Summary
lib/WWW/Hetzner/CLI/Cmd/StorageBox/Cmd/RollbackSnapshot.pm »
| 1 | package WWW::Hetzner::CLI::Cmd::StorageBox::Cmd::ResetPassword; | ||||||||||
| 2 | # ABSTRACT: Reset a Storage Box password | ||||||||||
| 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 reset-password --password <password> <storage-box>'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 1 | with 'WWW::Hetzner::CLI::Role::WaitsForAction'; | |||||||||
| 10 | |||||||||||
| 11 | 1 | option password => ( is => 'ro', format => 's', required => 1, doc => 'New Storage Box password' ); | |||||||||
| 12 | |||||||||||
| 13 | 1 | ▶ | sub execute { | ||||||||
|
Subroutine
execute: called CC=3 SCAR=11.3
Pod
undocumented
| |||||||||||
| 14 | 1 | my ($self, $args, $chain) = @_; | |||||||||
| 15 | 1 | ▶ | my $id = $args->[0] or die "Usage: hcloud.pl storage-box reset-password --password <password> <storage-box>\n"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 16 | 1 | my $action = $chain->[0]->storage->storage_boxes->reset_password($id, password => $self->password); | |||||||||
| 17 | 1 | $self->handle_action($action); | |||||||||
| 18 | 1 | ▶ | print $self->no_wait ? "Storage Box password reset requested.\n" : "Storage Box password reset.\n"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | } | ||||||||||
| 20 | |||||||||||
| 21 | 1 | 1; | |||||||||
| 22 | |||||||||||
| 23 | __END__ | ||||||||||