mirror of
https://git.proxmox.com/git/pve-access-control
synced 2025-07-27 07:21:49 +00:00
fix return format
This commit is contained in:
parent
cab28ea50b
commit
9a53427a8e
@ -184,7 +184,6 @@ __PACKAGE__->register_method ({
|
|||||||
return undef;
|
return undef;
|
||||||
}});
|
}});
|
||||||
|
|
||||||
# fixme: return format!
|
|
||||||
__PACKAGE__->register_method ({
|
__PACKAGE__->register_method ({
|
||||||
name => 'read_pool',
|
name => 'read_pool',
|
||||||
path => '{poolid}',
|
path => '{poolid}',
|
||||||
@ -200,6 +199,11 @@ __PACKAGE__->register_method ({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
returns => {
|
returns => {
|
||||||
|
type => "object",
|
||||||
|
additionalProperties => 0,
|
||||||
|
properties => {
|
||||||
|
comment => { type => 'string', optional => 1 },
|
||||||
|
members => {
|
||||||
type => 'array',
|
type => 'array',
|
||||||
items => {
|
items => {
|
||||||
type => "object",
|
type => "object",
|
||||||
@ -212,6 +216,8 @@ __PACKAGE__->register_method ({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
code => sub {
|
code => sub {
|
||||||
my ($param) = @_;
|
my ($param) = @_;
|
||||||
|
|
||||||
@ -224,10 +230,10 @@ __PACKAGE__->register_method ({
|
|||||||
die "pool '$pool' does not exist\n"
|
die "pool '$pool' does not exist\n"
|
||||||
if !$data;
|
if !$data;
|
||||||
|
|
||||||
my $res = [];
|
my $members = [];
|
||||||
|
|
||||||
foreach my $vmid (keys %{$data->{vms}}) {
|
foreach my $vmid (keys %{$data->{vms}}) {
|
||||||
push @$res, {
|
push @$members, {
|
||||||
id => "vm/$vmid",
|
id => "vm/$vmid",
|
||||||
vmid => $vmid + 0,
|
vmid => $vmid + 0,
|
||||||
type => 'vm',
|
type => 'vm',
|
||||||
@ -235,13 +241,16 @@ __PACKAGE__->register_method ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach my $storage (keys %{$data->{storage}}) {
|
foreach my $storage (keys %{$data->{storage}}) {
|
||||||
push @$res, {
|
push @$members, {
|
||||||
id => "storage/$storage",
|
id => "storage/$storage",
|
||||||
storage => $storage,
|
storage => $storage,
|
||||||
type => 'storage',
|
type => 'storage',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
my $res = { members => $members };
|
||||||
|
$res->{comment} = $data->{comment} if defined($data->{comment});
|
||||||
|
|
||||||
return $res;
|
return $res;
|
||||||
}});
|
}});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user