mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-05-01 04:51:50 +00:00
add an guest agent index call
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
ea2bceaf19
commit
ad1f73b9e4
@ -63,6 +63,44 @@ my $guest_agent_commands = {
|
||||
},
|
||||
};
|
||||
|
||||
__PACKAGE__->register_method({
|
||||
name => 'index',
|
||||
path => '',
|
||||
proxyto => 'node',
|
||||
method => 'GET',
|
||||
description => "Qemu Agent command index.",
|
||||
permissions => {
|
||||
user => 'all',
|
||||
},
|
||||
parameters => {
|
||||
additionalProperties => 1,
|
||||
properties => {
|
||||
node => get_standard_option('pve-node'),
|
||||
vmid => get_standard_option('pve-vmid', {
|
||||
completion => \&PVE::QemuServer::complete_vmid_running }),
|
||||
},
|
||||
},
|
||||
returns => {
|
||||
type => 'array',
|
||||
items => {
|
||||
type => "object",
|
||||
properties => {},
|
||||
},
|
||||
links => [ { rel => 'child', href => '{name}' } ],
|
||||
description => "Returns the list of Qemu Agent commands",
|
||||
},
|
||||
code => sub {
|
||||
my ($param) = @_;
|
||||
|
||||
my $result = [];
|
||||
|
||||
for my $cmd (sort keys %$guest_agent_commands) {
|
||||
push @$result, { name => $cmd };
|
||||
}
|
||||
|
||||
return $result;
|
||||
}});
|
||||
|
||||
sub register_command {
|
||||
my ($class, $command, $method, $perm) = @_;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user