Search in sources :

Example 1 with CpuType

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

the class BackendClusterLevelsResource method makeClusterLevel.

public ClusterLevel makeClusterLevel(String version) {
    ClusterLevel level = new ClusterLevel();
    level.setId(version);
    // Not exposing CPU list filtered queries:
    if (!isFiltered()) {
        CpuTypes cpuTypes = new CpuTypes();
        for (ServerCpu serverCpu : getServerCpuList(version)) {
            CpuType cpuType = new CpuType();
            cpuType.setName(serverCpu.getCpuName());
            cpuType.setLevel(serverCpu.getLevel());
            cpuType.setArchitecture(CPUMapper.map(serverCpu.getArchitecture(), null));
            cpuTypes.getCpuTypes().add(cpuType);
        }
        level.setCpuTypes(cpuTypes);
    }
    // Add permits:
    Permits permits = new Permits();
    for (ActionGroup actionGroup : getActionGroups()) {
        Permit permit = PermitMapper.map(actionGroup, null);
        permits.getPermits().add(permit);
    }
    level.setPermits(permits);
    return LinkHelper.addLinks(level);
}
Also used : Permit(org.ovirt.engine.api.model.Permit) ActionGroup(org.ovirt.engine.core.common.businessentities.ActionGroup) ClusterLevel(org.ovirt.engine.api.model.ClusterLevel) ServerCpu(org.ovirt.engine.core.common.businessentities.ServerCpu) CpuTypes(org.ovirt.engine.api.model.CpuTypes) CpuType(org.ovirt.engine.api.model.CpuType) Permits(org.ovirt.engine.api.model.Permits)

Aggregations

ClusterLevel (org.ovirt.engine.api.model.ClusterLevel)1 CpuType (org.ovirt.engine.api.model.CpuType)1 CpuTypes (org.ovirt.engine.api.model.CpuTypes)1 Permit (org.ovirt.engine.api.model.Permit)1 Permits (org.ovirt.engine.api.model.Permits)1 ActionGroup (org.ovirt.engine.core.common.businessentities.ActionGroup)1 ServerCpu (org.ovirt.engine.core.common.businessentities.ServerCpu)1