X-Git-Url: https://git.proxmox.com/?p=pve-client.git;a=blobdiff_plain;f=pveclient;fp=pveclient;h=9177db68160fc31d10a0284a59ebf7f18b027b99;hp=34e2aab8b1b14028e534bc0024cf8420ad529fa1;hb=520f543ef857f504e30780f4d4484acc9e92fccd;hpb=50d8425652ad9c169170b02ed7c5df0813fbb0b3 diff --git a/pveclient b/pveclient index 34e2aab..9177db6 100755 --- a/pveclient +++ b/pveclient @@ -36,8 +36,8 @@ sub call_api_method { my $config = PVE::APIClient::Config->load(); - # 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); my $conn = PVE::APIClient::Config->remote_conn($config, $remote); @@ -84,8 +84,12 @@ my $path_returns = { type => 'null' }; # dynamically update schema definition for direct API call # like: pveclient api -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_returns = $info->{returns}; }