use of org.ovirt.engine.core.common.action.AttachNetworkToClusterParameter in project ovirt-engine by oVirt.
the class AttachNetworkToClusterCommand method executeCommand.
@Override
protected void executeCommand() {
final AttachNetworkToClusterParameter attachNetworkToClusterParameter = getParameters();
final ActionReturnValue returnValue = runInternalAction(ActionType.AttachNetworkToClusterInternal, attachNetworkToClusterParameter);
setSucceeded(returnValue.getSucceeded());
if (returnValue.getSucceeded()) {
attachLabeledNetwork();
} else {
propagateFailure(returnValue);
}
}
use of org.ovirt.engine.core.common.action.AttachNetworkToClusterParameter in project ovirt-engine by oVirt.
the class AttachNetworkToClusterCommand method attachLabeledNetwork.
private void attachLabeledNetwork() {
final AttachNetworkToClusterParameter attachNetworkToClusterParameter = getParameters();
runInternalAction(ActionType.PropagateNetworksToClusterHosts, new ManageNetworkClustersParameters(new ArrayList<>(Collections.singleton(attachNetworkToClusterParameter.getNetworkCluster()))));
}
use of org.ovirt.engine.core.common.action.AttachNetworkToClusterParameter in project ovirt-engine by oVirt.
the class DetachNetworkToClusterCommand method detachLabeledNetworksFromClusterHosts.
private void detachLabeledNetworksFromClusterHosts() {
final AttachNetworkToClusterParameter attachNetworkToClusterParameter = getParameters();
runInternalAction(ActionType.PropagateNetworksToClusterHosts, new ManageNetworkClustersParameters(Collections.emptyList(), new ArrayList<>(Collections.singleton(attachNetworkToClusterParameter.getNetworkCluster()))));
}
use of org.ovirt.engine.core.common.action.AttachNetworkToClusterParameter in project ovirt-engine by oVirt.
the class NetworkClusterToAttachNetworkToClusterParameterTransformer method apply.
@Override
public AttachNetworkToClusterParameter apply(NetworkCluster networkCluster) {
final Network network = networkDao.get(networkCluster.getNetworkId());
network.setCluster(networkCluster);
return new AttachNetworkToClusterParameter(networkCluster.getClusterId(), network);
}
Aggregations