--- PVE/APIClient/Commands/GuestStatus.pm | 18 ++++++++++-------- PVE/APIClient/Helpers.pm | 10 ++++++++++ 2 files changed, 20 insertions(+), 8 deletions(-)
diff --git a/PVE/APIClient/Commands/GuestStatus.pm b/PVE/APIClient/Commands/GuestStatus.pm index 4a50164..7f90798 100644 --- a/PVE/APIClient/Commands/GuestStatus.pm +++ b/PVE/APIClient/Commands/GuestStatus.pm @@ -34,10 +34,11 @@ __PACKAGE__->register_method ({ description => "Start a guest (VM/Container).", parameters => { additionalProperties => 0, - properties => { - remote => get_standard_option('pveclient-remote-name'), - vmid => get_standard_option('pve-vmid'), - }, + properties => PVE::APIClient::Helpers::merge_api_definition_properties( + '/nodes/{node}/qemu/{vmid}/status/start', 'POST', { + remote => get_standard_option('pveclient-remote-name'), + vmid => get_standard_option('pve-vmid'), + }), }, returns => { type => 'null'}, code => sub { @@ -58,10 +59,11 @@ __PACKAGE__->register_method ({ description => "Stop a guest (VM/Container).", parameters => { additionalProperties => 0, - properties => { - remote => get_standard_option('pveclient-remote-name'), - vmid => get_standard_option('pve-vmid'), - }, + properties => PVE::APIClient::Helpers::merge_api_definition_properties( + '/nodes/{node}/qemu/{vmid}/status/stop', 'POST', { + remote => get_standard_option('pveclient-remote-name'), + vmid => get_standard_option('pve-vmid'), + }), }, returns => { type => 'null'}, code => sub { diff --git a/PVE/APIClient/Helpers.pm b/PVE/APIClient/Helpers.pm index 1ea8a5e..4eb596a 100644 --- a/PVE/APIClient/Helpers.pm +++ b/PVE/APIClient/Helpers.pm @@ -77,6 +77,16 @@ sub lookup_api_method { return $data; } +sub merge_api_definition_properties { + my ($path, $method, $properties) = @_; + + my $info = PVE::APIClient::Helpers::lookup_api_method($path, $method); + + my %tmp = (%{$info->{parameters}->{properties}}, %$properties); + + return \%tmp; +}; + sub complete_api_call_options { my ($cmd, $prop, $prev, $cur, $args) = @_; -- 2.11.0 _______________________________________________ pve-devel mailing list pve-devel@pve.proxmox.com https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel