Search in sources :

Example 6 with HostPortGroup

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

the class HostMO method getPortGroupSpec.

public HostPortGroupSpec getPortGroupSpec(String portGroupName) throws Exception {
    HostNetworkInfo hostNetInfo = getHostNetworkInfo();
    List<HostPortGroup> portGroups = hostNetInfo.getPortgroup();
    if (portGroups != null) {
        for (HostPortGroup portGroup : portGroups) {
            HostPortGroupSpec spec = portGroup.getSpec();
            if (spec.getName().equals(portGroupName))
                return spec;
        }
    }
    return null;
}
Also used : HostNetworkInfo(com.vmware.vim25.HostNetworkInfo) HostPortGroup(com.vmware.vim25.HostPortGroup) HostPortGroupSpec(com.vmware.vim25.HostPortGroupSpec)

Example 7 with HostPortGroup

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

the class HostMO method getPortGroupVirtualSwitchName.

public String getPortGroupVirtualSwitchName(String portGroupName) throws Exception {
    HostNetworkInfo hostNetInfo = getHostNetworkInfo();
    List<HostPortGroup> portGroups = hostNetInfo.getPortgroup();
    if (portGroups != null) {
        for (HostPortGroup portGroup : portGroups) {
            HostPortGroupSpec spec = portGroup.getSpec();
            if (spec.getName().equals(portGroupName))
                return spec.getVswitchName();
        }
    }
    return null;
}
Also used : HostNetworkInfo(com.vmware.vim25.HostNetworkInfo) HostPortGroup(com.vmware.vim25.HostPortGroup) HostPortGroupSpec(com.vmware.vim25.HostPortGroupSpec)

Aggregations

HostPortGroup (com.vmware.vim25.HostPortGroup)7 HostPortGroupSpec (com.vmware.vim25.HostPortGroupSpec)7 HostNetworkInfo (com.vmware.vim25.HostNetworkInfo)6 HostNetworkSecurityPolicy (com.vmware.vim25.HostNetworkSecurityPolicy)1 InvalidParameterException (java.security.InvalidParameterException)1 ArrayList (java.util.ArrayList)1