Search in sources :

Example 1 with HostOpaqueNetworkInfo

use of com.vmware.vim25.HostOpaqueNetworkInfo in project cloudstack by apache.

the class HostMO method hasOpaqueNSXNetwork.

public boolean hasOpaqueNSXNetwork() throws Exception {
    HostNetworkInfo netInfo = getHostNetworkInfo();
    List<HostOpaqueNetworkInfo> opaqueNetworks = netInfo.getOpaqueNetwork();
    if (opaqueNetworks != null) {
        for (HostOpaqueNetworkInfo opaqueNetwork : opaqueNetworks) {
            if (opaqueNetwork.getOpaqueNetworkId() != null && opaqueNetwork.getOpaqueNetworkId().equals("br-int") && opaqueNetwork.getOpaqueNetworkType() != null && opaqueNetwork.getOpaqueNetworkType().equals("nsx.network")) {
                return true;
            }
        }
        throw new Exception("NSX API VERSION >= 4.2 BUT br-int (nsx.network) NOT FOUND");
    } else {
        throw new Exception("NSX API VERSION >= 4.2 BUT br-int (nsx.network) NOT FOUND");
    }
}
Also used : HostNetworkInfo(com.vmware.vim25.HostNetworkInfo) HostOpaqueNetworkInfo(com.vmware.vim25.HostOpaqueNetworkInfo)

Aggregations

HostNetworkInfo (com.vmware.vim25.HostNetworkInfo)1 HostOpaqueNetworkInfo (com.vmware.vim25.HostOpaqueNetworkInfo)1