From 004af1306b29aa6e8d283b89763be64e5ea5b088 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Fri, 25 Jul 2014 17:44:16 +0200 Subject: [PATCH] Feature #1696: add method to java oca --- .../org/opennebula/client/image/Image.java | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/oca/java/src/org/opennebula/client/image/Image.java b/src/oca/java/src/org/opennebula/client/image/Image.java index dc4653207b..dc5944ddb8 100644 --- a/src/oca/java/src/org/opennebula/client/image/Image.java +++ b/src/oca/java/src/org/opennebula/client/image/Image.java @@ -261,11 +261,12 @@ public class Image extends PoolElement * @param client XML-RPC Client. * @param id The Image id of the target Image. * @param name Name for the new Image. + * @param targetDS The ID of the target datastore. Set to -1 to use the current one. * @return If successful the message contains the new Image ID. */ - public static OneResponse clone(Client client, int id, String name) + public static OneResponse clone(Client client, int id, String name, int targetDS) { - return client.call(CLONE, id, name); + return client.call(CLONE, id, name, targetDS); } /** @@ -523,7 +524,19 @@ public class Image extends PoolElement */ public OneResponse clone(String name) { - return clone(client, id, name); + return clone(client, id, name, -1); + } + + /** + * Clones this Image into a new one + * + * @param name Name for the new Image. + * @param targetDS The ID of the target datastore. + * @return If successful the message contains the new Image ID. + */ + public OneResponse clone(String name, int targetDS) + { + return clone(client, id, name, targetDS); } /**