Search in sources :

Example 1 with Balances

use of org.ovirt.engine.api.model.Balances in project ovirt-engine by oVirt.

the class BackendBalancesResource method list.

@Override
public Balances list() {
    ClusterPolicy clusterPolicy = getClusterPolicy();
    Balances balances = new Balances();
    if (clusterPolicy.getBalance() != null) {
        Balance balance = new Balance();
        balance.setId(clusterPolicy.getBalance().toString());
        balances.getBalances().add(addLinks(map(clusterPolicy, balance)));
    }
    return balances;
}
Also used : Balances(org.ovirt.engine.api.model.Balances) ClusterPolicy(org.ovirt.engine.core.common.scheduling.ClusterPolicy) Balance(org.ovirt.engine.api.model.Balance)

Example 2 with Balances

use of org.ovirt.engine.api.model.Balances in project ovirt-engine by oVirt.

the class V3BalancesInAdapter method adapt.

@Override
public Balances adapt(V3Balances from) {
    Balances to = new Balances();
    if (from.isSetActions()) {
        to.setActions(adaptIn(from.getActions()));
    }
    if (from.isSetActive()) {
        to.setActive(from.getActive());
    }
    if (from.isSetSize()) {
        to.setSize(from.getSize());
    }
    if (from.isSetTotal()) {
        to.setTotal(from.getTotal());
    }
    to.getBalances().addAll(adaptIn(from.getBalances()));
    return to;
}
Also used : V3Balances(org.ovirt.engine.api.v3.types.V3Balances) Balances(org.ovirt.engine.api.model.Balances)

Aggregations

Balances (org.ovirt.engine.api.model.Balances)2 Balance (org.ovirt.engine.api.model.Balance)1 V3Balances (org.ovirt.engine.api.v3.types.V3Balances)1 ClusterPolicy (org.ovirt.engine.core.common.scheduling.ClusterPolicy)1