[pve-devel] [PATCH pve-manager 2/2] Add REST endpoint for /report call

Emmanuel Kasper e.kasper at proxmox.com
Tue Nov 3 12:02:20 CET 2015


---
 PVE/API2/Nodes.pm | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/PVE/API2/Nodes.pm b/PVE/API2/Nodes.pm
index 41baca0..8ee5164 100644
--- a/PVE/API2/Nodes.pm
+++ b/PVE/API2/Nodes.pm
@@ -25,6 +25,7 @@ use PVE::APLInfo;
 use PVE::HA::Config;
 use PVE::QemuServer;
 use PVE::API2::Subscription;
+use PVE::API2::Report;
 use PVE::API2::Services;
 use PVE::API2::Network;
 use PVE::API2::Tasks;
@@ -131,6 +132,7 @@ __PACKAGE__->register_method ({
 	    { name => 'syslog' },
 	    { name => 'status' },
 	    { name => 'subscription' },
+	    { name => 'report' },
 	    { name => 'tasks' },
 	    { name => 'rrd' }, # fixme: remove?
 	    { name => 'rrddata' },# fixme: remove?
@@ -1128,6 +1130,27 @@ __PACKAGE__->register_method({
 	return $rpcenv->fork_worker('download', undef, $user, $worker);
     }});
 
+__PACKAGE__->register_method({
+    name => 'report',
+    path => 'report',
+    method => 'GET',
+    permissions => {
+	check => ['perm', '/nodes/{node}', [ 'Sys.Audit' ]],
+    },
+    description => "Gather various systems information about a node",
+    proxyto => 'node',
+    parameters => {
+    additionalProperties => 0,
+	properties => {
+	    node => get_standard_option('pve-node'),
+	},
+    },
+    returns => {
+	type => 'object',
+    },
+    code => sub {
+	return { report => PVE::API2::Report::generate() };
+    }});
 
 my $get_start_stop_list = sub {
     my ($nodename, $autostart) = @_;
-- 
2.1.4





More information about the pve-devel mailing list