]>
git.proxmox.com Git - pve-client.git/blob - pveclient
165505fe45f33b485c5029d955234890827ec93e
5 use lib
'/usr/share/pve-client';
12 use PVE
::APIClient
::LWP
;
13 use PVE
::APIClient
::Helpers
;
14 use PVE
::APIClient
::Commands
::remote
;
20 my $text = "pveclient usage:\n\n";
22 $text .= "pveclient remote <help|add|remove> {options}\n\n";
24 $text .= "pveclient <get/set/create/delete> <path> {options}\n\n";
31 my ($path, $method, $args) = @_;
33 die "missing API path\n" if !defined($path);
35 my $info = PVE
::APIClient
::Helpers
::lookup_api_method
($path, $method);
36 my $param = PVE
::JSONSchema
::get_options
($info->{parameters
}, $args);
42 # NOTE: This binary is just a placeholer - nothing implemented so far!
44 #my $hostname = 'localhost';
45 #my $username = 'root@pam';
47 #my $conn = PVE::APIClient::LWP->new(
48 # username => $username,
49 # #password => 'yourpassword',
51 # #csrftoken => $csrftoken,
53 # # allow manual fingerprint verification
54 # manual_verification => 1,
57 #my $res = $conn->get("/", {});
58 #print to_json($res, { pretty => 1, canonical => 1});
60 my $cmd = shift || (print_usage
() && exit(-1));
65 if (scalar(@ARGV) && $ARGV[0] !~ m/^\-/) {
68 my $res = call_method
($path, $method, \
@ARGV);
70 } elsif ($cmd eq 'set') {
72 } elsif ($cmd eq 'create') {
74 } elsif ($cmd eq 'delete') {
76 } elsif ($cmd eq 'remote') {
77 PVE
::APIClient
::Commands
::remote-
>run_cli_handler();