]> git.proxmox.com Git - pmg-api.git/blobdiff - PMG/API2/Nodes.pm
add pmg report api call for the gui
[pmg-api.git] / PMG / API2 / Nodes.pm
index 0a578b2a8058321ea8b934e045f5589aba1599f8..7734977e9aadd3319dbcc72169be25778c096065 100644 (file)
@@ -15,6 +15,7 @@ use PVE::ProcFSTools;
 
 use PMG::pmgcfg;
 use PMG::Ticket;
+use PMG::Report;
 use PMG::API2::Subscription;
 use PMG::API2::APT;
 use PMG::API2::Tasks;
@@ -112,6 +113,7 @@ __PACKAGE__->register_method ({
            { name => 'tasks' },
            { name => 'tracker' },
            { name => 'time' },
+           { name => 'report' },
            { name => 'status' },
            { name => 'subscription' },
            { name => 'termproxy' },
@@ -121,6 +123,27 @@ __PACKAGE__->register_method ({
        return $result;
     }});
 
+__PACKAGE__->register_method({
+    name => 'report',
+    path => 'report',
+    method => 'GET',
+    protected => 1,
+    proxyto => 'node',
+    permissions => { check => [ 'admin', 'audit' ] },
+    description => "Gather various system information about a node",
+    parameters => {
+       additionalProperties => 0,
+       properties => {
+           node => get_standard_option('pve-node'),
+       },
+    },
+    returns => {
+       type => 'string',
+    },
+    code => sub {
+       return PMG::Report::generate();
+    }});
+
 __PACKAGE__->register_method({
     name => 'rrddata',
     path => 'rrddata',