Search in sources :

Example 16 with ProviderNetwork

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;
}
Also used : ProviderNetwork(org.ovirt.engine.core.common.businessentities.network.ProviderNetwork) Network(org.ovirt.engine.core.common.businessentities.network.Network) ProviderNetwork(org.ovirt.engine.core.common.businessentities.network.ProviderNetwork)

Example 17 with ProviderNetwork

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);
}
Also used : AddExternalSubnetParameters(org.ovirt.engine.core.common.action.AddExternalSubnetParameters) ActionReturnValue(org.ovirt.engine.core.common.action.ActionReturnValue) ProviderNetwork(org.ovirt.engine.core.common.businessentities.network.ProviderNetwork)

Example 18 with ProviderNetwork

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;
}
Also used : ProviderNetwork(org.ovirt.engine.core.common.businessentities.network.ProviderNetwork) Network(org.ovirt.engine.core.common.businessentities.network.Network) ArrayList(java.util.ArrayList) ProviderNetwork(org.ovirt.engine.core.common.businessentities.network.ProviderNetwork)

Example 19 with ProviderNetwork

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;
}
Also used : ProviderNetwork(org.ovirt.engine.core.common.businessentities.network.ProviderNetwork)

Example 20 with 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));
}
Also used : ProviderNetwork(org.ovirt.engine.core.common.businessentities.network.ProviderNetwork)

Aggregations

ProviderNetwork (org.ovirt.engine.core.common.businessentities.network.ProviderNetwork)22 Network (org.ovirt.engine.core.common.businessentities.network.Network)13 OpenStackNetwork (org.ovirt.engine.api.model.OpenStackNetwork)4 Test (org.junit.Test)3 ArrayList (java.util.ArrayList)2 Guid (org.ovirt.engine.core.compat.Guid)2 HashMap (java.util.HashMap)1 Set (java.util.Set)1 NetworkUsage (org.ovirt.engine.api.model.NetworkUsage)1 Mapping (org.ovirt.engine.api.restapi.types.Mapping)1 AbstractQueryTest (org.ovirt.engine.core.bll.AbstractQueryTest)1 BaseCommandTest (org.ovirt.engine.core.bll.BaseCommandTest)1 ProviderValidator (org.ovirt.engine.core.bll.provider.ProviderValidator)1 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)1 AddExternalSubnetParameters (org.ovirt.engine.core.common.action.AddExternalSubnetParameters)1 AddNetworkStoragePoolParameters (org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters)1 AddNetworkWithSubnetParameters (org.ovirt.engine.core.common.action.AddNetworkWithSubnetParameters)1 Provider (org.ovirt.engine.core.common.businessentities.Provider)1 NetworkAttachment (org.ovirt.engine.core.common.businessentities.network.NetworkAttachment)1 NetworkCluster (org.ovirt.engine.core.common.businessentities.network.NetworkCluster)1