« lib/WWW/Hetzner/CLI/Cmd/StorageBox/Cmd/Subaccount/Cmd/Delete.pm
↑ Summary
lib/WWW/Hetzner/CLI/Cmd/StorageBox/Cmd/Subaccount/Cmd/ResetPassword.pm »
| 1 | package WWW::Hetzner::CLI::Cmd::StorageBox::Cmd::Subaccount::Cmd::ChangeHomeDirectory; | ||||||||||
| 2 | # ABSTRACT: Change a Storage Box subaccount home directory | ||||||||||
| 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 change-home-directory --home-directory <dir> <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 home_directory => ( | |||||||||
| 14 | is => 'ro', | ||||||||||
| 15 | format => 's', | ||||||||||
| 16 | required => 1, | ||||||||||
| 17 | doc => 'New subaccount home directory', | ||||||||||
| 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 change-home-directory <storage-box> <subaccount>\n"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 23 | 1 | ▶ | my $sub = $args->[1] or die "Usage: hcloud.pl storage-box subaccount change-home-directory <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->change_home_directory($sub, home_directory => $self->home_directory); | |||||||||
| 30 | 1 | $self->handle_action($action); | |||||||||
| 31 | 1 | ▶ | print $self->no_wait ? "Subaccount home directory change requested.\n" : "Subaccount home directory changed.\n"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 32 | } | ||||||||||
| 33 | |||||||||||
| 34 | 1 | 1; | |||||||||
| 35 | |||||||||||
| 36 | __END__ | ||||||||||