]>
git.proxmox.com Git - qemu-server.git/blob - PVE/API2/Qemu/OVF.pm
1 package PVE
::API2
::Qemu
::OVF
;
6 use PVE
::JSONSchema
qw(get_standard_option);
7 use PVE
::QemuServer
::OVF
;
10 use base
qw(PVE::RESTHandler);
12 __PACKAGE__-
>register_method ({
17 description
=> "Read an .ovf manifest.",
20 additionalProperties
=> 0,
22 node
=> get_standard_option
('pve-node'),
24 description
=> "Path to .ovf manifest.",
31 additionalProperties
=> 1,
32 properties
=> PVE
::QemuServer
::json_ovf_properties
(),
33 description
=> "VM config according to .ovf manifest.",
38 my $manifest = $param->{manifest
};
39 die "check for file $manifest failed - $!\n" if !-f
$manifest;
41 my $parsed = PVE
::QemuServer
::OVF
::parse_ovf
($manifest);
43 $result->{cores
} = $parsed->{qm
}->{cores
};
44 $result->{name
} = $parsed->{qm
}->{name
};
45 $result->{memory
} = $parsed->{qm
}->{memory
};
46 my $disks = $parsed->{disks
};
47 for my $disk (@$disks) {
48 $result->{$disk->{disk_address
}} = $disk->{backing_file
};