mirror of
https://git.proxmox.com/git/pve-client
synced 2025-10-04 20:37:13 +00:00
config list: correctly return and format data
This commit is contained in:
parent
936c07ece1
commit
e42d9cfe59
@ -13,6 +13,9 @@ use PVE::APIClient::CLIHandler;
|
|||||||
|
|
||||||
use base qw(PVE::APIClient::CLIHandler);
|
use base qw(PVE::APIClient::CLIHandler);
|
||||||
|
|
||||||
|
my $list_return_props = { %{PVE::APIClient::DefaultsConfig->updateSchema(1)->{properties}} };
|
||||||
|
delete $list_return_props->{delete};
|
||||||
|
|
||||||
__PACKAGE__->register_method ({
|
__PACKAGE__->register_method ({
|
||||||
name => 'list',
|
name => 'list',
|
||||||
path => 'list',
|
path => 'list',
|
||||||
@ -21,17 +24,19 @@ __PACKAGE__->register_method ({
|
|||||||
parameters => {
|
parameters => {
|
||||||
additionalProperties => 0,
|
additionalProperties => 0,
|
||||||
},
|
},
|
||||||
returns => { type => 'null' },
|
returns => {
|
||||||
|
type => 'object',
|
||||||
|
properties => $list_return_props,
|
||||||
|
},
|
||||||
code => sub {
|
code => sub {
|
||||||
|
|
||||||
my $config = PVE::APIClient::Config->load();
|
my $config = PVE::APIClient::Config->load();
|
||||||
|
|
||||||
my $defaults = PVE::APIClient::Config->get_defaults($config);
|
my $defaults = PVE::APIClient::Config->get_defaults($config);
|
||||||
|
|
||||||
|
$defaults->{digest} = $config->{digest};
|
||||||
|
|
||||||
print Dumper($config);
|
return $defaults;
|
||||||
|
|
||||||
return undef;
|
|
||||||
}});
|
}});
|
||||||
|
|
||||||
__PACKAGE__->register_method ({
|
__PACKAGE__->register_method ({
|
||||||
@ -82,7 +87,7 @@ __PACKAGE__->register_method ({
|
|||||||
|
|
||||||
our $cmddef = {
|
our $cmddef = {
|
||||||
set => [ __PACKAGE__, 'set',],
|
set => [ __PACKAGE__, 'set',],
|
||||||
list => [__PACKAGE__, 'list'],
|
list => [__PACKAGE__, 'list', undef, undef, sub { PVE::APIClient::Helpers::print_result(@_);}],
|
||||||
};
|
};
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
Loading…
Reference in New Issue
Block a user