use of org.ovirt.engine.core.common.businessentities.network.ProviderNetwork in project ovirt-engine by oVirt.
the class UpdateNetworkValidatorTest method createExternalNetwork.
private Network createExternalNetwork() {
Network externalNetwork = new Network();
ProviderNetwork providerNetwork = createProviderNetwork(Guid.newGuid());
network.setProvidedBy(providerNetwork);
externalNetwork.setProvidedBy(providerNetwork);
return externalNetwork;
}
use of org.ovirt.engine.core.common.businessentities.network.ProviderNetwork in project ovirt-engine by oVirt.
the class NewExternalSubnetModel method onSave.
private void onSave() {
if (!validate()) {
return;
}
// Save changes.
flush();
startProgress();
ProviderNetwork providedBy = getNetwork().getEntity().getProvidedBy();
Frontend.getInstance().runAction(ActionType.AddSubnetToProvider, new AddExternalSubnetParameters(getSubnetModel().getSubnet(), providedBy.getProviderId(), providedBy.getExternalId()), result -> {
ActionReturnValue returnValue = result.getReturnValue();
stopProgress();
if (returnValue != null && returnValue.getSucceeded()) {
cancel();
}
}, this, true);
}
use of org.ovirt.engine.core.common.businessentities.network.ProviderNetwork in project ovirt-engine by oVirt.
the class BaseNetworkProviderProxy method map.
private List<Network> map(List<com.woorea.openstack.quantum.model.Network> externalNetworks) {
List<Network> networks = new ArrayList<>(externalNetworks.size());
for (com.woorea.openstack.quantum.model.Network externalNetwork : externalNetworks) {
Network network = new Network();
network.setVmNetwork(true);
network.setProvidedBy(new ProviderNetwork(getProvider().getId(), externalNetwork.getId()));
network.setName(externalNetwork.getName());
networks.add(network);
}
return networks;
}
use of org.ovirt.engine.core.common.businessentities.network.ProviderNetwork in project ovirt-engine by oVirt.
the class AddSubnetToProviderCommand method getExternalNetwork.
private ProviderNetwork getExternalNetwork() {
ProviderNetwork providerNetwork = new ProviderNetwork();
providerNetwork.setProviderId(getParameters().getProviderId());
providerNetwork.setExternalId(getParameters().getNetworkId());
return providerNetwork;
}
use of org.ovirt.engine.core.common.businessentities.network.ProviderNetwork in project ovirt-engine by oVirt.
the class GetExternalSubnetsOnProviderByExternalNetworkQuery method executeQueryCommand.
@Override
protected void executeQueryCommand() {
Provider<?> provider = providerDao.get(getParameters().getProviderId());
if (provider == null) {
return;
}
NetworkProviderProxy client = providerProxyFactory.create(provider);
ProviderNetwork providedBy = new ProviderNetwork();
providedBy.setProviderId(getParameters().getProviderId());
providedBy.setExternalId(getParameters().getNetworkId());
getQueryReturnValue().setReturnValue(client.getAllSubnets(providedBy));
}
Aggregations