On 2/13/18 4:47 PM, Dominik Csapak wrote: > Signed-off-by: Dominik Csapak <d.csa...@proxmox.com> > --- > PVE/API2/Qemu/Agent.pm | 24 +++++++++++++++++++++++- > 1 file changed, 23 insertions(+), 1 deletion(-) > > diff --git a/PVE/API2/Qemu/Agent.pm b/PVE/API2/Qemu/Agent.pm > index 2743595..24b44a9 100644 > --- a/PVE/API2/Qemu/Agent.pm > +++ b/PVE/API2/Qemu/Agent.pm > @@ -35,7 +35,29 @@ my $guest_agent_commands = [ > # 'method': e.g. GET/POST > # 'perms': either a string like 'VM.Montior' or an array of such strings > # or a permission object > -my $ga_cmd_properties = {}; > +my $ga_cmd_properties = { > + 'network-get-interfaces' => { > + method => 'GET', > + }, > + 'get-vcpus' => { > + method => 'GET', > + }, > + 'get-fsinfo' => { > + method => 'GET', > + }, > + 'get-memory-blocks' => { > + method => 'GET', > + }, > + 'get-memory-block-info' => { > + method => 'GET', > + }, > + 'get-time' => { > + method => 'GET', > + }, > + 'info' => { > + method => 'GET', > + }, > +}; >
Hmm, how about not falling back to 'POST' method as default but cry and list here _all_ commands with the respective method? Better even, change $guest_agent_commands to a hash doing exactly this, then you do not semi-duplicate command names, as all known ones are defined there and you could use 'keys $guest_agent_commands' to get the command array. > __PACKAGE__->register_method({ > name => 'index', > _______________________________________________ pve-devel mailing list pve-devel@pve.proxmox.com https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel