use of org.ovirt.engine.core.common.queries.GetHostListFromExternalProviderParameters in project ovirt-engine by oVirt.
the class BackendExternalHostsResource method list.
@Override
public ExternalHosts list() {
GetHostListFromExternalProviderParameters parameters = new GetHostListFromExternalProviderParameters();
parameters.setFilterOutExistingHosts(true);
parameters.setProviderId(asGuid(providerId));
return mapCollection(getBackendCollection(QueryType.GetHostListFromExternalProvider, parameters));
}
use of org.ovirt.engine.core.common.queries.GetHostListFromExternalProviderParameters in project ovirt-engine by oVirt.
the class AsyncDataProvider method getExternalProviderHostList.
public void getExternalProviderHostList(AsyncQuery<List<VDS>> aQuery, Guid providerId, boolean filterOutExistingHosts, String searchFilter) {
aQuery.converterCallback = new ListConverter<>();
GetHostListFromExternalProviderParameters params = new GetHostListFromExternalProviderParameters();
params.setFilterOutExistingHosts(filterOutExistingHosts);
params.setProviderId(providerId);
params.setSearchFilter(searchFilter);
Frontend.getInstance().runQuery(QueryType.GetHostListFromExternalProvider, params, aQuery);
}
use of org.ovirt.engine.core.common.queries.GetHostListFromExternalProviderParameters in project ovirt-engine by oVirt.
the class BackendExternalHostResource method get.
@Override
public ExternalHost get() {
// Convert the resource identifier to the host group name:
String name = hex2string(id);
// The backend doesn't have a way to retrieve a host by ide, so we have to iterate them:
GetHostListFromExternalProviderParameters parameters = new GetHostListFromExternalProviderParameters();
parameters.setFilterOutExistingHosts(true);
parameters.setProviderId(asGuid(providerId));
QueryReturnValue result = runQuery(QueryType.GetHostListFromExternalProvider, parameters);
List<VDS> entities = result.getReturnValue();
if (entities != null) {
for (VDS entity : entities) {
if (name.equals(entity.getName())) {
return addLinks(populate(map(entity), entity));
}
}
}
// No luck:
return notFound();
}
Aggregations