]>
git.proxmox.com Git - qemu-server.git/blob - PVE/CLI/qmrestore.pm
1 package PVE
::CLI
::qmrestore
;
6 use PVE
::Tools
qw(extract_param);
8 use PVE
::RPCEnvironment
;
10 use PVE
::JSONSchema
qw(get_standard_option);
15 use base
qw(PVE::CLIHandler);
17 __PACKAGE__-
>register_method({
21 description
=> "Restore QemuServer vzdump backups.",
23 additionalProperties
=> 0,
25 vmid
=> get_standard_option
('pve-vmid', { completion
=> \
&PVE
::Cluster
::complete_next_vmid
}),
27 description
=> "The backup file. You can pass '-' to read from standard input.",
30 completion
=> \
&PVE
::QemuServer
::complete_backup_archives
,
32 storage
=> get_standard_option
('pve-storage-id', {
33 description
=> "Default storage.",
35 completion
=> \
&PVE
::QemuServer
::complete_storage
,
40 description
=> "Allow to overwrite existing VM.",
45 description
=> "Assign a unique random ethernet address.",
49 type
=> 'string', format
=> 'pve-poolid',
50 description
=> "Add the VM to the specified pool.",
60 $param->{node
} = PVE
::INotify
::nodename
();
62 return PVE
::API2
::Qemu-
>create_vm($param);
65 our $cmddef = [ __PACKAGE__
, 'qmrestore', ['archive', 'vmid'], undef,
68 my $status = PVE
::Tools
::upid_read_status
($upid);
69 exit($status eq 'OK' ?
0 : -1);