1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

Feature #2696: add group update call to java oca

This commit is contained in:
Carlos Martín 2014-04-08 15:53:30 +02:00
parent 22fa9960a4
commit 0589944e63

View File

@ -34,6 +34,7 @@ public class Group extends PoolElement{
private static final String QUOTA = METHOD_PREFIX + "quota";
private static final String ADD_PROVIDER = METHOD_PREFIX + "addprovider";
private static final String DEL_PROVIDER = METHOD_PREFIX + "delprovider";
private static final String UPDATE = METHOD_PREFIX + "update";
/**
* Creates a new Group representation.
@ -140,6 +141,21 @@ public class Group extends PoolElement{
return client.call(DEL_PROVIDER, id, zoneId, clusterId);
}
/**
* Replaces the template contents.
*
* @param client XML-RPC Client.
* @param id The group id of the target group we want to modify.
* @param new_template New template contents
* @param append True to append new attributes instead of replace the whole template
* @return If successful the message contains the group id.
*/
public static OneResponse update(Client client, int id, String new_template,
boolean append)
{
return client.call(UPDATE, id, new_template, append ? 1 : 0);
}
// =================================
// Instanced object XML-RPC methods
// =================================
@ -202,6 +218,29 @@ public class Group extends PoolElement{
return delProvider(client, id, zoneId, clusterId);
}
/**
* Replaces the template contents.
*
* @param new_template New template contents
* @return If successful the message contains the group id.
*/
public OneResponse update(String new_template)
{
return update(new_template, false);
}
/**
* Replaces the template contents.
*
* @param new_template New template contents
* @param append True to append new attributes instead of replace the whole template
* @return If successful the message contains the group id.
*/
public OneResponse update(String new_template, boolean append)
{
return update(client, id, new_template, append);
}
// =================================
// Helpers
// =================================