use of org.ovirt.engine.core.common.action.ManagementNetworkOnClusterOperationParameters in project ovirt-engine by oVirt.
the class ClusterGuideModel method onAddDataCenter.
public void onAddDataCenter() {
@SuppressWarnings("unchecked") ListModel<EntityModel<StoragePool>> dataCentersModel = (ListModel<EntityModel<StoragePool>>) getWindow();
EntityModel<StoragePool> dataCenter = dataCentersModel.getSelectedItem();
if (dataCenter != null) {
Cluster cluster = getEntity();
cluster.setStoragePoolId(dataCenter.getEntity().getId());
dataCentersModel.startProgress();
Frontend.getInstance().runAction(ActionType.UpdateCluster, new ManagementNetworkOnClusterOperationParameters(cluster), result -> {
if (result.getReturnValue() != null && result.getReturnValue().getSucceeded()) {
// Succeeded, close this window.
ClusterGuideModel guideModel = (ClusterGuideModel) result.getState();
guideModel.postAction();
}
// Close popup window.
setWindow(null);
}, this);
} else {
setWindow(null);
}
}
use of org.ovirt.engine.core.common.action.ManagementNetworkOnClusterOperationParameters in project ovirt-engine by oVirt.
the class ClusterListModel method onResetClusterEmulatedMachine.
public void onResetClusterEmulatedMachine() {
final ConfirmationModel model = (ConfirmationModel) getWindow();
if (model.getProgress() != null) {
return;
}
ArrayList<ActionParametersBase> prms = new ArrayList<>();
for (Cluster cluster : getSelectedItems()) {
ManagementNetworkOnClusterOperationParameters currentParam = new ManagementNetworkOnClusterOperationParameters(cluster);
currentParam.setForceResetEmulatedMachine(true);
prms.add(currentParam);
}
model.startProgress();
Frontend.getInstance().runMultipleAction(ActionType.UpdateCluster, prms, result -> {
model.stopProgress();
cancel();
});
}
use of org.ovirt.engine.core.common.action.ManagementNetworkOnClusterOperationParameters in project ovirt-engine by oVirt.
the class ClusterListModel method onSaveInternalWithModel.
private void onSaveInternalWithModel(final ClusterModel model) {
Cluster cluster = buildCluster(model, model.getIsNew() ? new Cluster() : (Cluster) Cloner.clone(getSelectedItem()));
model.startProgress();
final Network managementNetwork = model.getManagementNetwork().getSelectedItem();
final ManagementNetworkOnClusterOperationParameters clusterOperationParameters = new ManagementNetworkOnClusterOperationParameters(cluster, managementNetwork.getId());
final ActionType actionType = model.getIsNew() ? ActionType.AddCluster : ActionType.UpdateCluster;
Frontend.getInstance().runAction(actionType, clusterOperationParameters, result -> {
ClusterListModel<Void> localModel = (ClusterListModel<Void>) result.getState();
if (model.getIsImportGlusterConfiguration().getEntity()) {
localModel.postOnSaveInternalWithImport(result.getReturnValue());
} else {
localModel.postOnSaveInternal(result.getReturnValue());
}
}, this);
}
use of org.ovirt.engine.core.common.action.ManagementNetworkOnClusterOperationParameters in project ovirt-engine by oVirt.
the class BackendClusterEnabledFeaturesResource method add.
@Override
public Response add(ClusterFeature feature) {
validateParameters(feature);
org.ovirt.engine.core.common.businessentities.AdditionalFeature featureEntity = map(feature, null);
org.ovirt.engine.core.common.businessentities.Cluster cluster = BackendClusterFeatureHelper.getClusterEntity(this, clusterId);
SupportedAdditionalClusterFeature supportedFeature = new SupportedAdditionalClusterFeature();
supportedFeature.setFeature(featureEntity);
supportedFeature.setEnabled(true);
supportedFeature.setClusterId(clusterId);
cluster.getAddtionalFeaturesSupported().add(supportedFeature);
ManagementNetworkOnClusterOperationParameters param = new ManagementNetworkOnClusterOperationParameters(cluster);
return performCreate(ActionType.UpdateCluster, param, new ClusterFeatureIdResolver(clusterId, featureEntity.getId()));
}
use of org.ovirt.engine.core.common.action.ManagementNetworkOnClusterOperationParameters in project ovirt-engine by oVirt.
the class BackendClusterResource method resetEmulatedMachine.
@Override
public Response resetEmulatedMachine(Action action) {
QueryReturnValue result = runQuery(QueryType.GetClusterById, new IdQueryParameters(guid));
if (result != null && result.getSucceeded() && result.getReturnValue() != null) {
ManagementNetworkOnClusterOperationParameters param = new ManagementNetworkOnClusterOperationParameters(result.getReturnValue());
param.setForceResetEmulatedMachine(true);
return doAction(ActionType.UpdateCluster, param, action);
} else {
throw new WebApplicationException(Response.status(Response.Status.NOT_FOUND).build());
}
}
Aggregations