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;
}
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);
}
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;
}
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;
}
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);
}
Aggregations