Search in sources :

Example 16 with Statistics

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

the class V3BlockStatisticInAdapter method adapt.

public BlockStatistic adapt(V3BlockStatistic from) {
    BlockStatistic to = new BlockStatistic();
    if (from.isSetStatistic()) {
        to.setStatistics(new Statistics());
        to.getStatistics().getStatistics().addAll(adaptIn(from.getStatistic()));
    }
    return to;
}
Also used : BlockStatistic(org.ovirt.engine.api.model.BlockStatistic) V3BlockStatistic(org.ovirt.engine.api.v3.types.V3BlockStatistic) Statistics(org.ovirt.engine.api.model.Statistics)

Example 17 with Statistics

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

the class V3DiskSnapshotInAdapter method adapt.

@Override
public DiskSnapshot adapt(V3DiskSnapshot from) {
    DiskSnapshot to = new DiskSnapshot();
    if (from.isSetLinks()) {
        to.getLinks().addAll(adaptIn(from.getLinks()));
    }
    if (from.isSetActions()) {
        to.setActions(adaptIn(from.getActions()));
    }
    if (from.isSetActualSize()) {
        to.setActualSize(from.getActualSize());
    }
    if (from.isSetAlias()) {
        to.setAlias(from.getAlias());
    }
    if (from.isSetComment()) {
        to.setComment(from.getComment());
    }
    if (from.isSetDescription()) {
        to.setDescription(from.getDescription());
    }
    if (from.isSetDisk()) {
        to.setDisk(adaptIn(from.getDisk()));
    }
    if (from.isSetDiskProfile()) {
        to.setDiskProfile(adaptIn(from.getDiskProfile()));
    }
    if (from.isSetFormat()) {
        to.setFormat(DiskFormat.fromValue(from.getFormat()));
    }
    if (from.isSetId()) {
        to.setId(from.getId());
    }
    if (from.isSetHref()) {
        to.setHref(from.getHref());
    }
    if (from.isSetImageId()) {
        to.setImageId(from.getImageId());
    }
    if (from.isSetInstanceType()) {
        to.setInstanceType(adaptIn(from.getInstanceType()));
    }
    if (from.isSetLogicalName()) {
        to.setLogicalName(from.getLogicalName());
    }
    if (from.isSetLunStorage()) {
        to.setLunStorage(adaptIn(from.getLunStorage()));
    }
    if (from.isSetName()) {
        to.setName(from.getName());
    }
    if (from.isSetOpenstackVolumeType()) {
        to.setOpenstackVolumeType(adaptIn(from.getOpenstackVolumeType()));
    }
    if (from.isSetPropagateErrors()) {
        to.setPropagateErrors(from.isPropagateErrors());
    }
    if (from.isSetProvisionedSize()) {
        to.setProvisionedSize(from.getProvisionedSize());
    }
    if (from.isSetQuota()) {
        to.setQuota(adaptIn(from.getQuota()));
    }
    if (from.isSetReadOnly()) {
        to.setReadOnly(from.isReadOnly());
    }
    if (from.isSetSgio()) {
        to.setSgio(ScsiGenericIO.fromValue(from.getSgio()));
    }
    if (from.isSetShareable()) {
        to.setShareable(from.isShareable());
    }
    if (from.isSetSnapshot()) {
        to.setSnapshot(adaptIn(from.getSnapshot()));
    }
    if (from.isSetSparse()) {
        to.setSparse(from.isSparse());
    }
    if (from.isSetStatistics()) {
        to.setStatistics(new Statistics());
        to.getStatistics().getStatistics().addAll(adaptIn(from.getStatistics().getStatistics()));
    }
    if (from.isSetStatus() && from.getStatus().isSetState()) {
        to.setStatus(DiskStatus.fromValue(from.getStatus().getState()));
    }
    if (from.isSetStorageDomain()) {
        to.setStorageDomain(adaptIn(from.getStorageDomain()));
    }
    if (from.isSetStorageDomains()) {
        to.setStorageDomains(new StorageDomains());
        to.getStorageDomains().getStorageDomains().addAll(adaptIn(from.getStorageDomains().getStorageDomains()));
    }
    if (from.isSetStorageType()) {
        to.setStorageType(DiskStorageType.fromValue(from.getStorageType()));
    }
    if (from.isSetTemplate()) {
        to.setTemplate(adaptIn(from.getTemplate()));
    }
    if (from.isSetUsesScsiReservation()) {
        to.setUsesScsiReservation(from.isUsesScsiReservation());
    }
    if (from.isSetVm()) {
        to.setVm(adaptIn(from.getVm()));
    }
    if (from.isSetVms()) {
        to.setVms(new Vms());
        to.getVms().getVms().addAll(adaptIn(from.getVms().getVMs()));
    }
    if (from.isSetWipeAfterDelete()) {
        to.setWipeAfterDelete(from.isWipeAfterDelete());
    }
    return to;
}
Also used : V3DiskSnapshot(org.ovirt.engine.api.v3.types.V3DiskSnapshot) DiskSnapshot(org.ovirt.engine.api.model.DiskSnapshot) StorageDomains(org.ovirt.engine.api.model.StorageDomains) Statistics(org.ovirt.engine.api.model.Statistics) Vms(org.ovirt.engine.api.model.Vms)

Example 18 with Statistics

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

the class V3HostHelper method addStatistics.

/**
 * Retrieves host statistics from version 4 of the API and adds them to a version 4 host.
 *
 * @param host the host where the statistics should be added, should contain at least the 'id' attribute
 */
public static void addStatistics(V3Host host) {
    Statistics statistics = BackendApiResource.getInstance().getHostsResource().getHostResource(host.getId()).getStatisticsResource().list();
    host.setStatistics(adaptOut(statistics));
}
Also used : Statistics(org.ovirt.engine.api.model.Statistics)

Example 19 with Statistics

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

the class V3VirtualNumaNodeInAdapter method adapt.

@Override
public VirtualNumaNode adapt(V3VirtualNumaNode from) {
    VirtualNumaNode to = new VirtualNumaNode();
    if (from.isSetLinks()) {
        to.getLinks().addAll(adaptIn(from.getLinks()));
    }
    if (from.isSetActions()) {
        to.setActions(adaptIn(from.getActions()));
    }
    if (from.isSetComment()) {
        to.setComment(from.getComment());
    }
    if (from.isSetCpu()) {
        to.setCpu(adaptIn(from.getCpu()));
    }
    if (from.isSetDescription()) {
        to.setDescription(from.getDescription());
    }
    if (from.isSetHost()) {
        to.setHost(adaptIn(from.getHost()));
    }
    if (from.isSetId()) {
        to.setId(from.getId());
    }
    if (from.isSetHref()) {
        to.setHref(from.getHref());
    }
    if (from.isSetIndex()) {
        to.setIndex(from.getIndex());
    }
    if (from.isSetMemory()) {
        to.setMemory(from.getMemory());
    }
    if (from.isSetName()) {
        to.setName(from.getName());
    }
    if (from.isSetNodeDistance()) {
        to.setNodeDistance(from.getNodeDistance());
    }
    if (from.isSetNumaNodePins()) {
        to.setNumaNodePins(new NumaNodePins());
        to.getNumaNodePins().getNumaNodePins().addAll(adaptIn(from.getNumaNodePins().getNumaNodePin()));
    }
    if (from.isSetStatistics()) {
        to.setStatistics(new Statistics());
        to.getStatistics().getStatistics().addAll(adaptIn(from.getStatistics().getStatistics()));
    }
    if (from.isSetVm()) {
        to.setVm(adaptIn(from.getVm()));
    }
    return to;
}
Also used : V3VirtualNumaNode(org.ovirt.engine.api.v3.types.V3VirtualNumaNode) VirtualNumaNode(org.ovirt.engine.api.model.VirtualNumaNode) NumaNodePins(org.ovirt.engine.api.model.NumaNodePins) Statistics(org.ovirt.engine.api.model.Statistics)

Example 20 with Statistics

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

the class BackendVmsResource method addInlineStatistics.

private void addInlineStatistics(Vm vm) {
    EntityIdResolver<Guid> resolver = new QueryIdResolver<>(QueryType.GetVmByVmId, IdQueryParameters.class);
    VmStatisticalQuery query = new VmStatisticalQuery(resolver, newModel(vm.getId()));
    BackendStatisticsResource<Vm, org.ovirt.engine.core.common.businessentities.VM> statisticsResource = inject(new BackendStatisticsResource<>(entityType, Guid.createGuidFromStringDefaultEmpty(vm.getId()), query));
    Statistics statistics = statisticsResource.list();
    vm.setStatistics(statistics);
}
Also used : Vm(org.ovirt.engine.api.model.Vm) VM(org.ovirt.engine.core.common.businessentities.VM) Guid(org.ovirt.engine.core.compat.Guid) Statistics(org.ovirt.engine.api.model.Statistics)

Aggregations

Statistics (org.ovirt.engine.api.model.Statistics)24 Statistic (org.ovirt.engine.api.model.Statistic)6 BlockStatistics (org.ovirt.engine.api.model.BlockStatistics)4 FopStatistics (org.ovirt.engine.api.model.FopStatistics)4 Vms (org.ovirt.engine.api.model.Vms)3 BlockStatistic (org.ovirt.engine.api.model.BlockStatistic)2 FopStatistic (org.ovirt.engine.api.model.FopStatistic)2 KatelloErrata (org.ovirt.engine.api.model.KatelloErrata)2 ProfileDetail (org.ovirt.engine.api.model.ProfileDetail)2 ReportedDevices (org.ovirt.engine.api.model.ReportedDevices)2 StorageDomains (org.ovirt.engine.api.model.StorageDomains)2 V3Disk (org.ovirt.engine.api.v3.types.V3Disk)2 Test (org.junit.Test)1 BrickProfileDetail (org.ovirt.engine.api.model.BrickProfileDetail)1 BrickProfileDetails (org.ovirt.engine.api.model.BrickProfileDetails)1 Cdroms (org.ovirt.engine.api.model.Cdroms)1 CustomProperties (org.ovirt.engine.api.model.CustomProperties)1 Disk (org.ovirt.engine.api.model.Disk)1 DiskAttachment (org.ovirt.engine.api.model.DiskAttachment)1 DiskAttachments (org.ovirt.engine.api.model.DiskAttachments)1