Search in sources :

Example 16 with IpConfiguration

use of org.ovirt.engine.core.common.businessentities.network.IpConfiguration in project ovirt-engine by oVirt.

the class NicLabelsCompleter method createNetworkAttachment.

private NetworkAttachment createNetworkAttachment(Guid nicId, String nicName, Guid networkId, String networkName) {
    NetworkAttachment networkAttachment = new NetworkAttachment();
    networkAttachment.setNicId(nicId);
    networkAttachment.setNicName(nicName);
    networkAttachment.setNetworkId(networkId);
    networkAttachment.setNetworkName(networkName);
    IpConfiguration ipConfiguration = NetworkCommonUtils.createDefaultIpConfiguration();
    networkAttachment.setIpConfiguration(ipConfiguration);
    return networkAttachment;
}
Also used : IpConfiguration(org.ovirt.engine.core.common.businessentities.network.IpConfiguration) NetworkAttachment(org.ovirt.engine.core.common.businessentities.network.NetworkAttachment)

Example 17 with IpConfiguration

use of org.ovirt.engine.core.common.businessentities.network.IpConfiguration in project ovirt-engine by oVirt.

the class NetworkAttachmentIpConfigurationValidatorTest method initIpConfiguration.

private void initIpConfiguration() {
    IpConfiguration ipConfiguration = new IpConfiguration();
    getTestedNetworkAttachment().setIpConfiguration(ipConfiguration);
}
Also used : IpConfiguration(org.ovirt.engine.core.common.businessentities.network.IpConfiguration)

Example 18 with IpConfiguration

use of org.ovirt.engine.core.common.businessentities.network.IpConfiguration in project ovirt-engine by oVirt.

the class NetworkConfigurator method createSetupNetworkParams.

public HostSetupNetworksParameters createSetupNetworkParams(VdsNetworkInterface nic) {
    HostSetupNetworksParameters parameters = new HostSetupNetworksParameters(host.getId());
    NetworkAttachment managementAttachment = new NetworkAttachment();
    managementAttachment.setNetworkId(managementNetwork.getId());
    Map<String, VdsNetworkInterface> nicNameToNic = Entities.entitiesByName(host.getInterfaces());
    Guid baseNicId = nicNameToNic.get(NetworkCommonUtils.stripVlan(nic)).getId();
    managementAttachment.setNicId(baseNicId);
    IpConfiguration ipConfiguration = new IpConfiguration();
    ipConfiguration.setIPv4Addresses(Collections.singletonList(new NicToIpv4AddressFunction().apply(nic)));
    if (FeatureSupported.ipv6Supported(host.getClusterCompatibilityVersion())) {
        ipConfiguration.setIpV6Addresses(Collections.singletonList(new NicToIpv6AddressFunction().apply(nic)));
    }
    managementAttachment.setIpConfiguration(ipConfiguration);
    parameters.getNetworkAttachments().add(managementAttachment);
    return parameters;
}
Also used : IpConfiguration(org.ovirt.engine.core.common.businessentities.network.IpConfiguration) NicToIpv6AddressFunction(org.ovirt.engine.core.utils.network.function.NicToIpv6AddressFunction) VdsNetworkInterface(org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface) NicToIpv4AddressFunction(org.ovirt.engine.core.utils.network.function.NicToIpv4AddressFunction) HostSetupNetworksParameters(org.ovirt.engine.core.common.action.HostSetupNetworksParameters) Guid(org.ovirt.engine.core.compat.Guid) NetworkAttachment(org.ovirt.engine.core.common.businessentities.network.NetworkAttachment)

Example 19 with IpConfiguration

use of org.ovirt.engine.core.common.businessentities.network.IpConfiguration in project ovirt-engine by oVirt.

the class NetworkCommonUtils method createDefaultIpConfiguration.

public static IpConfiguration createDefaultIpConfiguration() {
    IpConfiguration ipConfiguration = new IpConfiguration();
    IPv4Address iPv4Address = createDefaultIpv4Address();
    ipConfiguration.getIPv4Addresses().add(iPv4Address);
    IpV6Address ipv6Address = createDefaultIpv6Address();
    ipConfiguration.getIpV6Addresses().add(ipv6Address);
    return ipConfiguration;
}
Also used : IpConfiguration(org.ovirt.engine.core.common.businessentities.network.IpConfiguration) IpV6Address(org.ovirt.engine.core.common.businessentities.network.IpV6Address) IPv4Address(org.ovirt.engine.core.common.businessentities.network.IPv4Address)

Example 20 with IpConfiguration

use of org.ovirt.engine.core.common.businessentities.network.IpConfiguration in project ovirt-engine by oVirt.

the class NetworkAttachmentDaoImpl method mapIpConfiguration.

private void mapIpConfiguration(NetworkAttachment networkAttachment, MapSqlParameterSource mapper) {
    final IpConfiguration ipConfiguration = networkAttachment.getIpConfiguration() == null ? new IpConfiguration() : networkAttachment.getIpConfiguration();
    mapIpv4Configuration(mapper, ipConfiguration);
    mapIpv6Configuration(mapper, ipConfiguration);
}
Also used : IpConfiguration(org.ovirt.engine.core.common.businessentities.network.IpConfiguration)

Aggregations

IpConfiguration (org.ovirt.engine.core.common.businessentities.network.IpConfiguration)24 NetworkAttachment (org.ovirt.engine.core.common.businessentities.network.NetworkAttachment)10 IPv4Address (org.ovirt.engine.core.common.businessentities.network.IPv4Address)6 Test (org.junit.Test)4 IpV6Address (org.ovirt.engine.core.common.businessentities.network.IpV6Address)4 ValidationResult (org.ovirt.engine.core.bll.ValidationResult)3 NameServer (org.ovirt.engine.core.common.businessentities.network.NameServer)3 HashMap (java.util.HashMap)2 Before (org.junit.Before)2 HostSetupNetworksParameters (org.ovirt.engine.core.common.action.HostSetupNetworksParameters)2 DnsResolverConfiguration (org.ovirt.engine.core.common.businessentities.network.DnsResolverConfiguration)2 VdsNetworkInterface (org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface)2 Guid (org.ovirt.engine.core.compat.Guid)2 NicToIpv4AddressFunction (org.ovirt.engine.core.utils.network.function.NicToIpv4AddressFunction)2 NicToIpv6AddressFunction (org.ovirt.engine.core.utils.network.function.NicToIpv6AddressFunction)2 Cluster (org.ovirt.engine.core.common.businessentities.Cluster)1 HostNetworkQos (org.ovirt.engine.core.common.businessentities.network.HostNetworkQos)1 Ipv4BootProtocol (org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol)1 Ipv6BootProtocol (org.ovirt.engine.core.common.businessentities.network.Ipv6BootProtocol)1 Network (org.ovirt.engine.core.common.businessentities.network.Network)1