Search in sources :

Example 6 with LibvirtSecret

use of org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret in project ovirt-engine by oVirt.

the class CINDERStorageHelper method runConnectionStorageToDomain.

@Override
protected Pair<Boolean, EngineFault> runConnectionStorageToDomain(StorageDomain storageDomain, Guid vdsId, int type) {
    Provider<?> provider = providerDao.get(Guid.createGuidFromString(storageDomain.getStorage()));
    List<LibvirtSecret> libvirtSecrets = libvirtSecretDao.getAllByProviderId(provider.getId());
    VDS vds = vdsDao.get(vdsId);
    if (!isLibrbdAvailable(vds)) {
        log.error("Couldn't found librbd1 package on vds {} (needed for storage domain {}).", vds.getName(), storageDomain.getName());
        addMessageToAuditLog(AuditLogType.NO_LIBRBD_PACKAGE_AVAILABLE_ON_VDS, null, vds);
        return new Pair<>(false, null);
    }
    return registerLibvirtSecrets(storageDomain, vds, libvirtSecrets);
}
Also used : VDS(org.ovirt.engine.core.common.businessentities.VDS) LibvirtSecret(org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret) Pair(org.ovirt.engine.core.common.utils.Pair)

Example 7 with LibvirtSecret

use of org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret in project ovirt-engine by oVirt.

the class BackendOpenStackVolumeAuthenticationKeyResourceTest method getEntity.

@Override
protected LibvirtSecret getEntity(int index) {
    LibvirtSecret libvirtSecret = mock(LibvirtSecret.class);
    when(libvirtSecret.getId()).thenReturn(GUIDS[index]);
    when(libvirtSecret.getDescription()).thenReturn(DESCRIPTIONS[index]);
    when(libvirtSecret.getProviderId()).thenReturn(GUIDS[0]);
    when(libvirtSecret.getUsageType()).thenReturn(LibvirtSecretUsageType.CEPH);
    return libvirtSecret;
}
Also used : LibvirtSecret(org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret)

Example 8 with LibvirtSecret

use of org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret in project ovirt-engine by oVirt.

the class LibvirtSecretModel method flush.

private void flush() {
    LibvirtSecret secret = isNew() ? new LibvirtSecret() : getEntity();
    secret.setUsageType(getUsageType().getSelectedItem());
    secret.setDescription(getDescription().getEntity());
    secret.setProviderId(Guid.createGuidFromString(getProviderId().getEntity()));
    secret.setId(Guid.createGuidFromString(uuid.getEntity()));
    if (StringHelper.isNotNullOrEmpty(getValue().getEntity())) {
        secret.setValue(getValue().getEntity());
    }
    setEntity(secret);
}
Also used : LibvirtSecret(org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret)

Example 9 with LibvirtSecret

use of org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret in project ovirt-engine by oVirt.

the class ProviderSecretListModel method removeSecret.

private void removeSecret() {
    if (getWindow() != null) {
        return;
    }
    ConfirmationModel model = new ConfirmationModel();
    // $NON-NLS-1$
    addDialogCommands(model, this, "OnRemove");
    setConfirmWindow(model);
    model.setTitle(ConstantsManager.getInstance().getConstants().removeSecretTitle());
    model.setHelpTag(HelpTag.remove_secret);
    // $NON-NLS-1$
    model.setHashName("remove_secret");
    ArrayList<String> secretsToRemove = new ArrayList<>();
    for (LibvirtSecret libvirtSecret : getSelectedItems()) {
        secretsToRemove.add(libvirtSecret.getId().toString());
    }
    model.setItems(secretsToRemove);
}
Also used : ArrayList(java.util.ArrayList) LibvirtSecret(org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)

Aggregations

LibvirtSecret (org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret)9 ArrayList (java.util.ArrayList)2 LibvirtSecretParameters (org.ovirt.engine.core.common.action.LibvirtSecretParameters)2 VDS (org.ovirt.engine.core.common.businessentities.VDS)2 ConfirmationModel (org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)2 ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)1 Pair (org.ovirt.engine.core.common.utils.Pair)1