• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java VirtualCdromIsoBackingInfo类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.vmware.vim25.VirtualCdromIsoBackingInfo的典型用法代码示例。如果您正苦于以下问题:Java VirtualCdromIsoBackingInfo类的具体用法?Java VirtualCdromIsoBackingInfo怎么用?Java VirtualCdromIsoBackingInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



VirtualCdromIsoBackingInfo类属于com.vmware.vim25包,在下文中一共展示了VirtualCdromIsoBackingInfo类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createAddCdConfigSpec

import com.vmware.vim25.VirtualCdromIsoBackingInfo; //导入依赖的package包/类
static VirtualDeviceConfigSpec createAddCdConfigSpec(VirtualMachine vm, String dsName, String isoName) throws Exception 
{
  VirtualDeviceConfigSpec cdSpec = new VirtualDeviceConfigSpec();

  cdSpec.setOperation(VirtualDeviceConfigSpecOperation.add);         

  VirtualCdrom cdrom =  new VirtualCdrom();
  VirtualCdromIsoBackingInfo cdDeviceBacking = new  VirtualCdromIsoBackingInfo();
  DatastoreSummary ds = findDatastoreSummary(vm, dsName);
  cdDeviceBacking.setDatastore(ds.getDatastore());
  cdDeviceBacking.setFileName("[" + dsName +"] "+ vm.getName() 
      + "/" + isoName + ".iso");
  VirtualDevice vd = getIDEController(vm);          
  cdrom.setBacking(cdDeviceBacking);                    
  cdrom.setControllerKey(vd.getKey());
  cdrom.setUnitNumber(vd.getUnitNumber());
  cdrom.setKey(-1);          

  cdSpec.setDevice(cdrom);

  return cdSpec;          
}
 
开发者ID:Juniper,项目名称:vijava,代码行数:23,代码来源:VmCdOp.java


示例2: getPopulatedCDSpecs

import com.vmware.vim25.VirtualCdromIsoBackingInfo; //导入依赖的package包/类
VirtualDeviceConfigSpec getPopulatedCDSpecs(String fileName, ManagedObjectReference dataStoreRef,
                                            List<VirtualDevice> virtualDevicesList,
                                            VirtualDeviceConfigSpecOperation operation,
                                            Integer controllerKey, Integer unitNumber, Integer key,
                                            String parameter, VmInputs vmInputs) {

    VirtualDeviceConfigSpec cdSpecs = new VirtualDeviceConfigSpec();
    if (Operation.ADD.toString().equalsIgnoreCase(parameter)) {
        VirtualCdromIsoBackingInfo cdIsoBacking = new VirtualCdromIsoBackingInfo();
        cdIsoBacking.setDatastore(dataStoreRef);
        cdIsoBacking.setFileName(fileName + TEST_CD_ISO);

        VirtualCdrom cdRom = new VirtualCdrom();
        cdRom.setBacking(cdIsoBacking);
        cdRom.setControllerKey(controllerKey);
        cdRom.setUnitNumber(unitNumber);
        cdRom.setKey(key);

        return getCDSpec(cdSpecs, operation, cdRom);
    } else {
        VirtualCdrom cdRemove = findVirtualDevice(VirtualCdrom.class, virtualDevicesList, vmInputs);
        if (cdRemove != null) {
            return getCDSpec(cdSpecs, operation, cdRemove);
        }
    }
    throw new RuntimeException("No optical device named: [" + vmInputs.getUpdateValue() + "] can be found.");
}
 
开发者ID:CloudSlang,项目名称:cs-actions,代码行数:28,代码来源:VmUtils.java


示例3: getIsoDevice

import com.vmware.vim25.VirtualCdromIsoBackingInfo; //导入依赖的package包/类
public VirtualDevice getIsoDevice(String filename) throws Exception {
    List<VirtualDevice> devices = (List<VirtualDevice>)_context.getVimClient().
            getDynamicProperty(_mor, "config.hardware.device");
    if(devices != null && devices.size() > 0) {
        for(VirtualDevice device : devices) {
            if(device instanceof VirtualCdrom && device.getBacking() instanceof VirtualCdromIsoBackingInfo &&
                    ((VirtualCdromIsoBackingInfo)device.getBacking()).getFileName().equals(filename)) {
                return device;
            }
        }
    }
    return null;
}
 
开发者ID:apache,项目名称:cloudstack,代码行数:14,代码来源:VirtualMachineMO.java


示例4: insertCdrom

import com.vmware.vim25.VirtualCdromIsoBackingInfo; //导入依赖的package包/类
/**
 * Changes to backing of the cdrom to an iso-backed one.
 *
 * @param cdrom
 * @param imagePath
 *            path to iso on disk, sth. like "[datastore] /images/ubuntu-16.04-amd64.iso"
 */
public static void insertCdrom(VirtualCdrom cdrom, String imagePath) {
    VirtualCdromIsoBackingInfo backing = new VirtualCdromIsoBackingInfo();
    backing.setFileName(imagePath);

    cdrom.setBacking(backing);
}
 
开发者ID:vmware,项目名称:photon-model,代码行数:14,代码来源:ClientUtils.java



注:本文中的com.vmware.vim25.VirtualCdromIsoBackingInfo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java LicenseResolver类代码示例发布时间:2022-05-22
下一篇:
Java LeaveRoom类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap