[pve-devel] r5137 - in qemu-server/pve2: . PVE/API2

svn-commits at proxmox.com svn-commits at proxmox.com
Tue Sep 14 10:49:47 CEST 2010


Author: dietmar
Date: 2010-09-14 08:49:47 +0000 (Tue, 14 Sep 2010)
New Revision: 5137

Modified:
   qemu-server/pve2/Makefile
   qemu-server/pve2/PVE/API2/QemuServerStatus.pm
   qemu-server/pve2/nqm
Log:
 add verifyapi


Modified: qemu-server/pve2/Makefile
===================================================================
--- qemu-server/pve2/Makefile	2010-09-14 08:47:24 UTC (rev 5136)
+++ qemu-server/pve2/Makefile	2010-09-14 08:49:47 UTC (rev 5137)
@@ -77,6 +77,7 @@
 	rm -rf debian
 	mkdir debian
 	make DESTDIR=${CURDIR}/debian install
+	perl -I. ./nqm verifyapi
 	install -d -m 0755 debian/DEBIAN
 	install -m 0644 control debian/DEBIAN
 	install -m 0755 postinst debian/DEBIAN

Modified: qemu-server/pve2/PVE/API2/QemuServerStatus.pm
===================================================================
--- qemu-server/pve2/PVE/API2/QemuServerStatus.pm	2010-09-14 08:47:24 UTC (rev 5136)
+++ qemu-server/pve2/PVE/API2/QemuServerStatus.pm	2010-09-14 08:49:47 UTC (rev 5137)
@@ -52,27 +52,26 @@
     description => "Set virtual machine status.",
     parameters => {
     	additionalProperties => 0,
-	properties => PVE::QemuServer::json_config_properties(
-	    {
-		node => get_standard_option('pve-node'),
-		vmid => get_standard_option('pve-vmid'),
-		skiplock => { 
-		    description => "Ignore locks - only root is allowed to use this option.",
-		    type => 'boolean', 
-		    optional => 1,
-		},
-		command => { 
-		    type => 'string',
-		    enum => [qw(start stop reset shutdown cad suspend resume vncticket) ],
-		},
-		ticket => { 
-		    description => "Secret VNC ticket (required by vncticket command).",
-		    type => 'string',
-		    optional => 1,
-		    minLength => 8, # just to improve security
-		    pattern => '[A-Za-z0-9\+\/\=]+', # base64 characters		    
-		},
-	    }),
+	properties => {
+	    node => get_standard_option('pve-node'),
+	    vmid => get_standard_option('pve-vmid'),
+	    skiplock => { 
+		description => "Ignore locks - only root is allowed to use this option.",
+		type => 'boolean', 
+		optional => 1,
+	    },
+	    command => { 
+		type => 'string',
+		enum => [qw(start stop reset shutdown cad suspend resume vncticket) ],
+	    },
+	    ticket => { 
+		description => "Secret VNC ticket (required by vncticket command).",
+		type => 'string',
+		optional => 1,
+		minLength => 8, # just to improve security
+		pattern => '[A-Za-z0-9\+\/\=]+', # base64 characters
+	    },
+	},
     },
     returns => { type => 'null'},
     code => sub {
@@ -119,8 +118,6 @@
 	    raise_param_exc({ command => "unknown command '$command'" }) 
 	}
 
-	print "TESTCMD $command\n";
-
 	return undef;
     }});
 

Modified: qemu-server/pve2/nqm
===================================================================
--- qemu-server/pve2/nqm	2010-09-14 08:47:24 UTC (rev 5136)
+++ qemu-server/pve2/nqm	2010-09-14 08:49:47 UTC (rev 5137)
@@ -442,6 +442,11 @@
 
 my $cmd = shift;
 
+if ($cmd eq 'verifyapi') {
+    PVE::RESTHandler::validate_method_schemas();
+    exit 0;
+}
+
 PVE::CLIHandler::handle_cmd($cmddef, "qm", $cmd, \@ARGV);
 
 exit 0;




More information about the pve-devel mailing list