use PVE::APIClient::JSONSchema qw(register_standard_option get_standard_option);
use PVE::APIClient::CLIHandler;
use PVE::APIClient::JSONSchema qw(register_standard_option get_standard_option);
use PVE::APIClient::CLIHandler;
+ my $remote = PVE::APIClient::Tools::extract_param($param, 'remote');
+ die "missing remote\n" if !defined($remote);
+
+ my $format = PVE::APIClient::Tools::extract_param($param, 'format');
+ PVE::APIClient::Helpers::set_output_format($format);
+
$path_properties->{remote} = get_standard_option('pveclient-remote-name');
$path_properties->{api_path} = {
description => "API path.",
$path_properties->{remote} = get_standard_option('pveclient-remote-name');
$path_properties->{api_path} = {
description => "API path.",
- # TODO: implement different output formats ($format)
- print to_json($data, {utf8 => 1, allow_nonref => 1, canonical => 1, pretty => 1 });
+ PVE::APIClient::Helpers::print_result($data, $path_returns);
- my $path = PVE::Tools::extract_param($param, 'api_path');
- my $remote = PVE::Tools::extract_param($param, 'remote');
-
- return call_method($remote, $path, 'GET', $param);
+ return call_api_method('GET', $param);
lxc => $PVE::APIClient::Commands::lxc::cmddef,
remote => $PVE::APIClient::Commands::remote::cmddef,
lxc => $PVE::APIClient::Commands::lxc::cmddef,
remote => $PVE::APIClient::Commands::remote::cmddef,
+ resume => [ 'PVE::APIClient::Commands::GuestStatus', 'resume', ['remote', 'vmid']],
+ shutdown => [ 'PVE::APIClient::Commands::GuestStatus', 'shutdown', ['remote', 'vmid']],
spice => [ 'PVE::APIClient::Commands::GuestStatus', 'spice', ['remote', 'vmid']],
start => [ 'PVE::APIClient::Commands::GuestStatus', 'start', ['remote', 'vmid']],
stop => [ 'PVE::APIClient::Commands::GuestStatus', 'stop', ['remote', 'vmid']],
spice => [ 'PVE::APIClient::Commands::GuestStatus', 'spice', ['remote', 'vmid']],
start => [ 'PVE::APIClient::Commands::GuestStatus', 'start', ['remote', 'vmid']],
stop => [ 'PVE::APIClient::Commands::GuestStatus', 'stop', ['remote', 'vmid']],
api => {
get => [ __PACKAGE__, 'pveclient_get', ['remote', 'api_path'], {}, $format_result ],
api => {
get => [ __PACKAGE__, 'pveclient_get', ['remote', 'api_path'], {}, $format_result ],