Search in sources :

Example 1 with V3VmHelper

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

the class V3VmsServer method list.

@GET
public V3VMs list(@Context HttpHeaders headers, @Context UriInfo ui) {
    // Transform the data:
    V3VMs vms = adaptList(getDelegate()::list);
    // Add the link to the disks collection:
    vms.getVMs().forEach(V3VmHelper::addDisksLink);
    // Add the requested inline details:
    Set<String> details = DetailHelper.getDetails(headers, ui);
    if (details != null && !details.isEmpty()) {
        vms.getVMs().forEach(vm -> {
            V3VmServer server = getVmResource(vm.getId());
            V3VmHelper.addInlineDetails(vm, server, details);
        });
    }
    // Add the guest IP address:
    vms.getVMs().forEach(V3VmHelper::addGuestIp);
    return vms;
}
Also used : V3VMs(org.ovirt.engine.api.v3.types.V3VMs) V3VmHelper(org.ovirt.engine.api.v3.helpers.V3VmHelper) GET(javax.ws.rs.GET)

Aggregations

GET (javax.ws.rs.GET)1 V3VmHelper (org.ovirt.engine.api.v3.helpers.V3VmHelper)1 V3VMs (org.ovirt.engine.api.v3.types.V3VMs)1