- # test if api path exists
- my $info = PVE::APIClient::Helpers::lookup_api_method($path, $method);
+ my $uri_param = {};
+ my $info = PVE::APIClient::Helpers::find_method_info($path, $method, $uri_param);
# dynamically update schema definition for direct API call
# like: pveclient api <get|set|create|delete|help> <remote> <path>
# dynamically update schema definition for direct API call
# like: pveclient api <get|set|create|delete|help> <remote> <path>
-if (my $info = PVE::APIClient::Helpers::extract_path_info()) {
- $path_properties = $info->{parameters}->{properties};
+my $uri_param = {};
+if (my $info = PVE::APIClient::Helpers::extract_path_info($uri_param)) {
+ foreach my $key (keys %{$info->{parameters}->{properties}}) {
+ next if defined($uri_param->{$key});
+ $path_properties->{$key} = $info->{parameters}->{properties}->{$key};
+ }
$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.",
- PVE::APIClient::Helpers::print_result($data, $path_returns);
+ my $format = PVE::APIClient::Helpers::get_output_format();
+
+ my $options = PVE::APIClient::CLIFormatter::query_terminal_options({});
+
+ PVE::APIClient::CLIFormatter::print_api_result($format, $data, $path_returns, undef, $options);
parameters => {
additionalProperties => 0,
properties => $path_properties,
parameters => {
additionalProperties => 0,
properties => $path_properties,
parameters => {
additionalProperties => 0,
properties => $path_properties,
parameters => {
additionalProperties => 0,
properties => $path_properties,
__PACKAGE__->register_method ({
name => 'pveclient_create',
path => 'pveclient_create',
__PACKAGE__->register_method ({
name => 'pveclient_create',
path => 'pveclient_create',
parameters => {
additionalProperties => 0,
properties => $path_properties,
parameters => {
additionalProperties => 0,
properties => $path_properties,
name => 'pveclient_delete',
path => 'pveclient_delete',
method => 'DELETE',
name => 'pveclient_delete',
path => 'pveclient_delete',
method => 'DELETE',
parameters => {
additionalProperties => 0,
properties => $path_properties,
parameters => {
additionalProperties => 0,
properties => $path_properties,
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 ],