use of org.ovirt.engine.core.common.businessentities.network.ProviderNetwork in project ovirt-engine by oVirt.
the class AutodefineExternalNetworkCommand method createExternalNetwork.
private Network createExternalNetwork(String name, Guid providerId) {
final Network network = getNetwork();
Network externalNetwork = new Network();
externalNetwork.setName(name);
externalNetwork.setDescription(EXTERNAL_DESCRIPTION);
externalNetwork.setDataCenterId(network.getDataCenterId());
ProviderNetwork providerNetwork = new ProviderNetwork();
providerNetwork.setProviderId(providerId);
providerNetwork.setPhysicalNetworkId(network.getId());
externalNetwork.setProvidedBy(providerNetwork);
return externalNetwork;
}
use of org.ovirt.engine.core.common.businessentities.network.ProviderNetwork in project ovirt-engine by oVirt.
the class NewNetworkModel method executeSave.
@Override
protected void executeSave() {
final AddNetworkWithSubnetParameters parameters = new AddNetworkWithSubnetParameters(getSelectedDc().getId(), getNetwork());
parameters.setVnicProfileRequired(false);
parameters.setNetworkClusterList(createNetworkAttachments());
// New network
if (getExternal().getEntity()) {
Provider<?> externalProvider = getExternalProviders().getSelectedItem();
ProviderNetwork providerNetwork = new ProviderNetwork();
providerNetwork.setProviderId(externalProvider.getId());
getNetwork().setProvidedBy(providerNetwork);
if (hasDefinedSubnet()) {
getSubnetModel().flush();
parameters.setExternalSubnet(getSubnetModel().getSubnet());
}
if (getConnectedToPhysicalNetwork().getEntity() && getUsePhysicalNetworkFromDatacenter().getEntity()) {
Network network = getDatacenterPhysicalNetwork().getSelectedItem();
providerNetwork.setPhysicalNetworkId(network.getId());
}
Frontend.getInstance().runAction(hasDefinedSubnet() ? ActionType.AddNetworkWithSubnetOnProvider : ActionType.AddNetworkOnProvider, parameters, addNetworkCallback(), null);
} else {
Frontend.getInstance().runAction(ActionType.AddNetwork, parameters, addNetworkCallback(), null);
}
}
Aggregations