]> git.proxmox.com Git - pmg-api.git/blob - src/PMG/CLI/pmgsubscription.pm
a4d5b86f1c60789d1c184fcb6650df80fa32fa20
[pmg-api.git] / src / PMG / CLI / pmgsubscription.pm
1 package PMG::CLI::pmgsubscription;
2
3 use strict;
4 use warnings;
5
6 use PVE::Tools;
7 use PVE::SafeSyslog;
8 use PVE::INotify;
9 use PVE::CLIHandler;
10
11 use PMG::RESTEnvironment;
12 use PMG::API2::Subscription;
13
14 use base qw(PVE::CLIHandler);
15
16 my $nodename = PVE::INotify::nodename();
17
18 sub setup_environment {
19 PMG::RESTEnvironment->setup_default_cli_env();
20 }
21
22 our $cmddef = {
23 update => [ 'PMG::API2::Subscription', 'update', undef, { node => $nodename } ],
24 get => [ 'PMG::API2::Subscription', 'get', undef, { node => $nodename },
25 sub {
26 my $info = shift;
27 foreach my $k (sort keys %$info) {
28 print "$k: $info->{$k}\n";
29 }
30 }],
31 set => [ 'PMG::API2::Subscription', 'set', ['key'], { node => $nodename } ],
32 delete => [ 'PMG::API2::Subscription', 'delete', undef, { node => $nodename } ],
33 };
34
35 1;