本文整理汇总了Java中com.vmware.vim25.VirtualMachineSnapshotInfo类的典型用法代码示例。如果您正苦于以下问题:Java VirtualMachineSnapshotInfo类的具体用法?Java VirtualMachineSnapshotInfo怎么用?Java VirtualMachineSnapshotInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VirtualMachineSnapshotInfo类属于com.vmware.vim25包,在下文中一共展示了VirtualMachineSnapshotInfo类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: removeAllSnapshots
import com.vmware.vim25.VirtualMachineSnapshotInfo; //导入依赖的package包/类
public boolean removeAllSnapshots() throws Exception {
VirtualMachineSnapshotInfo snapshotInfo = getSnapshotInfo();
if (snapshotInfo != null && snapshotInfo.getRootSnapshotList() != null) {
List<VirtualMachineSnapshotTree> tree = snapshotInfo.getRootSnapshotList();
for (VirtualMachineSnapshotTree treeNode : tree) {
ManagedObjectReference morTask = _context.getService().removeSnapshotTask(treeNode.getSnapshot(), true, true);
boolean result = _context.getVimClient().waitForTask(morTask);
if (result) {
_context.waitForTaskProgressDone(morTask);
} else {
s_logger.error("VMware removeSnapshot_Task failed due to " + TaskMO.getTaskFailureInfo(_context, morTask));
return false;
}
}
}
return true;
}
示例2: findSnapshot
import com.vmware.vim25.VirtualMachineSnapshotInfo; //导入依赖的package包/类
public ManagedObjectReference findSnapshot(String vmName, String snapshotId)
throws Exception {
ManagedObjectReference vm = getVirtualMachine(vmName);
VirtualMachineSnapshotInfo info = (VirtualMachineSnapshotInfo) getServiceUtil()
.getDynamicProperty(vm, PROPERTY_SNAPSHOT);
if (info == null) {
return null;
}
return searchSnapshot(info.getRootSnapshotList(), snapshotId);
}
示例3: listSnapshots
import com.vmware.vim25.VirtualMachineSnapshotInfo; //导入依赖的package包/类
static void listSnapshots(VirtualMachine vm)
{
if(vm==null)
{
return;
}
VirtualMachineSnapshotInfo snapInfo = vm.getSnapshot();
VirtualMachineSnapshotTree[] snapTree =
snapInfo.getRootSnapshotList();
printSnapshots(snapTree);
}
示例4: getSnapshotMor
import com.vmware.vim25.VirtualMachineSnapshotInfo; //导入依赖的package包/类
public ManagedObjectReference getSnapshotMor(String snapshotName) throws Exception {
VirtualMachineSnapshotInfo info = getSnapshotInfo();
if (info != null) {
List<VirtualMachineSnapshotTree> snapTree = info.getRootSnapshotList();
return VmwareHelper.findSnapshotInTree(snapTree, snapshotName);
}
return null;
}
示例5: hasSnapshot
import com.vmware.vim25.VirtualMachineSnapshotInfo; //导入依赖的package包/类
public boolean hasSnapshot() throws Exception {
VirtualMachineSnapshotInfo info = getSnapshotInfo();
if (info != null) {
ManagedObjectReference currentSnapshot = info.getCurrentSnapshot();
if (currentSnapshot != null) {
return true;
}
List<VirtualMachineSnapshotTree> rootSnapshotList = info.getRootSnapshotList();
if (rootSnapshotList != null && rootSnapshotList.size() > 0) {
return true;
}
}
return false;
}
示例6: getSnapshotInfo
import com.vmware.vim25.VirtualMachineSnapshotInfo; //导入依赖的package包/类
public VirtualMachineSnapshotInfo getSnapshotInfo() throws Exception {
return (VirtualMachineSnapshotInfo)_context.getVimClient().getDynamicProperty(_mor, "snapshot");
}