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;
- # 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};
+ }
- my $format = PVE::APIClient::Helpers::get_output_format();
-
- return if $path_returns->{type} eq 'null';
-
- # 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);
parameters => {
additionalProperties => 0,
properties => $path_properties,
parameters => {
additionalProperties => 0,
properties => $path_properties,
parameters => {
additionalProperties => 0,
properties => $path_properties,
parameters => {
additionalProperties => 0,
properties => $path_properties,
name => 'pveclient_create',
path => 'pveclient_create',
method => 'PUSH',
name => 'pveclient_create',
path => 'pveclient_create',
method => 'PUSH',
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 ],