add content type to pvesm list output

Signed-off-by: Tim Marx <t.marx@proxmox.com>
This commit is contained in:
Tim Marx
2019-11-20 11:35:17 +01:00
committed by Thomas Lamprecht
parent ad71f2ffb6
commit 2e2e11db3e

View File

@ -124,21 +124,23 @@ my $print_content = sub {
my $sidlen = length ($volid); my $sidlen = length ($volid);
$maxlenname = $sidlen if $sidlen > $maxlenname; $maxlenname = $sidlen if $sidlen > $maxlenname;
} }
printf "%-${maxlenname}s %-6s %-9s %-10s %s\n", "Volid",
"Format", "Type", "Size", "VMID";
foreach my $info (@$list) { foreach my $info (@$list) {
next if !$info->{vmid}; next if !$info->{vmid};
my $volid = $info->{volid}; my $volid = $info->{volid};
printf "%-${maxlenname}s %5s %10d %d\n", $volid, printf "%-${maxlenname}s %-6s %-9s %-10d %d\n", $volid,
$info->{format}, $info->{size}, $info->{vmid}; $info->{format}, $info->{content}, $info->{size}, $info->{vmid};
} }
foreach my $info (sort { $a->{format} cmp $b->{format} } @$list) { foreach my $info (sort { $a->{format} cmp $b->{format} } @$list) {
next if $info->{vmid}; next if $info->{vmid};
my $volid = $info->{volid}; my $volid = $info->{volid};
printf "%-${maxlenname}s %5s %10d\n", $volid, printf "%-${maxlenname}s %-6s %-9s %-10d\n", $volid,
$info->{format}, $info->{size}; $info->{format}, $info->{content}, $info->{size};
} }
}; };
@ -506,7 +508,7 @@ __PACKAGE__->register_method ({
type => 'array', type => 'array',
items => { items => {
type => "object", type => "object",
properties => { properties => {
volname => { volname => {
description => "The volume name.", description => "The volume name.",
type => 'string', type => 'string',