From 0e5a252ffdf4b35e0bd2128947299c8f9889800a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Tue, 8 Apr 2014 12:17:37 +0200 Subject: [PATCH] Feature #2828: add new param to java oca --- include/RequestManagerVirtualMachine.h | 2 +- .../opennebula/client/vm/VirtualMachine.java | 23 ++++++++++++------- src/oca/ruby/opennebula/virtual_machine.rb | 1 - 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/include/RequestManagerVirtualMachine.h b/include/RequestManagerVirtualMachine.h index e752a79818..3ca57720a0 100644 --- a/include/RequestManagerVirtualMachine.h +++ b/include/RequestManagerVirtualMachine.h @@ -176,7 +176,7 @@ public: VirtualMachineSaveDisk(): RequestManagerVirtualMachine("VirtualMachineSaveDisk", "Saves a disk from virtual machine as a new image", - "A:siissb"){}; + "A:siissbb"){}; ~VirtualMachineSaveDisk(){}; diff --git a/src/oca/java/src/org/opennebula/client/vm/VirtualMachine.java b/src/oca/java/src/org/opennebula/client/vm/VirtualMachine.java index 764b83201e..d4a38167cf 100644 --- a/src/oca/java/src/org/opennebula/client/vm/VirtualMachine.java +++ b/src/oca/java/src/org/opennebula/client/vm/VirtualMachine.java @@ -365,12 +365,16 @@ public class VirtualMachine extends PoolElement{ * the default type * @param hot True to save the disk immediately, false will perform * the operation when the VM shuts down + * @param doTemplate True to clone also the VM originating template + * and replace the disk with the saved image * @return If an error occurs the error message contains the reason. */ public static OneResponse diskSnapshot(Client client, int id, - int diskId, String imageName, String imageType, boolean hot) + int diskId, String imageName, String imageType, + boolean hot, boolean doTemplate) { - return client.call(SAVEDISK, id ,diskId, imageName, imageType, hot); + return client.call(SAVEDISK, id ,diskId, imageName, imageType, + hot, doTemplate); } /** @@ -707,12 +711,15 @@ public class VirtualMachine extends PoolElement{ * the default type * @param hot True to save the disk immediately, false will perform * the operation when the VM shuts down + * @param doTemplate True to clone also the VM originating template + * and replace the disk with the saved image * @return If an error occurs the error message contains the reason. */ public OneResponse diskSnapshot(int diskId, String imageName, - String imageType, boolean hot) + String imageType, boolean hot, boolean doTemplate) { - return diskSnapshot(client, id, diskId, imageName, imageType, hot); + return diskSnapshot(client, id, diskId, imageName, imageType, + hot, doTemplate); } /** @@ -725,7 +732,7 @@ public class VirtualMachine extends PoolElement{ */ public OneResponse diskSnapshot(int diskId, String imageName) { - return diskSnapshot(diskId, imageName, "", false); + return diskSnapshot(diskId, imageName, "", false, false); } /** @@ -739,7 +746,7 @@ public class VirtualMachine extends PoolElement{ */ public OneResponse diskSnapshot(int diskId, String imageName, boolean hot) { - return diskSnapshot(diskId, imageName, "", hot); + return diskSnapshot(diskId, imageName, "", hot, false); } /** @@ -1136,11 +1143,11 @@ public class VirtualMachine extends PoolElement{ } /** - * @deprecated Replaced by {@link #diskSnapshot(int,String,String,boolean)} + * @deprecated Replaced by {@link #diskSnapshot(int,String,String,boolean,boolean)} */ public OneResponse savedisk(int diskId, String imageName, String imageType) { - return diskSnapshot(diskId, imageName, imageType, false); + return diskSnapshot(diskId, imageName, imageType, false, false); } /** diff --git a/src/oca/ruby/opennebula/virtual_machine.rb b/src/oca/ruby/opennebula/virtual_machine.rb index 51165c3437..87bbd37a97 100644 --- a/src/oca/ruby/opennebula/virtual_machine.rb +++ b/src/oca/ruby/opennebula/virtual_machine.rb @@ -393,7 +393,6 @@ module OpenNebula # perform the operation when the VM shuts down # @param do_template [true|false] True to clone also the VM originating # template and replace the disk with the saved image - # perform the operation when the VM shuts down # # @return [Integer, OpenNebula::Error] the new Image ID in case of # success, error otherwise