Search in sources :

Example 1 with KatelloErrata

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

the class BackendEngineKatelloErrataResource method list.

@Override
public KatelloErrata list() {
    ErrataData errataData = null;
    try {
        QueryReturnValue returnValue = runQuery(QueryType.GetErrataForEngine, new GetErrataCountsParameters());
        if (!returnValue.getSucceeded()) {
            backendFailure(returnValue.getExceptionString());
        }
        errataData = returnValue.getReturnValue();
    } catch (Exception e) {
        handleError(e, false);
    }
    if (errataData == null) {
        return new KatelloErrata();
    }
    return mapCollection(errataData.getErrata());
}
Also used : QueryReturnValue(org.ovirt.engine.core.common.queries.QueryReturnValue) ErrataData(org.ovirt.engine.core.common.businessentities.ErrataData) GetErrataCountsParameters(org.ovirt.engine.core.common.queries.GetErrataCountsParameters) KatelloErrata(org.ovirt.engine.api.model.KatelloErrata)

Example 2 with KatelloErrata

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

the class BackendVmKatelloErrataResource method list.

@Override
public KatelloErrata list() {
    ErrataData errataData = null;
    try {
        QueryReturnValue returnValue = runQuery(QueryType.GetErrataForVm, new GetErrataCountsParameters(asGuid(vmId)));
        if (!returnValue.getSucceeded()) {
            backendFailure(returnValue.getExceptionString());
        }
        errataData = returnValue.getReturnValue();
    } catch (Exception e) {
        handleError(e, false);
    }
    if (errataData == null) {
        return new KatelloErrata();
    }
    return mapCollection(errataData.getErrata());
}
Also used : QueryReturnValue(org.ovirt.engine.core.common.queries.QueryReturnValue) ErrataData(org.ovirt.engine.core.common.businessentities.ErrataData) GetErrataCountsParameters(org.ovirt.engine.core.common.queries.GetErrataCountsParameters) KatelloErrata(org.ovirt.engine.api.model.KatelloErrata)

Example 3 with KatelloErrata

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

the class V3HostInAdapter method adapt.

@Override
public Host adapt(V3Host from) {
    Host to = new Host();
    if (from.isSetLinks()) {
        to.getLinks().addAll(adaptIn(from.getLinks()));
    }
    if (from.isSetActions()) {
        to.setActions(adaptIn(from.getActions()));
    }
    if (from.isSetAddress()) {
        to.setAddress(from.getAddress());
    }
    if (from.isSetAutoNumaStatus()) {
        to.setAutoNumaStatus(AutoNumaStatus.fromValue(from.getAutoNumaStatus()));
    }
    if (from.isSetCertificate()) {
        to.setCertificate(adaptIn(from.getCertificate()));
    }
    if (from.isSetCluster()) {
        to.setCluster(adaptIn(from.getCluster()));
    }
    if (from.isSetComment()) {
        to.setComment(from.getComment());
    }
    if (from.isSetCpu()) {
        to.setCpu(adaptIn(from.getCpu()));
    }
    if (from.isSetDescription()) {
        to.setDescription(from.getDescription());
    }
    if (from.isSetDevicePassthrough()) {
        to.setDevicePassthrough(adaptIn(from.getDevicePassthrough()));
    }
    if (from.isSetDisplay()) {
        to.setDisplay(adaptIn(from.getDisplay()));
    }
    if (from.isSetExternalHostProvider()) {
        to.setExternalHostProvider(adaptIn(from.getExternalHostProvider()));
    }
    if (from.isSetExternalStatus() && from.getExternalStatus().isSetState()) {
        to.setExternalStatus(ExternalStatus.fromValue(from.getExternalStatus().getState()));
    }
    if (from.isSetHardwareInformation()) {
        to.setHardwareInformation(adaptIn(from.getHardwareInformation()));
    }
    if (from.isSetHooks()) {
        to.setHooks(new Hooks());
        to.getHooks().getHooks().addAll(adaptIn(from.getHooks().getHooks()));
    }
    if (from.isSetHostedEngine()) {
        to.setHostedEngine(adaptIn(from.getHostedEngine()));
    }
    if (from.isSetId()) {
        to.setId(from.getId());
    }
    if (from.isSetHref()) {
        to.setHref(from.getHref());
    }
    if (from.isSetIscsi()) {
        to.setIscsi(adaptIn(from.getIscsi()));
    }
    if (from.isSetKatelloErrata()) {
        to.setKatelloErrata(new KatelloErrata());
        to.getKatelloErrata().getKatelloErrata().addAll(adaptIn(from.getKatelloErrata().getKatelloErrata()));
    }
    if (from.isSetKdumpStatus()) {
        to.setKdumpStatus(KdumpStatus.fromValue(from.getKdumpStatus()));
    }
    if (from.isSetKsm()) {
        to.setKsm(adaptIn(from.getKsm()));
    }
    if (from.isSetLibvirtVersion()) {
        to.setLibvirtVersion(adaptIn(from.getLibvirtVersion()));
    }
    if (from.isSetMaxSchedulingMemory()) {
        to.setMaxSchedulingMemory(from.getMaxSchedulingMemory());
    }
    if (from.isSetMemory()) {
        to.setMemory(from.getMemory());
    }
    if (from.isSetName()) {
        to.setName(from.getName());
    }
    if (from.isSetNumaSupported()) {
        to.setNumaSupported(from.isNumaSupported());
    }
    if (from.isSetOs()) {
        to.setOs(adaptIn(from.getOs()));
    }
    if (from.isSetOverrideIptables()) {
        to.setOverrideIptables(from.isOverrideIptables());
    }
    if (from.isSetPort()) {
        to.setPort(from.getPort());
    }
    if (from.isSetPowerManagement()) {
        to.setPowerManagement(adaptIn(from.getPowerManagement()));
    }
    if (from.isSetRootPassword()) {
        to.setRootPassword(from.getRootPassword());
    }
    if (from.isSetSelinux()) {
        to.setSeLinux(adaptIn(from.getSelinux()));
    }
    // This is for the old and deprecated "storage_manager" element:
    V3StorageManager storageManager = from.getStorageManager();
    if (storageManager != null) {
        Spm spm = new Spm();
        Boolean value = storageManager.isValue();
        if (value != null) {
            spm.setStatus(value ? SpmStatus.SPM : SpmStatus.NONE);
        }
        Integer priority = spm.getPriority();
        if (storageManager.getPriority() != null) {
            spm.setPriority(priority);
        }
        to.setSpm(spm);
    }
    // element to override the old element when both are provided):
    if (from.isSetSpm()) {
        to.setSpm(adaptIn(from.getSpm()));
    }
    if (from.isSetSsh()) {
        to.setSsh(adaptIn(from.getSsh()));
    }
    if (from.isSetStatistics()) {
        to.setStatistics(new Statistics());
        to.getStatistics().getStatistics().addAll(adaptIn(from.getStatistics().getStatistics()));
    }
    V3Status status = from.getStatus();
    if (status != null) {
        if (status.isSetState()) {
            to.setStatus(HostStatus.fromValue(status.getState()));
        }
        if (status.isSetDetail()) {
            to.setStatusDetail(status.getDetail());
        }
    }
    if (from.isSetStorageConnectionExtensions()) {
        to.setStorageConnectionExtensions(new StorageConnectionExtensions());
        to.getStorageConnectionExtensions().getStorageConnectionExtensions().addAll(adaptIn(from.getStorageConnectionExtensions().getStorageConnectionExtension()));
    }
    if (from.isSetSummary()) {
        to.setSummary(adaptIn(from.getSummary()));
    }
    if (from.isSetTransparentHugepages()) {
        to.setTransparentHugepages(adaptIn(from.getTransparentHugepages()));
    }
    if (from.isSetType()) {
        // In version 3 of the API the string for the RHEV_H value was "rhev-h", with a dash instead of an
        // underscore, and we need to accept that for backwards compatibility:
        String fromType = from.getType();
        HostType toType = fromType.equalsIgnoreCase("rhev-h") ? HostType.RHEV_H : HostType.fromValue(fromType);
        to.setType(toType);
    }
    if (from.isSetUpdateAvailable()) {
        to.setUpdateAvailable(from.isUpdateAvailable());
    }
    if (from.isSetVersion()) {
        to.setVersion(adaptIn(from.getVersion()));
    }
    return to;
}
Also used : Spm(org.ovirt.engine.api.model.Spm) HostType(org.ovirt.engine.api.model.HostType) KatelloErrata(org.ovirt.engine.api.model.KatelloErrata) Host(org.ovirt.engine.api.model.Host) V3Host(org.ovirt.engine.api.v3.types.V3Host) Hooks(org.ovirt.engine.api.model.Hooks) V3Status(org.ovirt.engine.api.v3.types.V3Status) StorageConnectionExtensions(org.ovirt.engine.api.model.StorageConnectionExtensions) Statistics(org.ovirt.engine.api.model.Statistics) V3StorageManager(org.ovirt.engine.api.v3.types.V3StorageManager)

Example 4 with KatelloErrata

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

the class V3KatelloErrataInAdapter method adapt.

@Override
public KatelloErrata adapt(V3KatelloErrata from) {
    KatelloErrata to = new KatelloErrata();
    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.getKatelloErrata().addAll(adaptIn(from.getKatelloErrata()));
    return to;
}
Also used : KatelloErrata(org.ovirt.engine.api.model.KatelloErrata) V3KatelloErrata(org.ovirt.engine.api.v3.types.V3KatelloErrata)

Example 5 with KatelloErrata

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

the class V3SnapshotInAdapter method adapt.

@Override
public Snapshot adapt(V3Snapshot from) {
    Snapshot to = new Snapshot();
    if (from.isSetLinks()) {
        to.getLinks().addAll(adaptIn(from.getLinks()));
    }
    if (from.isSetActions()) {
        to.setActions(adaptIn(from.getActions()));
    }
    if (from.isSetBios()) {
        to.setBios(adaptIn(from.getBios()));
    }
    if (from.isSetCdroms()) {
        to.setCdroms(new Cdroms());
        to.getCdroms().getCdroms().addAll(adaptIn(from.getCdroms().getCdRoms()));
    }
    if (from.isSetCluster()) {
        to.setCluster(adaptIn(from.getCluster()));
    }
    if (from.isSetComment()) {
        to.setComment(from.getComment());
    }
    if (from.isSetConsole()) {
        to.setConsole(adaptIn(from.getConsole()));
    }
    if (from.isSetCpu()) {
        to.setCpu(adaptIn(from.getCpu()));
    }
    if (from.isSetCpuProfile()) {
        to.setCpuProfile(adaptIn(from.getCpuProfile()));
    }
    if (from.isSetCpuShares()) {
        to.setCpuShares(from.getCpuShares());
    }
    if (from.isSetCreationTime()) {
        to.setCreationTime(from.getCreationTime());
    }
    if (from.isSetCustomCpuModel()) {
        to.setCustomCpuModel(from.getCustomCpuModel());
    }
    if (from.isSetCustomEmulatedMachine()) {
        to.setCustomEmulatedMachine(from.getCustomEmulatedMachine());
    }
    if (from.isSetCustomProperties()) {
        to.setCustomProperties(new CustomProperties());
        to.getCustomProperties().getCustomProperties().addAll(adaptIn(from.getCustomProperties().getCustomProperty()));
    }
    if (from.isSetDate()) {
        to.setDate(from.getDate());
    }
    if (from.isSetDeleteProtected()) {
        to.setDeleteProtected(from.isDeleteProtected());
    }
    if (from.isSetDescription()) {
        to.setDescription(from.getDescription());
    }
    if (from.isSetDisks()) {
        DiskAttachments toAttachments = new DiskAttachments();
        for (V3Disk fromDisk : from.getDisks().getDisks()) {
            DiskAttachment toAttachment = new DiskAttachment();
            toAttachment.setDisk(adaptIn(fromDisk));
            toAttachments.getDiskAttachments().add(toAttachment);
        }
        to.setDiskAttachments(toAttachments);
    }
    if (from.isSetDisplay()) {
        to.setDisplay(adaptIn(from.getDisplay()));
    }
    if (from.isSetDomain()) {
        to.setDomain(adaptIn(from.getDomain()));
    }
    if (from.isSetExternalHostProvider()) {
        to.setExternalHostProvider(adaptIn(from.getExternalHostProvider()));
    }
    if (from.isSetFloppies()) {
        to.setFloppies(new Floppies());
        to.getFloppies().getFloppies().addAll(adaptIn(from.getFloppies().getFloppies()));
    }
    if (from.isSetGuestOperatingSystem()) {
        to.setGuestOperatingSystem(adaptIn(from.getGuestOperatingSystem()));
    }
    if (from.isSetGuestTimeZone()) {
        to.setGuestTimeZone(adaptIn(from.getGuestTimeZone()));
    }
    if (from.isSetHighAvailability()) {
        to.setHighAvailability(adaptIn(from.getHighAvailability()));
    }
    if (from.isSetHost()) {
        to.setHost(adaptIn(from.getHost()));
    }
    if (from.isSetId()) {
        to.setId(from.getId());
    }
    if (from.isSetHref()) {
        to.setHref(from.getHref());
    }
    if (from.isSetInitialization()) {
        to.setInitialization(adaptIn(from.getInitialization()));
    }
    if (from.isSetInstanceType()) {
        to.setInstanceType(adaptIn(from.getInstanceType()));
    }
    if (from.isSetIo()) {
        to.setIo(adaptIn(from.getIo()));
    }
    if (from.isSetKatelloErrata()) {
        to.setKatelloErrata(new KatelloErrata());
        to.getKatelloErrata().getKatelloErrata().addAll(adaptIn(from.getKatelloErrata().getKatelloErrata()));
    }
    if (from.isSetLargeIcon()) {
        to.setLargeIcon(adaptIn(from.getLargeIcon()));
    }
    if (from.isSetMemory()) {
        to.setMemory(from.getMemory());
    }
    if (from.isSetMemoryPolicy()) {
        to.setMemoryPolicy(adaptIn(from.getMemoryPolicy()));
    }
    if (from.isSetMigration()) {
        to.setMigration(adaptIn(from.getMigration()));
    }
    if (from.isSetMigrationDowntime()) {
        to.setMigrationDowntime(from.getMigrationDowntime());
    }
    if (from.isSetName()) {
        to.setName(from.getName());
    }
    if (from.isSetNextRunConfigurationExists()) {
        to.setNextRunConfigurationExists(from.isNextRunConfigurationExists());
    }
    if (from.isSetNics()) {
        to.setNics(new Nics());
        to.getNics().getNics().addAll(adaptIn(from.getNics().getNics()));
    }
    if (from.isSetNumaTuneMode()) {
        to.setNumaTuneMode(NumaTuneMode.fromValue(from.getNumaTuneMode()));
    }
    if (from.isSetOrigin()) {
        to.setOrigin(from.getOrigin());
    }
    if (from.isSetOs()) {
        to.setOs(adaptIn(from.getOs()));
    }
    if (from.isSetPayloads()) {
        to.setPayloads(new Payloads());
        to.getPayloads().getPayloads().addAll(adaptIn(from.getPayloads().getPayload()));
    }
    if (from.isSetPermissions()) {
        to.setPermissions(new Permissions());
        to.getPermissions().getPermissions().addAll(adaptIn(from.getPermissions().getPermissions()));
    }
    if (from.isSetPersistMemorystate()) {
        to.setPersistMemorystate(from.isPersistMemorystate());
    }
    if (from.isSetPlacementPolicy()) {
        to.setPlacementPolicy(adaptIn(from.getPlacementPolicy()));
    }
    if (from.isSetQuota()) {
        to.setQuota(adaptIn(from.getQuota()));
    }
    if (from.isSetReportedDevices()) {
        to.setReportedDevices(new ReportedDevices());
        to.getReportedDevices().getReportedDevices().addAll(adaptIn(from.getReportedDevices().getReportedDevices()));
    }
    if (from.isSetRngDevice()) {
        to.setRngDevice(adaptIn(from.getRngDevice()));
    }
    if (from.isSetRunOnce()) {
        to.setRunOnce(from.isRunOnce());
    }
    if (from.isSetSerialNumber()) {
        to.setSerialNumber(adaptIn(from.getSerialNumber()));
    }
    if (from.isSetSmallIcon()) {
        to.setSmallIcon(adaptIn(from.getSmallIcon()));
    }
    if (from.isSetSnapshotStatus()) {
        to.setSnapshotStatus(SnapshotStatus.fromValue(from.getSnapshotStatus()));
    }
    if (from.isSetSnapshots()) {
        to.setSnapshots(new Snapshots());
        to.getSnapshots().getSnapshots().addAll(adaptIn(from.getSnapshots().getSnapshots()));
    }
    if (from.isSetSoundcardEnabled()) {
        to.setSoundcardEnabled(from.isSoundcardEnabled());
    }
    if (from.isSetSso()) {
        to.setSso(adaptIn(from.getSso()));
    }
    if (from.isSetStartPaused()) {
        to.setStartPaused(from.isStartPaused());
    }
    if (from.isSetStartTime()) {
        to.setStartTime(from.getStartTime());
    }
    if (from.isSetStateless()) {
        to.setStateless(from.isStateless());
    }
    if (from.isSetStatistics()) {
        to.setStatistics(new Statistics());
        to.getStatistics().getStatistics().addAll(adaptIn(from.getStatistics().getStatistics()));
    }
    if (from.isSetStatus() && from.getStatus().isSetState()) {
        to.setStatus(VmStatus.fromValue(from.getStatus().getState()));
    }
    if (from.isSetStopReason()) {
        to.setStopReason(from.getStopReason());
    }
    if (from.isSetStopTime()) {
        to.setStopTime(from.getStopTime());
    }
    if (from.isSetStorageDomain()) {
        to.setStorageDomain(adaptIn(from.getStorageDomain()));
    }
    if (from.isSetTags()) {
        to.setTags(new Tags());
        to.getTags().getTags().addAll(adaptIn(from.getTags().getTags()));
    }
    if (from.isSetTemplate()) {
        to.setTemplate(adaptIn(from.getTemplate()));
    }
    if (from.isSetTimeZone()) {
        to.setTimeZone(adaptIn(from.getTimeZone()));
    }
    if (from.isSetTunnelMigration()) {
        to.setTunnelMigration(from.isTunnelMigration());
    }
    if (from.isSetType()) {
        to.setSnapshotType(SnapshotType.fromValue(from.getType()));
    }
    if (from.isSetUsb()) {
        to.setUsb(adaptIn(from.getUsb()));
    }
    if (from.isSetUseLatestTemplateVersion()) {
        to.setUseLatestTemplateVersion(from.isUseLatestTemplateVersion());
    }
    if (from.isSetVirtioScsi()) {
        to.setVirtioScsi(adaptIn(from.getVirtioScsi()));
    }
    if (from.isSetVm()) {
        to.setVm(adaptIn(from.getVm()));
    }
    if (from.isSetVmPool()) {
        to.setVmPool(adaptIn(from.getVmPool()));
    }
    if (from.isSetWatchdogs()) {
        to.setWatchdogs(new Watchdogs());
        to.getWatchdogs().getWatchdogs().addAll(adaptIn(from.getWatchdogs().getWatchDogs()));
    }
    return to;
}
Also used : KatelloErrata(org.ovirt.engine.api.model.KatelloErrata) DiskAttachments(org.ovirt.engine.api.model.DiskAttachments) ReportedDevices(org.ovirt.engine.api.model.ReportedDevices) Statistics(org.ovirt.engine.api.model.Statistics) Nics(org.ovirt.engine.api.model.Nics) Cdroms(org.ovirt.engine.api.model.Cdroms) V3Snapshot(org.ovirt.engine.api.v3.types.V3Snapshot) Snapshot(org.ovirt.engine.api.model.Snapshot) DiskAttachment(org.ovirt.engine.api.model.DiskAttachment) V3Disk(org.ovirt.engine.api.v3.types.V3Disk) Floppies(org.ovirt.engine.api.model.Floppies) Permissions(org.ovirt.engine.api.model.Permissions) Watchdogs(org.ovirt.engine.api.model.Watchdogs) Snapshots(org.ovirt.engine.api.model.Snapshots) Tags(org.ovirt.engine.api.model.Tags) CustomProperties(org.ovirt.engine.api.model.CustomProperties) Payloads(org.ovirt.engine.api.model.Payloads)

Aggregations

KatelloErrata (org.ovirt.engine.api.model.KatelloErrata)6 ErrataData (org.ovirt.engine.core.common.businessentities.ErrataData)3 GetErrataCountsParameters (org.ovirt.engine.core.common.queries.GetErrataCountsParameters)3 QueryReturnValue (org.ovirt.engine.core.common.queries.QueryReturnValue)3 Statistics (org.ovirt.engine.api.model.Statistics)2 Cdroms (org.ovirt.engine.api.model.Cdroms)1 CustomProperties (org.ovirt.engine.api.model.CustomProperties)1 DiskAttachment (org.ovirt.engine.api.model.DiskAttachment)1 DiskAttachments (org.ovirt.engine.api.model.DiskAttachments)1 Floppies (org.ovirt.engine.api.model.Floppies)1 Hooks (org.ovirt.engine.api.model.Hooks)1 Host (org.ovirt.engine.api.model.Host)1 HostType (org.ovirt.engine.api.model.HostType)1 Nics (org.ovirt.engine.api.model.Nics)1 Payloads (org.ovirt.engine.api.model.Payloads)1 Permissions (org.ovirt.engine.api.model.Permissions)1 ReportedDevices (org.ovirt.engine.api.model.ReportedDevices)1 Snapshot (org.ovirt.engine.api.model.Snapshot)1 Snapshots (org.ovirt.engine.api.model.Snapshots)1 Spm (org.ovirt.engine.api.model.Spm)1