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

svn-commits at proxmox.com svn-commits at proxmox.com
Fri Aug 27 09:24:56 CEST 2010


Author: dietmar
Date: 2010-08-27 07:24:56 +0000 (Fri, 27 Aug 2010)
New Revision: 5071

Modified:
   qemu-server/pve2/ChangeLog
   qemu-server/pve2/PVE/API2/QemuServer.pm
Log:


Modified: qemu-server/pve2/ChangeLog
===================================================================
--- qemu-server/pve2/ChangeLog	2010-08-27 07:23:12 UTC (rev 5070)
+++ qemu-server/pve2/ChangeLog	2010-08-27 07:24:56 UTC (rev 5071)
@@ -1,5 +1,7 @@
 2010-08-26  Proxmox Support Team  <support at proxmox.com>
 
+	* PVE/*: created directory hierachy for library compoments
+
 	* QemuServer.pm: use new libpve-common-perl
 
 2010-08-20  Proxmox Support Team  <support at proxmox.com>

Modified: qemu-server/pve2/PVE/API2/QemuServer.pm
===================================================================
--- qemu-server/pve2/PVE/API2/QemuServer.pm	2010-08-27 07:23:12 UTC (rev 5070)
+++ qemu-server/pve2/PVE/API2/QemuServer.pm	2010-08-27 07:24:56 UTC (rev 5071)
@@ -1,5 +1,45 @@
 package PVE::API2::QemuServer;
 
+use strict;
+use warnings;
 
+use PVE::RESTHandler;
 
+# API URLs
+#
+# GET    /vms/
+# GET    /vms/index  status of all VMs (cluster wide)
+# GET    /vms/qm  status of all Qemu VMs (cluster wide)
+# GET    /vms/qm/{node}/  status of all Qemu VMs (per node)
+# POST   /vms/qm/{node}/  create VM
+# GET    /vms/qm/{node}/{vmid}  status of all Qemu VMs (per node)
+# PUT    /vms/qm/{node}/{vmid}  set VM config/status
+# DELETE /vms/qm/{node}/{vmid}  destroy VM
+
+use base qw(PVE::RESTHandler);
+
+__PACKAGE__->register_method ({
+    name => 'index', 
+    path => '', 
+    method => 'GET',
+    description => "Virtual machine index.",
+    parameters => {
+    	additionalProperties => 0,
+	properties => {},
+    },
+    returns => {
+	type => 'array',
+	items => {
+	    type => "object",
+	    properties => {},
+	},
+	links => [ { rel => 'child', href => "{id}" } ],
+    },
+    code => sub {
+	my ($param) = @_;
+
+	return [{ id => 100 }];
+
+    }});
+
 1;




More information about the pve-devel mailing list