Search in sources :

Example 1 with V3HostHelper

use of org.ovirt.engine.api.v3.helpers.V3HostHelper in project ovirt-engine by oVirt.

the class V3HostsServer method list.

@GET
public V3Hosts list(@Context HttpHeaders headers, @Context UriInfo ui) {
    V3Hosts hosts = adaptList(getDelegate()::list);
    // In V3 the collection of hosts used to have the statistics inline, but only when the 'statistics' detail
    // was explicitly provided:
    Set<String> details = DetailHelper.getDetails(headers, ui);
    if (details.contains("statistics")) {
        hosts.getHosts().forEach(V3HostHelper::addStatistics);
    }
    return hosts;
}
Also used : V3Hosts(org.ovirt.engine.api.v3.types.V3Hosts) V3HostHelper(org.ovirt.engine.api.v3.helpers.V3HostHelper) GET(javax.ws.rs.GET)

Aggregations

GET (javax.ws.rs.GET)1 V3HostHelper (org.ovirt.engine.api.v3.helpers.V3HostHelper)1 V3Hosts (org.ovirt.engine.api.v3.types.V3Hosts)1