Search in sources :

Example 91 with Quota

use of org.ovirt.engine.core.common.businessentities.Quota in project ovirt-engine by oVirt.

the class QuotaManagerTest method mockMemQuotaSpecificInGrace.

/**
 * Call by Guid: {@literal MEM_QUOTA_SPECIFIC_IN_GRACE}
 */
private Quota mockMemQuotaSpecificInGrace() {
    Quota quota = mockBasicQuota();
    quota.setId(MEM_QUOTA_SPECIFIC_IN_GRACE);
    quota.setQuotaClusters(getQuotaClusters(UNLIMITED_VCPU, 0, 2048, 2100));
    return quota;
}
Also used : Quota(org.ovirt.engine.core.common.businessentities.Quota)

Example 92 with Quota

use of org.ovirt.engine.core.common.businessentities.Quota in project ovirt-engine by oVirt.

the class QuotaManagerTest method mockMemQuotaSpecificNotExceeded.

// ///////////////////// Mem specific ////////////////////////////
/**
 * Call by Guid: {@literal MEM_QUOTA_SPECIFIC_NOT_EXCEEDED}
 */
private Quota mockMemQuotaSpecificNotExceeded() {
    Quota quota = mockBasicQuota();
    quota.setId(MEM_QUOTA_SPECIFIC_NOT_EXCEEDED);
    quota.setQuotaClusters(getQuotaClusters(UNLIMITED_VCPU, 0, 2048, 512));
    return quota;
}
Also used : Quota(org.ovirt.engine.core.common.businessentities.Quota)

Example 93 with Quota

use of org.ovirt.engine.core.common.businessentities.Quota in project ovirt-engine by oVirt.

the class QuotaManagerTest method mockMemQuotaGlobalInGrace.

/**
 * Call by Guid: {@literal MEM_QUOTA_GLOBAL_IN_GRACE}
 */
private Quota mockMemQuotaGlobalInGrace() {
    Quota quota = mockBasicQuota();
    quota.setId(MEM_QUOTA_GLOBAL_IN_GRACE);
    quota.setGlobalQuotaCluster(getQuotaCluster(UNLIMITED_VCPU, 0, 2048, 2300));
    return quota;
}
Also used : Quota(org.ovirt.engine.core.common.businessentities.Quota)

Example 94 with Quota

use of org.ovirt.engine.core.common.businessentities.Quota in project ovirt-engine by oVirt.

the class QuotaManagerTest method mockMemQuotaGlobalNotExceeded.

// ///////////////////// Mem global ////////////////////////////
/**
 * Call by Guid: {@literal MEM_QUOTA_GLOBAL_NOT_EXCEEDED}
 */
private Quota mockMemQuotaGlobalNotExceeded() {
    Quota quota = mockBasicQuota();
    quota.setId(MEM_QUOTA_GLOBAL_NOT_EXCEEDED);
    quota.setGlobalQuotaCluster(getQuotaCluster(UNLIMITED_VCPU, 0, 2048, 512));
    return quota;
}
Also used : Quota(org.ovirt.engine.core.common.businessentities.Quota)

Example 95 with Quota

use of org.ovirt.engine.core.common.businessentities.Quota in project ovirt-engine by oVirt.

the class QuotaManagerTest method mockBasicQuota.

/**
 * Mock a basic quota. Only the basic data (Id, name, threshold, grace...) is set.
 *
 * @return - basic quota with no limitations
 */
private Quota mockBasicQuota() {
    dbCalls++;
    // basic data
    Quota quota = new Quota();
    quota.setId(Guid.newGuid());
    quota.setStoragePoolId(storage_pool.getId());
    quota.setDescription("My Quota description");
    quota.setQuotaName("My Quota Name");
    quota.setGraceStoragePercentage(20);
    quota.setGraceClusterPercentage(20);
    quota.setThresholdStoragePercentage(80);
    quota.setThresholdClusterPercentage(80);
    // Enforcement type would be taken from the storage_pool and not from this field.
    // But in case the storage_pool in null this enforcement will be considered.
    quota.setQuotaEnforcementType(QuotaEnforcementTypeEnum.HARD_ENFORCEMENT);
    return quota;
}
Also used : Quota(org.ovirt.engine.core.common.businessentities.Quota)

Aggregations

Quota (org.ovirt.engine.core.common.businessentities.Quota)101 ArrayList (java.util.ArrayList)23 Guid (org.ovirt.engine.core.compat.Guid)22 Test (org.junit.Test)17 QuotaCluster (org.ovirt.engine.core.common.businessentities.QuotaCluster)17 QuotaStorage (org.ovirt.engine.core.common.businessentities.QuotaStorage)16 IdQueryParameters (org.ovirt.engine.core.common.queries.IdQueryParameters)12 HashMap (java.util.HashMap)9 List (java.util.List)9 QueryType (org.ovirt.engine.core.common.queries.QueryType)9 Cluster (org.ovirt.engine.core.common.businessentities.Cluster)8 StorageDomain (org.ovirt.engine.core.common.businessentities.StorageDomain)8 QueryReturnValue (org.ovirt.engine.core.common.queries.QueryReturnValue)8 ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)6 QuotaCRUDParameters (org.ovirt.engine.core.common.action.QuotaCRUDParameters)6 StoragePool (org.ovirt.engine.core.common.businessentities.StoragePool)6 Map (java.util.Map)5 RepoImage (org.ovirt.engine.core.common.businessentities.storage.RepoImage)5 UICommand (org.ovirt.engine.ui.uicommonweb.UICommand)5 ConfirmationModel (org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)5