vmware sdk使用方法

来源:互联网 发布:听英语的软件 编辑:程序博客网 时间:2024/06/14 09:13

/** * Fetch Nics for the hostsystem *  * @param hostSystem *            - {@link HostSystem} vi sdk MO * @return */protected List<HostVirtualNic> getNics(HostSystem hostSystem) {    List<HostVirtualNic> nics = Lists.newArrayList();    HostConfigInfo config = hostSystem.getConfig();    if ((config != null) && (config.getNetwork() != null)            && (config.getNetwork().getVnic() != null)) {        for (HostVirtualNic nic : config.getNetwork().getVnic()) {            nics.add(nic);        }    }    return nics;}

参考

1

http://www.programcreek.com/java-api-examples/index.php?api=com.vmware.vim25.HostVirtualNic

2 这个方法比较笨拙些

http://blog.csdn.net/u013256816/article/details/49782109

0 0
原创粉丝点击