Search in sources :

Example 6 with ProviderQueryParameters

use of org.ovirt.engine.core.common.queries.ProviderQueryParameters in project ovirt-engine by oVirt.

the class AsyncDataProvider method getProviderCertificateChain.

public void getProviderCertificateChain(AsyncQuery<List<CertificateInfo>> aQuery, Provider provider) {
    aQuery.converterCallback = new ListConverter<>();
    Frontend.getInstance().runQuery(QueryType.GetProviderCertificateChain, new ProviderQueryParameters(provider), aQuery);
}
Also used : ProviderQueryParameters(org.ovirt.engine.core.common.queries.ProviderQueryParameters) GetVmsFromExternalProviderQueryParameters(org.ovirt.engine.core.common.queries.GetVmsFromExternalProviderQueryParameters)

Example 7 with ProviderQueryParameters

use of org.ovirt.engine.core.common.queries.ProviderQueryParameters in project ovirt-engine by oVirt.

the class AsyncDataProvider method getExternalProviderHostGroupList.

public void getExternalProviderHostGroupList(AsyncQuery<List<ExternalHostGroup>> aQuery, Provider provider) {
    aQuery.converterCallback = new ListConverter<>();
    ProviderQueryParameters params = new ProviderQueryParameters();
    params.setProvider(provider);
    Frontend.getInstance().runQuery(QueryType.GetHostGroupsFromExternalProvider, params, aQuery);
}
Also used : ProviderQueryParameters(org.ovirt.engine.core.common.queries.ProviderQueryParameters) GetVmsFromExternalProviderQueryParameters(org.ovirt.engine.core.common.queries.GetVmsFromExternalProviderQueryParameters)

Example 8 with ProviderQueryParameters

use of org.ovirt.engine.core.common.queries.ProviderQueryParameters in project ovirt-engine by oVirt.

the class BackendExternalProviderCertificateResource method get.

@Override
public Certificate get() {
    // The resource identifier is actually the index of the certificate in the chain:
    int i;
    try {
        i = Integer.parseInt(id);
    } catch (NumberFormatException exception) {
        return notFound();
    }
    // The backend doesn't have a mechanism to retrieve just one of the certificates of the chain, so we have to
    // retrieve them all and find the one that matches the identifier:
    Provider provider = BackendExternalProviderHelper.getProvider(this, providerId);
    ProviderQueryParameters parameters = new ProviderQueryParameters();
    parameters.setProvider(provider);
    List<CertificateInfo> entities = getBackendCollection(CertificateInfo.class, QueryType.GetProviderCertificateChain, parameters);
    if (entities != null && i >= 0 && i < entities.size()) {
        CertificateInfo entity = entities.get(i);
        Certificate model = populate(map(entity), entity);
        model.setId(id);
        return model;
    }
    // No luck:
    return notFound();
}
Also used : ProviderQueryParameters(org.ovirt.engine.core.common.queries.ProviderQueryParameters) CertificateInfo(org.ovirt.engine.core.common.businessentities.CertificateInfo) Provider(org.ovirt.engine.core.common.businessentities.Provider) Certificate(org.ovirt.engine.api.model.Certificate)

Example 9 with ProviderQueryParameters

use of org.ovirt.engine.core.common.queries.ProviderQueryParameters in project ovirt-engine by oVirt.

the class BackendExternalProviderCertificatesResource method list.

@Override
public Certificates list() {
    Provider provider = BackendExternalProviderHelper.getProvider(this, providerId);
    ProviderQueryParameters parameters = new ProviderQueryParameters();
    parameters.setProvider(provider);
    return mapCollection(getBackendCollection(QueryType.GetProviderCertificateChain, parameters));
}
Also used : ProviderQueryParameters(org.ovirt.engine.core.common.queries.ProviderQueryParameters) Provider(org.ovirt.engine.core.common.businessentities.Provider)

Example 10 with ProviderQueryParameters

use of org.ovirt.engine.core.common.queries.ProviderQueryParameters in project ovirt-engine by oVirt.

the class AsyncDataProvider method getExternalProviderDiscoveredHostList.

public void getExternalProviderDiscoveredHostList(AsyncQuery<List<ExternalDiscoveredHost>> aQuery, Provider provider) {
    aQuery.converterCallback = new ListConverter<>();
    ProviderQueryParameters params = new ProviderQueryParameters();
    params.setProvider(provider);
    Frontend.getInstance().runQuery(QueryType.GetDiscoveredHostListFromExternalProvider, params, aQuery);
}
Also used : ProviderQueryParameters(org.ovirt.engine.core.common.queries.ProviderQueryParameters) GetVmsFromExternalProviderQueryParameters(org.ovirt.engine.core.common.queries.GetVmsFromExternalProviderQueryParameters)

Aggregations

ProviderQueryParameters (org.ovirt.engine.core.common.queries.ProviderQueryParameters)12 Provider (org.ovirt.engine.core.common.businessentities.Provider)8 ExternalHostProvider (org.ovirt.engine.api.model.ExternalHostProvider)6 GetVmsFromExternalProviderQueryParameters (org.ovirt.engine.core.common.queries.GetVmsFromExternalProviderQueryParameters)4 QueryReturnValue (org.ovirt.engine.core.common.queries.QueryReturnValue)3 Certificate (org.ovirt.engine.api.model.Certificate)1 ExternalComputeResource (org.ovirt.engine.api.model.ExternalComputeResource)1 ExternalDiscoveredHost (org.ovirt.engine.api.model.ExternalDiscoveredHost)1 ExternalHostGroup (org.ovirt.engine.api.model.ExternalHostGroup)1 CertificateInfo (org.ovirt.engine.core.common.businessentities.CertificateInfo)1