feature #2009: OCA API calls and onevm command

(cherry picked from commit ffb1b27ca3e75725168263e1d9992a8d511b8919)
This commit is contained in:
Ruben S. Montero committed 2013-05-17 01:11:00 +02:00
1 parent fbbeaefc82
commit 6b41c6e0d5
3 files changed
+84 -4

No files matched your search

@@ -47,6 +47,7 @@ public class VirtualMachine extends PoolElement{
private static final String SNAPSHOTCREATE = METHOD_PREFIX + "snapshotcreate";
private static final String SNAPSHOTREVERT = METHOD_PREFIX + "snapshotrevert";
private static final String SNAPSHOTDELETE = METHOD_PREFIX + "snapshotdelete";
private static final String RECOVER = METHOD_PREFIX + "recover";
private static final String[] VM_STATES =
{
@@ -438,7 +439,7 @@ public class VirtualMachine extends PoolElement{
}
/**
* Deletes a VM snapshot
* Deletes a VM snapshot.
*
* @param client XML-RPC Client.
* @param id The VM id of the target VM.
@@ -450,6 +451,19 @@ public class VirtualMachine extends PoolElement{
return client.call(SNAPSHOTDELETE, id, snapId);
}
/**
* Recovers a stuck VM.
*
* @param client XML-RPC Client.
* @param id The virtual machine id (vid) of the target instance.
* @param success recover by succeeding the missing transaction if true.
* @return If an error occurs the error message contains the reason.
*/
public static OneResponse recover(Client client, int id, boolean success)
{
return client.call(RECOVER, id, success);
}
// =================================
// Instanced object XML-RPC methods
// =================================
@@ -817,6 +831,17 @@ public class VirtualMachine extends PoolElement{
return snapshotDelete(client, id, snapId);
}
/**
* Recovers a stuck VM.
*
* @param success recover by succeeding the missing transaction if true.
* @return If an error occurs the error message contains the reason.
*/
public OneResponse recover(boolean success)
{
return recover(client, id, success);
}
// =================================
// Helpers
// =================================