Search in sources :

Example 1 with AddNetworkStoragePoolParameters

use of org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters in project ovirt-engine by oVirt.

the class EditNetworkModel method executeSave.

@Override
public void executeSave() {
    Frontend.getInstance().runAction(ActionType.UpdateNetwork, new AddNetworkStoragePoolParameters(getSelectedDc().getId(), getNetwork()), result -> {
        ActionReturnValue retVal = result.getReturnValue();
        postSaveAction(null, retVal != null && retVal.getSucceeded());
    }, null);
}
Also used : AddNetworkStoragePoolParameters(org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters) ActionReturnValue(org.ovirt.engine.core.common.action.ActionReturnValue)

Example 2 with AddNetworkStoragePoolParameters

use of org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters in project ovirt-engine by oVirt.

the class InternalImportExternalNetworkCommand method addNetwork.

private ActionReturnValue addNetwork(Guid dataCenterId, Network network, boolean attachToAllClusters) {
    AddNetworkStoragePoolParameters params = new AddNetworkStoragePoolParameters(dataCenterId, network);
    params.setVnicProfilePublicUse(getParameters().isPublicUse());
    if (attachToAllClusters) {
        params.setNetworkClusterList(networkHelper.createNetworkClusters(getAllClusterIdsInDataCenter(dataCenterId)));
    }
    return runInternalAction(ActionType.AddNetwork, params);
}
Also used : AddNetworkStoragePoolParameters(org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters)

Example 3 with AddNetworkStoragePoolParameters

use of org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters in project ovirt-engine by oVirt.

the class BackendOpenStackNetworkResource method doImport.

@Override
public Response doImport(Action action) {
    validateParameters(action, "dataCenter.id|name");
    Guid dataCenterId = getDataCenterId(action);
    ProviderNetwork providerNetwork = new ProviderNetwork(new Guid(providerId), id);
    Network network = new Network();
    network.setProvidedBy(providerNetwork);
    network.setDataCenterId(dataCenterId);
    network.setName(getNetwork().getName());
    AddNetworkStoragePoolParameters parameters = new AddNetworkStoragePoolParameters(dataCenterId, network);
    return doAction(ActionType.AddNetwork, parameters, action);
}
Also used : AddNetworkStoragePoolParameters(org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters) ProviderNetwork(org.ovirt.engine.core.common.businessentities.network.ProviderNetwork) OpenStackNetwork(org.ovirt.engine.api.model.OpenStackNetwork) Network(org.ovirt.engine.core.common.businessentities.network.Network) ProviderNetwork(org.ovirt.engine.core.common.businessentities.network.ProviderNetwork) Guid(org.ovirt.engine.core.compat.Guid)

Example 4 with AddNetworkStoragePoolParameters

use of org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters in project ovirt-engine by oVirt.

the class BackendDataCenterNetworksResource method add.

@Override
public Response add(Network network) {
    validateParameters(network, getRequiredAddFields());
    DataCenter dataCenter = new DataCenter();
    dataCenter.setId(dataCenterId.toString());
    network.setDataCenter(dataCenter);
    org.ovirt.engine.core.common.businessentities.network.Network entity = map(network);
    AddNetworkStoragePoolParameters params = getAddParameters(network, entity);
    return performCreate(network.isSetExternalProvider() ? ActionType.AddNetworkOnProvider : addAction, params, new DataCenterNetworkIdResolver(network.getName(), params.getStoragePoolId().toString()));
}
Also used : DataCenter(org.ovirt.engine.api.model.DataCenter) AddNetworkStoragePoolParameters(org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters)

Example 5 with AddNetworkStoragePoolParameters

use of org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters in project ovirt-engine by oVirt.

the class SyncNetworkProviderCommand method updateNetwork.

private void updateNetwork(Guid dataCenterId, Network externalNetwork, Network networkInDataCenter) {
    if (!networkInDataCenter.getName().equals(externalNetwork.getName())) {
        networkInDataCenter.setName(externalNetwork.getName());
        AddNetworkStoragePoolParameters parameters = new AddNetworkStoragePoolParameters(dataCenterId, networkInDataCenter);
        propagateReturnValue(runInternalAction(ActionType.UpdateNetwork, parameters, getInternalCommandContext()));
    }
}
Also used : AddNetworkStoragePoolParameters(org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters)

Aggregations

AddNetworkStoragePoolParameters (org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters)9 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)3 Network (org.ovirt.engine.core.common.businessentities.network.Network)2 ProviderNetwork (org.ovirt.engine.core.common.businessentities.network.ProviderNetwork)2 DataCenter (org.ovirt.engine.api.model.DataCenter)1 OpenStackNetwork (org.ovirt.engine.api.model.OpenStackNetwork)1 Guid (org.ovirt.engine.core.compat.Guid)1 EngineLock (org.ovirt.engine.core.utils.lock.EngineLock)1