diff --git a/src/oca/java/src/org/opennebula/client/cluster/Cluster.java b/src/oca/java/src/org/opennebula/client/cluster/Cluster.java index 15ea8b3e31..094016ae1a 100644 --- a/src/oca/java/src/org/opennebula/client/cluster/Cluster.java +++ b/src/oca/java/src/org/opennebula/client/cluster/Cluster.java @@ -37,6 +37,7 @@ public class Cluster extends PoolElement{ private static final String DELDATASTORE = METHOD_PREFIX + "deldatastore"; private static final String ADDVNET = METHOD_PREFIX + "addvnet"; private static final String DELVNET = METHOD_PREFIX + "delvnet"; + private static final String RENAME = METHOD_PREFIX + "rename"; /** * Creates a new Cluster representation. @@ -199,6 +200,19 @@ public class Cluster extends PoolElement{ return client.call(DELVNET, id, vnetId); } + /** + * Renames this Cluster. + * + * @param client XML-RPC Client. + * @param id The image id of the target host we want to modify. + * @param name New name for the Cluster + * @return If successful the message contains the cluster id. + */ + public static OneResponse rename(Client client, int id, String name) + { + return client.call(RENAME, id, name); + } + // ================================= // Instanced object XML-RPC methods // ================================= @@ -315,6 +329,17 @@ public class Cluster extends PoolElement{ return delVnet(client, id, vnetId); } + /** + * Renames this Cluster + * + * @param name New name for the Cluster. + * @return If an error occurs the error message contains the reason. + */ + public OneResponse rename(String name) + { + return rename(client, id, name); + } + // ================================= // Helpers // ================================= diff --git a/src/oca/java/src/org/opennebula/client/datastore/Datastore.java b/src/oca/java/src/org/opennebula/client/datastore/Datastore.java index 26a03b8b60..f68b42303f 100644 --- a/src/oca/java/src/org/opennebula/client/datastore/Datastore.java +++ b/src/oca/java/src/org/opennebula/client/datastore/Datastore.java @@ -35,6 +35,7 @@ public class Datastore extends PoolElement private static final String UPDATE = METHOD_PREFIX + "update"; private static final String CHOWN = METHOD_PREFIX + "chown"; private static final String CHMOD = METHOD_PREFIX + "chmod"; + private static final String RENAME = METHOD_PREFIX + "rename"; private static final String[] DATASTORE_TYPES = {"IMAGE", "SYSTEM", "FILE"}; @@ -212,6 +213,19 @@ public class Datastore extends PoolElement return chmod(client, CHMOD, id, octet); } + /** + * Renames this Datastore. + * + * @param client XML-RPC Client. + * @param id The image id of the target host we want to modify. + * @param name New name for the Datastore + * @return If successful the message contains the datastore id. + */ + public static OneResponse rename(Client client, int id, String name) + { + return client.call(RENAME, id, name); + } + // ================================= // Instanced object XML-RPC methods // ================================= @@ -373,6 +387,17 @@ public class Datastore extends PoolElement return chmod(client, id, octet); } + /** + * Renames this Datastore + * + * @param name New name for the Datastore. + * @return If an error occurs the error message contains the reason. + */ + public OneResponse rename(String name) + { + return rename(client, id, name); + } + // ================================= // Helpers // ================================= diff --git a/src/oca/java/src/org/opennebula/client/host/Host.java b/src/oca/java/src/org/opennebula/client/host/Host.java index df36d87eae..f9aba9eb8f 100644 --- a/src/oca/java/src/org/opennebula/client/host/Host.java +++ b/src/oca/java/src/org/opennebula/client/host/Host.java @@ -34,6 +34,7 @@ public class Host extends PoolElement{ private static final String ENABLE = METHOD_PREFIX + "enable"; private static final String UPDATE = METHOD_PREFIX + "update"; private static final String MONITORING = METHOD_PREFIX + "monitoring"; + private static final String RENAME = METHOD_PREFIX + "rename"; private static final String[] HOST_STATES = {"INIT", "MONITORING_MONITORED", "MONITORED", "ERROR", "DISABLED", @@ -189,6 +190,19 @@ public class Host extends PoolElement{ return client.call(MONITORING, id); } + /** + * Renames this Host. + * + * @param client XML-RPC Client. + * @param id The image id of the target host we want to modify. + * @param name New name for the Host + * @return If successful the message contains the host id. + */ + public static OneResponse rename(Client client, int id, String name) + { + return client.call(RENAME, id, name); + } + // ================================= // Instanced object XML-RPC methods // ================================= @@ -280,6 +294,17 @@ public class Host extends PoolElement{ return monitoring(client, id); } + /** + * Renames this Host. + * + * @param name New name for the Host + * @return If successful the message contains the host id. + */ + public OneResponse rename(String name) + { + return rename(client, id, name); + } + // ================================= // Helpers // =================================