Search in sources :

Example 56 with AuditLogable

use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable in project ovirt-engine by oVirt.

the class DisplayNetworkClusterHelper method warnOnActiveVm.

public void warnOnActiveVm() {
    if (activeVmAttachedToClusterPredicate.test(networkCluster.getClusterId())) {
        AuditLogable loggable = createLoggable();
        auditLogDirector.log(loggable, AuditLogType.NETWORK_UPDATE_DISPLAY_FOR_CLUSTER_WITH_ACTIVE_VM);
    }
}
Also used : AuditLogable(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable)

Example 57 with AuditLogable

use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable in project ovirt-engine by oVirt.

the class SyncMacsOfDbNicsWithSnapshot method auditLogImpossibilityToReplaceDuplicateMacs.

private void auditLogImpossibilityToReplaceDuplicateMacs(List<String> macs) {
    AuditLogable event = new AuditLogableImpl();
    String auditLogMessage = "Following MACs had to be reallocated, but we was unable to replace them because of insufficient amount of free macs: " + macs;
    auditLogDirector.log(event, AuditLogType.MAC_ADDRESS_COULDNT_BE_REALLOCATED, auditLogMessage);
}
Also used : AuditLogable(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable) AuditLogableImpl(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl)

Example 58 with AuditLogable

use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable in project ovirt-engine by oVirt.

the class CINDERStorageHelper method activateCinderDomain.

public void activateCinderDomain(Guid storageDomainId, Guid storagePoolId) {
    OpenStackVolumeProviderProxy proxy = OpenStackVolumeProviderProxy.getFromStorageDomainId(storageDomainId, providerProxyFactory);
    if (proxy == null) {
        log.error("Couldn't create an OpenStackVolumeProviderProxy for storage domain ID: {}", storageDomainId);
        return;
    }
    try {
        proxy.testConnection();
        updateCinderDomainStatus(storageDomainId, storagePoolId, StorageDomainStatus.Active);
    } catch (EngineException e) {
        AuditLogable loggable = new AuditLogableImpl();
        loggable.addCustomValue("CinderException", e.getCause().getCause() != null ? e.getCause().getCause().getMessage() : e.getCause().getMessage());
        auditLogDirector.log(loggable, AuditLogType.CINDER_PROVIDER_ERROR);
        throw e;
    }
}
Also used : AuditLogable(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable) EngineException(org.ovirt.engine.core.common.errors.EngineException) AuditLogableImpl(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl) OpenStackVolumeProviderProxy(org.ovirt.engine.core.bll.provider.storage.OpenStackVolumeProviderProxy)

Example 59 with AuditLogable

use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable in project ovirt-engine by oVirt.

the class CinderBroker method logDiskEvent.

private void logDiskEvent(CinderDisk cinderDisk, AuditLogType cinderDiskConnectionFailure) {
    AuditLogable logable = new AuditLogableImpl();
    logable.addCustomValue("DiskAlias", cinderDisk.getDiskAlias());
    Injector.get(AuditLogDirector.class).log(logable, cinderDiskConnectionFailure);
}
Also used : AuditLogable(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable) AuditLogableImpl(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl) AuditLogDirector(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector)

Example 60 with AuditLogable

use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable in project ovirt-engine by oVirt.

the class VmInfoBuildUtils method reportUnsupportedVnicProfileFeatures.

private void reportUnsupportedVnicProfileFeatures(VM vm, VmNic nic, VnicProfile vnicProfile, List<VnicProfileProperties> unsupportedFeatures) {
    if (unsupportedFeatures.isEmpty()) {
        return;
    }
    AuditLogable event = new AuditLogableImpl();
    event.setVmId(vm.getId());
    event.setVmName(vm.getName());
    event.setClusterId(vm.getClusterId());
    event.setClusterName(vm.getClusterName());
    event.setCustomId(nic.getId().toString());
    event.setCompatibilityVersion(vm.getCompatibilityVersion().toString());
    event.addCustomValue("NicName", nic.getName());
    event.addCustomValue("VnicProfile", vnicProfile == null ? null : vnicProfile.getName());
    String[] unsupportedFeatureNames = new String[unsupportedFeatures.size()];
    for (int i = 0; i < unsupportedFeatures.size(); i++) {
        unsupportedFeatureNames[i] = unsupportedFeatures.get(i).getFeatureName();
    }
    event.addCustomValue("UnsupportedFeatures", StringUtils.join(unsupportedFeatureNames, ", "));
    auditLogDirector.log(event, AuditLogType.VNIC_PROFILE_UNSUPPORTED_FEATURES);
}
Also used : AuditLogable(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable) AuditLogableImpl(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl)

Aggregations

AuditLogable (org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable)126 AuditLogableImpl (org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl)86 AuditLogType (org.ovirt.engine.core.common.AuditLogType)10 AuditLogDirector (org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector)9 Guid (org.ovirt.engine.core.compat.Guid)8 VdsNetworkInterface (org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface)6 ArrayList (java.util.ArrayList)5 Date (java.util.Date)3 HashMap (java.util.HashMap)3 List (java.util.List)3 Map (java.util.Map)3 Collectors (java.util.stream.Collectors)3 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)3 VDS (org.ovirt.engine.core.common.businessentities.VDS)3 EngineException (org.ovirt.engine.core.common.errors.EngineException)3 HashSet (java.util.HashSet)2 Inject (javax.inject.Inject)2 Singleton (javax.inject.Singleton)2 HostUpgradeManagerResult (org.ovirt.engine.core.common.HostUpgradeManagerResult)2 Cluster (org.ovirt.engine.core.common.businessentities.Cluster)2