[pmg-devel] [PATCH pmg-api] add pmg report api call for the gui

Dominik Csapak d.csapak at proxmox.com
Tue Feb 26 11:27:34 CET 2019


Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 PMG/API2/Nodes.pm | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/PMG/API2/Nodes.pm b/PMG/API2/Nodes.pm
index 0a578b2..7734977 100644
--- a/PMG/API2/Nodes.pm
+++ b/PMG/API2/Nodes.pm
@@ -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' },
@@ -122,6 +124,27 @@ __PACKAGE__->register_method ({
     }});
 
 __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',
     method => 'GET',
-- 
2.11.0




More information about the pmg-devel mailing list