M #-: Update Java bindings (#2386)

This commit is contained in:
Pavel Czerný authored and GitHub committed 2022-11-29 16:09:59 +01:00
1 parent bf5a9193a0
commit ff1f296ed1
5 files changed
+42 -17

No files matched your search

@@ -152,11 +152,12 @@ public class Image extends PoolElement
*
* @param client XML-RPC Client.
* @param id The image id of the target image we want to delete.
* @param force Ignore errors
* @return A encapsulated response.
*/
public static OneResponse delete(Client client, int id)
public static OneResponse delete(Client client, int id, boolean force)
{
return client.call(DELETE, id);
return client.call(DELETE, id, force);
}
/**
@@ -404,11 +405,12 @@ public class Image extends PoolElement
/**
* Deletes the image from OpenNebula.
*
* @param force Ignore errors
* @return A encapsulated response.
*/
public OneResponse delete()
public OneResponse delete(boolean force)
{
return delete(client, id);
return delete(client, id, force);
}
/**
@@ -62,6 +62,7 @@ public class VirtualMachine extends PoolElement{
private static final String UNLOCK = METHOD_PREFIX + "unlock";
private static final String ATTACHSG = METHOD_PREFIX + "attachsg";
private static final String DETACHSG = METHOD_PREFIX + "detachsg";
private static final String BACKUP = METHOD_PREFIX + "backup";
private static final String[] VM_STATES =
{
@@ -165,7 +166,9 @@ public class VirtualMachine extends PoolElement{
"HOTPLUG_NIC_POWEROFF",
"HOTPLUG_RESIZE",
"HOTPLUG_SAVEAS_UNDEPLOYED",
"HOTPLUG_SAVEAS_STOPPED"
"HOTPLUG_SAVEAS_STOPPED",
"BACKUP",
"BACKUP_POWEROFF"
};
private static final String[] SHORT_LCM_STATES =
@@ -238,7 +241,9 @@ public class VirtualMachine extends PoolElement{
"hotp", // HOTPLUG_NIC_POWEROFF
"hotp", // HOTPLUG_RESIZE
"hotp", // HOTPLUG_SAVEAS_UNDEPLOYED
"hotp" // HOTPLUG_SAVEAS_STOPPED
"hotp", // HOTPLUG_SAVEAS_STOPPED
"back", // BACKUP
"back" // BACKUP_POWEROFF
};
/**
@@ -773,6 +778,21 @@ public class VirtualMachine extends PoolElement{
return client.call(DETACHSG, id, nicid, sgid);
}
/**
* Backup Virtual Machine
*
* @param client XML-RPC Client.
* @param id The Virtual Machine ID (vid) of the target instance.
* @param ds_id Id of the datastore to save the backup
* @param reset Reset incremental backup, do full backup
* @return If an error occurs the error message contains the reason.
*/
public static OneResponse backup(Client client, int id, int ds_id,
boolean reset)
{
return client.call(BACKUP, id, ds_id, reset);
}
// =================================
// Instanced object XML-RPC methods
// =================================
@@ -1343,6 +1363,18 @@ public class VirtualMachine extends PoolElement{
return sgDetach(client, id, nicid, sgid);
}
/**
* Backup VM
*
* @param ds_id Id of the datastore to save the backup
* @param reset Reset incremental backup, do full backup
* @return If an error occurs the error message contains the reason.
*/
public OneResponse backup(int ds_id, boolean reset)
{
return backup(client, id, ds_id, reset);
}
// =================================
// Helpers
// =================================