Search in sources :

Example 91 with Cluster

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;
}
Also used : SupportedAdditionalClusterFeature(org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature) Cluster(org.ovirt.engine.core.common.businessentities.Cluster)

Example 92 with 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();
    }
}
Also used : Cluster(org.ovirt.engine.core.common.businessentities.Cluster) NameQueryParameters(org.ovirt.engine.core.common.queries.NameQueryParameters)

Example 93 with Cluster

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);
}
Also used : ManagementNetworkOnClusterOperationParameters(org.ovirt.engine.core.common.action.ManagementNetworkOnClusterOperationParameters) Cluster(org.ovirt.engine.core.common.businessentities.Cluster) Guid(org.ovirt.engine.core.compat.Guid)

Example 94 with Cluster

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;
}
Also used : Cluster(org.ovirt.engine.core.common.businessentities.Cluster) NetworkCluster(org.ovirt.engine.core.common.businessentities.network.NetworkCluster) Guid(org.ovirt.engine.core.compat.Guid)

Example 95 with Cluster

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();
}
Also used : VDS(org.ovirt.engine.core.common.businessentities.VDS) Cluster(org.ovirt.engine.core.common.businessentities.Cluster) Guid(org.ovirt.engine.core.compat.Guid)

Aggregations

Cluster (org.ovirt.engine.core.common.businessentities.Cluster)346 Test (org.junit.Test)83 ArrayList (java.util.ArrayList)80 Guid (org.ovirt.engine.core.compat.Guid)77 VDS (org.ovirt.engine.core.common.businessentities.VDS)54 List (java.util.List)50 VM (org.ovirt.engine.core.common.businessentities.VM)36 HashMap (java.util.HashMap)35 Map (java.util.Map)33 HashSet (java.util.HashSet)30 StoragePool (org.ovirt.engine.core.common.businessentities.StoragePool)30 AsyncDataProvider (org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider)28 Version (org.ovirt.engine.core.compat.Version)27 EntityModel (org.ovirt.engine.ui.uicommonweb.models.EntityModel)26 ConstantsManager (org.ovirt.engine.ui.uicompat.ConstantsManager)26 QueryReturnValue (org.ovirt.engine.core.common.queries.QueryReturnValue)25 Set (java.util.Set)24 QueryType (org.ovirt.engine.core.common.queries.QueryType)23 Collections (java.util.Collections)22 Frontend (org.ovirt.engine.ui.frontend.Frontend)22