use of org.ovirt.engine.core.common.businessentities.Cluster in project ovirt-engine by oVirt.
the class BackendClusterFeatureHelper method getClusterWithFeatureDisabled.
public static Cluster getClusterWithFeatureDisabled(BackendResource resource, Guid clusterId, Guid id) {
Cluster cluster = getClusterEntity(resource, clusterId);
SupportedAdditionalClusterFeature feature = cluster.getAddtionalFeaturesSupported().stream().filter(f -> f.getFeature().getId().equals(id)).findFirst().orElse(null);
if (feature != null) {
feature.setEnabled(false);
}
return cluster;
}
use of org.ovirt.engine.core.common.businessentities.Cluster in project ovirt-engine by oVirt.
the class BackendExternalVmImportsResource method getClusterId.
private Guid getClusterId(ExternalVmImport vmImport) {
if (vmImport.getCluster().isSetId()) {
return asGuid(vmImport.getCluster().getId());
} else /* if (vmImport.getCluster().isSetName()) */
{
String clusterName = vmImport.getCluster().getName();
Cluster cluster = getEntity(Cluster.class, QueryType.GetClusterByName, new NameQueryParameters(clusterName), clusterName, true);
return cluster.getId();
}
}
use of org.ovirt.engine.core.common.businessentities.Cluster in project ovirt-engine by oVirt.
the class BackendClustersResource method createAddCommandParams.
private ManagementNetworkOnClusterOperationParameters createAddCommandParams(org.ovirt.engine.api.model.Cluster cluster, StoragePool dataCenter) {
Cluster clusterEntity = map(cluster, map(dataCenter));
if (!(cluster.isSetErrorHandling() && cluster.getErrorHandling().isSetOnError())) {
clusterEntity.setMigrateOnError(null);
}
final Guid managementNetworkId = managementNetworkFinder.getManagementNetworkId(cluster, dataCenter.getId());
return new ManagementNetworkOnClusterOperationParameters(clusterEntity, managementNetworkId);
}
use of org.ovirt.engine.core.common.businessentities.Cluster in project ovirt-engine by oVirt.
the class AddClusterCommand method calculateMacPoolIdToUse.
private Guid calculateMacPoolIdToUse() {
Cluster cluster = getCluster();
Guid requestedMacPoolId = cluster == null ? null : cluster.getMacPoolId();
return requestedMacPoolId == null ? macPoolDao.getDefaultPool().getId() : requestedMacPoolId;
}
use of org.ovirt.engine.core.common.businessentities.Cluster in project ovirt-engine by oVirt.
the class AddFenceAgentCommand method validate.
@Override
protected boolean validate() {
if (getParameters() == null || getParameters().getAgent() == null || getParameters().getAgent().getIp() == null || getParameters().getAgent().getHostId() == null || getParameters().getAgent().getPassword() == null || getParameters().getAgent().getType() == null || getParameters().getAgent().getUser() == null) {
return failValidation(EngineMessage.VDS_ADD_FENCE_AGENT_MANDATORY_PARAMETERS_MISSING);
}
Guid vdsId = getParameters().getAgent().getHostId();
VDS vds = vdsDao.get(vdsId);
if (vds == null) {
return failValidation(EngineMessage.VDS_INVALID_SERVER_ID);
}
Guid vdsClusterId = vds.getClusterId();
Cluster cluster = clusterDao.get(vdsClusterId);
String clusterCompatibilityVersion = cluster.getCompatibilityVersion().toString();
if (!FenceConfigHelper.getValidFenceAgentTypes(clusterCompatibilityVersion).contains(getParameters().getAgent().getType())) {
return failValidation(EngineMessage.ACTION_TYPE_FAILED_AGENT_NOT_SUPPORTED);
}
if (!validatePMAgentPort()) {
return failValidation(EngineMessage.VDS_ILLEGAL_PM_AGENT_PORT_VALUE);
}
return super.validate();
}
Aggregations