use of org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters in project ovirt-engine by oVirt.
the class LabelNetworkCommand method executeCommand.
@Override
protected void executeCommand() {
getNetwork().setLabel(getLabel());
ActionReturnValue result = runInternalAction(ActionType.UpdateNetwork, new AddNetworkStoragePoolParameters(getNetwork().getDataCenterId(), getNetwork()));
if (!result.getSucceeded()) {
propagateFailure(result);
}
getReturnValue().setActionReturnValue(getLabel());
setSucceeded(result.getSucceeded());
}
use of org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters in project ovirt-engine by oVirt.
the class UnlabelNetworkCommand method executeCommand.
@Override
protected void executeCommand() {
getNetwork().setLabel(null);
ActionReturnValue result = runInternalAction(ActionType.UpdateNetwork, new AddNetworkStoragePoolParameters(getNetwork().getDataCenterId(), getNetwork()));
if (!result.getSucceeded()) {
propagateFailure(result);
}
setSucceeded(result.getSucceeded());
}
use of org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters in project ovirt-engine by oVirt.
the class AutodefineExternalNetworkCommand method runAutodefineForOneProvider.
// Acquire lock for every provider and run auto-define inside this lock
private void runAutodefineForOneProvider(Guid providerId, int index) {
try (EngineLock lock = acquireLockForProvider(providerId)) {
Network externalNetwork = createExternalNetwork(calcExternalNetworkName(index), providerId);
AddNetworkStoragePoolParameters storagePoolParameters = new AddNetworkStoragePoolParameters(getNetwork().getStoragePoolId(), externalNetwork);
storagePoolParameters.setNetworkClusterList(networkHelper.createNetworkClusters(clustersByProvider.get(providerId)));
storagePoolParameters.setVnicProfilePublicUse(false);
runInternalAction(ActionType.AddNetworkOnProvider, storagePoolParameters);
}
}
use of org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters in project ovirt-engine by oVirt.
the class BackendNetworksResource method add.
@Override
public Response add(Network network) {
validateParameters(network, getRequiredAddFields());
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()));
}
Aggregations