Search in sources :

Example 1 with LibvirtSecret

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

the class ProviderSecretListModel method onRemoveSecret.

private void onRemoveSecret() {
    ConfirmationModel model = (ConfirmationModel) getConfirmWindow();
    if (model.getProgress() != null) {
        return;
    }
    ArrayList<ActionParametersBase> parameters = new ArrayList<>();
    for (LibvirtSecret libvirtSecret : getSelectedItems()) {
        LibvirtSecretParameters param = new LibvirtSecretParameters(libvirtSecret);
        parameters.add(param);
    }
    Frontend.getInstance().runMultipleAction(ActionType.RemoveLibvirtSecret, parameters, result -> cancel());
}
Also used : LibvirtSecretParameters(org.ovirt.engine.core.common.action.LibvirtSecretParameters) ArrayList(java.util.ArrayList) LibvirtSecret(org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase)

Example 2 with LibvirtSecret

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

the class BackendOpenStackVolumeAuthenticationKeyResource method remove.

@Override
public Response remove() {
    LibvirtSecret libvirtSecret = map(get(), null);
    LibvirtSecretParameters parameters = new LibvirtSecretParameters(libvirtSecret);
    return performAction(ActionType.RemoveLibvirtSecret, parameters);
}
Also used : LibvirtSecretParameters(org.ovirt.engine.core.common.action.LibvirtSecretParameters) LibvirtSecret(org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret)

Example 3 with LibvirtSecret

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

the class LibvirtSecretDaoTest method generateNewEntity.

@Override
protected LibvirtSecret generateNewEntity() {
    LibvirtSecret libvirtSecret = new LibvirtSecret();
    libvirtSecret.setId(Guid.newGuid());
    libvirtSecret.setValue("MTIzNDU2Cg==");
    libvirtSecret.setUsageType(LibvirtSecretUsageType.CEPH);
    libvirtSecret.setProviderId(FixturesTool.CINDER_PROVIDER_ID);
    return libvirtSecret;
}
Also used : LibvirtSecret(org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret)

Example 4 with LibvirtSecret

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

the class CINDERStorageHelper method disconnectStorageFromDomainByVdsId.

@Override
public boolean disconnectStorageFromDomainByVdsId(StorageDomain storageDomain, Guid vdsId) {
    Provider<?> provider = providerDao.get(Guid.createGuidFromString(storageDomain.getStorage()));
    List<LibvirtSecret> libvirtSecrets = libvirtSecretDao.getAllByProviderId(provider.getId());
    VDS vds = vdsDao.get(vdsId);
    return unregisterLibvirtSecrets(storageDomain, vds, libvirtSecrets);
}
Also used : VDS(org.ovirt.engine.core.common.businessentities.VDS) LibvirtSecret(org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret)

Example 5 with LibvirtSecret

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

the class BackendOpenStackVolumeAuthenticationKeysResourceTest 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)

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