use of org.ovirt.engine.core.common.action.AddNetworkWithSubnetParameters 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