1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-16 22:50:10 +03:00

M #-: Java API for MarketPlace and Zone enable (#1325)

This commit is contained in:
Pavel Czerný 2021-06-22 10:33:26 +02:00 committed by GitHub
parent a4e6e50a7b
commit a4cb02a79f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 51 additions and 0 deletions

View File

@ -35,6 +35,7 @@ public class MarketPlace extends PoolElement
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 ENABLE = METHOD_PREFIX + "enable";
/**
* Creates a new MarketPlace representation.
@ -205,6 +206,19 @@ public class MarketPlace extends PoolElement
return client.call(RENAME, id, name);
}
/**
* Enable or disable the Marketplace.
*
* @param client XML-RPC Client.
* @param id The id of the target object.
* @param enable True for enabling, false for disabling
* @return If successful the message contains the MarketPlace id.
*/
public static OneResponse enable(Client client, int id, boolean enable)
{
return client.call(ENABLE, id, enable);
}
// =================================
// Instanced object XML-RPC methods
// =================================
@ -346,6 +360,18 @@ public class MarketPlace extends PoolElement
return rename(client, id, name);
}
/**
* Enable or disable this Marketplace.
*
* @param enable True for enabling, false for disabling
* @return If successful the message contains the MarketPlace id.
*/
public OneResponse enable(boolean enable)
{
return enable(client, id, enable);
}
// =================================
// Helpers
// =================================

View File

@ -33,6 +33,7 @@ public class Zone extends PoolElement{
private static final String UPDATE = METHOD_PREFIX + "update";
private static final String RENAME = METHOD_PREFIX + "rename";
private static final String DELETE = METHOD_PREFIX + "delete";
private static final String ENABLE = METHOD_PREFIX + "enable";
/**
* Creates a new Zone representation.
@ -110,6 +111,19 @@ public class Zone extends PoolElement{
return client.call(DELETE, id);
}
/**
* Enable or disable the given Zone
*
* @param client XML-RPC Client.
* @param id The zone id.
* @param enable True for enabling, false for disabling
* @return A encapsulated response.
*/
public static OneResponse enable(Client client, int id, boolean enable)
{
return client.call(ENABLE, id, enable);
}
/**
* Replaces the template contents.
*
@ -165,6 +179,17 @@ public class Zone extends PoolElement{
return delete(client, id);
}
/**
* Enable or disable this Zone
*
* @param enable True for enabling, false for disabling
* @return A encapsulated response.
*/
public OneResponse enable(boolean enable)
{
return enable(client, id, enable);
}
/**
* Renames this Zone
*