mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-05-30 18:47:04 +00:00
improve snapshot REST interface
This commit is contained in:
parent
7e7d7b6113
commit
154ccdcdbc
@ -457,7 +457,6 @@ __PACKAGE__->register_method({
|
|||||||
{ subdir => 'rrddata' },
|
{ subdir => 'rrddata' },
|
||||||
{ subdir => 'monitor' },
|
{ subdir => 'monitor' },
|
||||||
{ subdir => 'snapshot' },
|
{ subdir => 'snapshot' },
|
||||||
{ subdir => 'rollback' },
|
|
||||||
];
|
];
|
||||||
|
|
||||||
return $res;
|
return $res;
|
||||||
@ -1990,9 +1989,47 @@ __PACKAGE__->register_method({
|
|||||||
return $rpcenv->fork_worker('qmsnapshot', $vmid, $authuser, $realcmd);
|
return $rpcenv->fork_worker('qmsnapshot', $vmid, $authuser, $realcmd);
|
||||||
}});
|
}});
|
||||||
|
|
||||||
|
__PACKAGE__->register_method({
|
||||||
|
name => 'snapshot_cmd_idx',
|
||||||
|
path => '{vmid}/snapshot/{snapname}',
|
||||||
|
description => '',
|
||||||
|
method => 'GET',
|
||||||
|
permissions => {
|
||||||
|
user => 'all',
|
||||||
|
},
|
||||||
|
parameters => {
|
||||||
|
additionalProperties => 0,
|
||||||
|
properties => {
|
||||||
|
vmid => get_standard_option('pve-vmid'),
|
||||||
|
node => get_standard_option('pve-node'),
|
||||||
|
snapname => {
|
||||||
|
type => 'string',
|
||||||
|
description => "The name of the snapshot",
|
||||||
|
maxLength => 40,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
returns => {
|
||||||
|
type => 'array',
|
||||||
|
items => {
|
||||||
|
type => "object",
|
||||||
|
properties => {},
|
||||||
|
},
|
||||||
|
links => [ { rel => 'child', href => "{cmd}" } ],
|
||||||
|
},
|
||||||
|
code => sub {
|
||||||
|
my ($param) = @_;
|
||||||
|
|
||||||
|
my $res = [];
|
||||||
|
|
||||||
|
push @$res, { cmd => 'rollback' };
|
||||||
|
|
||||||
|
return $res;
|
||||||
|
}});
|
||||||
|
|
||||||
__PACKAGE__->register_method({
|
__PACKAGE__->register_method({
|
||||||
name => 'rollback',
|
name => 'rollback',
|
||||||
path => '{vmid}/rollback',
|
path => '{vmid}/snapshot/{snapname}/rollback',
|
||||||
method => 'POST',
|
method => 'POST',
|
||||||
protected => 1,
|
protected => 1,
|
||||||
proxyto => 'node',
|
proxyto => 'node',
|
||||||
|
Loading…
Reference in New Issue
Block a user