« lib/WWW/Hetzner/CLI/Cmd/StorageBox/Cmd/Subaccount/Cmd/ChangeHomeDirectory.pm
↑ Summary
lib/WWW/Hetzner/CLI/Cmd/Record/Cmd/Describe.pm »
| 1 | package WWW::Hetzner::CLI::Cmd::StorageBox::Cmd::Subaccount::Cmd::ResetPassword; | ||||||||||
| 2 | # ABSTRACT: Reset a Storage Box subaccount 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 subaccount reset-password --password <password> <storage-box> <subaccount>'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 1 | ▶ | use WWW::Hetzner::Storage::API::Subaccounts; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 1 | with 'WWW::Hetzner::CLI::Role::WaitsForAction'; | |||||||||
| 11 | |||||||||||
| 12 | |||||||||||
| 13 | 1 | option password => ( | |||||||||
| 14 | is => 'ro', | ||||||||||
| 15 | format => 's', | ||||||||||
| 16 | required => 1, | ||||||||||
| 17 | doc => 'New subaccount password (input only)', | ||||||||||
| 18 | ); | ||||||||||
| 19 | |||||||||||
| 20 | 1 | ▶ | sub execute { | ||||||||
|
Subroutine
execute: called CC=4 SCAR=14.3
Pod
undocumented
| |||||||||||
| 21 | 1 | my ($self, $args, $chain) = @_; | |||||||||
| 22 | 1 | ▶ | my $id = $args->[0] or die "Usage: hcloud.pl storage-box subaccount reset-password <storage-box> <subaccount>\n"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 23 | 1 | ▶ | my $sub = $args->[1] or die "Usage: hcloud.pl storage-box subaccount reset-password <storage-box> <subaccount>\n"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 24 | |||||||||||
| 25 | 1 | my $subaccounts = WWW::Hetzner::Storage::API::Subaccounts->new( | |||||||||
| 26 | client => $chain->[0]->storage, | ||||||||||
| 27 | storage_box_id => $id, | ||||||||||
| 28 | ); | ||||||||||
| 29 | 1 | my $action = $subaccounts->reset_subaccount_password($sub, password => $self->password); | |||||||||
| 30 | 1 | $self->handle_action($action); | |||||||||
| 31 | 1 | ▶ | print $self->no_wait ? "Subaccount password reset requested.\n" : "Subaccount password reset.\n"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 32 | } | ||||||||||
| 33 | |||||||||||
| 34 | 1 | 1; | |||||||||
| 35 | |||||||||||
| 36 | __END__ | ||||||||||