mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-23 13:15:14 +09:00
feature #2009: OCA API calls and onevm command
(cherry picked from commit ffb1b27ca3e75725168263e1d9992a8d511b8919)
This commit is contained in:
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
|
||||
// =================================
|
||||
|
||||
Reference in new issue
Block a user