{
listSnapshots(vm);
}
else if(op.equalsIgnoreCase("revert"))
{
VirtualMachineSnapshot vmsnap = getSnapshotInTree(
vm, snapshotname);
if(vmsnap!=null)
{
Task task = vmsnap.revertToSnapshot_Task(null);
if(task.waitForMe()==Task.SUCCESS)
{
System.out.println("Reverted to snapshot:"
+ snapshotname);
}
}
}
else if(op.equalsIgnoreCase("removeall"))
{
Task task = vm.removeAllSnapshots_Task();
if(task.waitForMe()== Task.SUCCESS)
{
System.out.println("Removed all snapshots");
}
}
else if(op.equalsIgnoreCase("remove"))
{
VirtualMachineSnapshot vmsnap = getSnapshotInTree(
vm, snapshotname);
if(vmsnap!=null)
{
Task task = vmsnap.removeSnapshot_Task(removechild);
if(task.waitForMe()==Task.SUCCESS)
{
System.out.println("Removed snapshot:" + snapshotname);
}
}