+$path_properties->{remote} = get_standard_option('pveclient-remote-name');
+$path_properties->{api_path} = {
+ description => "API path.",
+ type => 'string',
+ completion => sub {
+ my ($cmd, $pname, $cur, $args) = @_;
+ return PVE::APIClient::Helpers::complete_api_path($cur);
+ },
+};
+
+__PACKAGE__->register_method ({
+ name => 'pveclient_get',
+ path => 'pveclient_get',
+ method => 'GET',
+ description => "call API GET on <path>.",
+ parameters => {
+ additionalProperties => 0,
+ properties => $path_properties,
+ },
+ returns => $path_returns,
+ code => sub {
+ my ($param) = @_;
+
+ my $path = PVE::Tools::extract_param($param, 'api_path');
+ my $remote = PVE::Tools::extract_param($param, 'remote');
+
+ return call_method($remote, $path, 'GET', $param);
+ }});
+
+__PACKAGE__->register_method ({
+ name => 'pveclient_set',
+ path => 'pveclient_set',
+ method => 'PUT',
+ description => "call API PUT on <path>.",
+ parameters => {
+ additionalProperties => 0,
+ properties => $path_properties,
+ },
+ returns => $path_returns,
+ code => sub {
+ my ($param) = @_;
+
+ print Dumper($param);
+
+ die "implement me";
+
+ }});
+
+__PACKAGE__->register_method ({
+ name => 'pveclient_create',
+ path => 'pveclient_create',
+ method => 'PUSH',
+ description => "call API PUSH on <path>.",
+ parameters => {
+ additionalProperties => 0,
+ properties => $path_properties,
+ },
+ returns => $path_returns,
+ code => sub {
+ my ($param) = @_;
+
+ print Dumper($param);
+
+ die "implement me";
+
+ }});
+
+__PACKAGE__->register_method ({
+ name => 'pveclient_delete',
+ path => 'pveclient_delete',
+ method => 'DELETE',
+ description => "call API DELETE on <path>.",
+ parameters => {
+ additionalProperties => 0,
+ properties => $path_properties,
+ },
+ returns => $path_returns,
+ code => sub {
+ my ($param) = @_;
+
+ print Dumper($param);
+
+ die "implement me";
+
+ }});
+
+
+our $cmddef = {
+ config => $PVE::APIClient::Commands::config::cmddef,
+ list => $PVE::APIClient::Commands::list::cmddef,
+ lxc => $PVE::APIClient::Commands::lxc::cmddef,
+ remote => $PVE::APIClient::Commands::remote::cmddef,
+
+ api => {
+ get => [ __PACKAGE__, 'pveclient_get', ['remote', 'api_path']],
+ set => [ __PACKAGE__, 'pveclient_set', ['remote', 'api_path']],
+ create => [ __PACKAGE__, 'pveclient_create', ['remote', 'api_path']],
+ delete => [ __PACKAGE__, 'pveclient_delete', ['remote', 'api_path']],
+ }
+};
+
+
+__PACKAGE__->run_cli_handler();