]>
git.proxmox.com Git - pve-client.git/blob - PVE/APIClient/Commands/remote.pm
8cedf083e3df2d29a163f86820a0ecf4476bfcbf
1 package PVE
::APIClient
::Commands
::remote
;
6 use PVE
::JSONSchema
qw(register_standard_option get_standard_option);
7 use PVE
::APIClient
::Config
;
11 use base
qw(PVE::CLIHandler);
13 my $complete_remote_name = sub {
15 my $config = PVE
::APIClient
::Config-
>new();
16 my $known_remotes = $config->remotes;
18 return [keys %{$known_remotes}];
21 register_standard_option
('pveclient-remote-name', {
22 description
=> "The name of the remote.",
24 pattern
=> qr([\w\d\
.\
-\_
]+),
25 completion
=> $complete_remote_name,
28 __PACKAGE__-
>register_method ({
32 description
=> "Add a remote to your config file.",
34 additionalProperties
=> 0,
36 name
=> get_standard_option
('pveclient-remote-name', { completion
=> sub {} }),
38 description
=> "The host, either host, host:port or https://host:port",
42 description
=> "The username.",
48 returns
=> { type
=> 'null'},
56 __PACKAGE__-
>register_method ({
60 description
=> "Removes a remote from your config file.",
62 additionalProperties
=> 0,
64 name
=> get_standard_option
('pveclient-remote-name'),
67 returns
=> { type
=> 'null'},
76 add
=> [ __PACKAGE__
, 'add', ['name', 'host']],
77 remove
=> [ __PACKAGE__
, 'remove', ['name']],