Search in sources :

Example 1 with ImportProviderCertificateParameters

use of org.ovirt.engine.core.common.action.ImportProviderCertificateParameters in project ovirt-engine by oVirt.

the class AbstractBackendExternalProviderResource method importCertificates.

@Override
public Response importCertificates(Action action) {
    Provider provider = BackendExternalProviderHelper.getProvider(this, id);
    validateParameters(action, "certificates.content");
    String content = null;
    Certificates certificates = action.getCertificates();
    if (certificates != null) {
        List<Certificate> list = certificates.getCertificates();
        if (!CollectionUtils.isEmpty(list)) {
            content = list.get(0).getContent();
        }
    }
    return performAction(ActionType.ImportProviderCertificate, new ImportProviderCertificateParameters(provider, content));
}
Also used : Certificates(org.ovirt.engine.api.model.Certificates) ImportProviderCertificateParameters(org.ovirt.engine.core.common.action.ImportProviderCertificateParameters) Provider(org.ovirt.engine.core.common.businessentities.Provider) ExternalProvider(org.ovirt.engine.api.model.ExternalProvider) Certificate(org.ovirt.engine.api.model.Certificate)

Aggregations

Certificate (org.ovirt.engine.api.model.Certificate)1 Certificates (org.ovirt.engine.api.model.Certificates)1 ExternalProvider (org.ovirt.engine.api.model.ExternalProvider)1 ImportProviderCertificateParameters (org.ovirt.engine.core.common.action.ImportProviderCertificateParameters)1 Provider (org.ovirt.engine.core.common.businessentities.Provider)1