Search in sources :

Example 1 with AttachNetworkToClusterParameter

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

Example 2 with AttachNetworkToClusterParameter

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()))));
}
Also used : ManageNetworkClustersParameters(org.ovirt.engine.core.common.action.ManageNetworkClustersParameters) AttachNetworkToClusterParameter(org.ovirt.engine.core.common.action.AttachNetworkToClusterParameter) ArrayList(java.util.ArrayList)

Example 3 with AttachNetworkToClusterParameter

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()))));
}
Also used : ManageNetworkClustersParameters(org.ovirt.engine.core.common.action.ManageNetworkClustersParameters) AttachNetworkToClusterParameter(org.ovirt.engine.core.common.action.AttachNetworkToClusterParameter) ArrayList(java.util.ArrayList)

Example 4 with AttachNetworkToClusterParameter

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

Aggregations

AttachNetworkToClusterParameter (org.ovirt.engine.core.common.action.AttachNetworkToClusterParameter)4 ArrayList (java.util.ArrayList)2 ManageNetworkClustersParameters (org.ovirt.engine.core.common.action.ManageNetworkClustersParameters)2 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)1 Network (org.ovirt.engine.core.common.businessentities.network.Network)1