Bug 1463633
Summary: | [RFE] Provide support for data aggregation when fetching entities | ||
---|---|---|---|
Product: | [oVirt] ovirt-engine | Reporter: | Martin Perina <mperina> |
Component: | RestAPI | Assignee: | Ori Liel <oliel> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | samuel macko <smacko> |
Severity: | high | Docs Contact: | |
Priority: | high | ||
Version: | 4.1.3.3 | CC: | bgraveno, bugs, lsvaty, mgoldboi, michal.skrivanek, mperina, oliel, oourfali |
Target Milestone: | ovirt-4.2.0 | Keywords: | FutureFeature |
Target Release: | 4.2.0 | Flags: | rule-engine:
ovirt-4.2+
lsvaty: testing_plan_complete- mgoldboi: planning_ack+ mperina: devel_ack+ lsvaty: testing_ack+ |
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Enhancement | |
Doc Text: |
This update enables Red Hat Virtualization API users to request that contents of some of the entity's links be returned inline, inside the requested entity.
Previously, to retrieve multiple related objects from the API, the only alternative was to retrieve the first one, then send additional requests to retrieve the related objects. For example, if you needed a virtual machine and also the disks and NICs, you would need to first send a request like this:
GET /ovirt-engine/api/vms/123
And then send additional requests to get the disk attachments, the disks, and the NICs:
GET /ovirt-engine/api/vms/123/diskattachments GET /ovirt-engine/api/disks/456 GET /ovirt-engine/api/disks/789 GET /ovirt-engine/api/vms/123/nics
In environments with high latency, this increases the time required to retrieve the data. In addition, it also means that multiple queries have to be sent to the database to retrieve the data. To improve this, a new follow parameter has been introduced. This parameter is a list of links that the server should follow and populate. For example, the previous scenario will be solved sending this request:
GET /ovirt-engine/api/vms/123?follow=diskattachments.disks,nics
This will return the virtual machine with the disks and the NICs embedded in the same response, thus avoiding the multiple network round-trips. The multiple database queries will be avoided only if the server is modified to retrieve that data with the more efficient queries, otherwise the server will use the approach of calling itself to retrieve it, which won’t improve the number of queries.
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2017-12-20 11:06:58 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | Infra | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 1436206 |
Description
Martin Perina
2017-06-21 11:35:08 UTC
Verified in ovirt version 4.2.0-0.0.master.20170823165744.git116f435.el7.centos Tested with: GET /ovirt-engine/api/vms?follow=disk_attachments,nics Result: <vms> <vm> <disk_attachments> </disk_attachments> ... <nics> </nics> </vm> </vms> This bugzilla is included in oVirt 4.2.0 release, published on Dec 20th 2017. Since the problem described in this bug report should be resolved in oVirt 4.2.0 release, published on Dec 20th 2017, it has been closed with a resolution of CURRENT RELEASE. If the solution does not work for you, please open a new bug report. |