Bug 1122125 - [RFE] RESTAPI: need to return total count of items (ignoring page number/size) for any given search query.
Summary: [RFE] RESTAPI: need to return total count of items (ignoring page number/size...
Alias: None
Product: oVirt
Classification: Retired
Component: ovirt-engine-api
Version: 3.5
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: 3.6.0
Assignee: Ori Liel
QA Contact: Pavel Stehlik
Whiteboard: infra
Depends On: 1139353
Blocks: 1114692
TreeView+ depends on / blocked
Reported: 2014-07-22 15:12 UTC by Einav Cohen
Modified: 2016-02-10 19:35 UTC (History)
13 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of: 1114692
: 1139353 (view as bug list)
Last Closed: 2015-03-23 10:24:08 UTC
oVirt Team: Infra

Attachments (Terms of Use)

Description Einav Cohen 2014-07-22 15:12:46 UTC
+++ This bug was initially created as a clone of Bug #1114692 +++

in order to display in the GUI total numbers of items for every paged grid (at the moment - main grids):

need new queries that will return the total count of items for a certain query (ignoring the requested page number/size), or that the existing search queries will return, as part of the result, *also* the number of items for that query (again, ignoring the requested page number/size).

Comment 1 Juan Hernández 2014-09-08 17:53:03 UTC
The XML schema used by the RESTAPI already has a "total" element associated to collections that could be used for this purpose:

    <vm id="...">...</vm>
    <vm id="...">...</vm>

How the backend will return the total size is to be decided by the backend maintainers. My suggestion is that queries be modified to return an object containing the list of results and the total size, instead of the plain list that they return today. The RESTAPI can then check the type of the returned object and populate the "total" field if available. This allows for a once off implementation in the RESTAPI and for a gradual implementation of the feature in the backend.

I have opened bug 1139353 to track the required changes in the backend.

Comment 2 Juan Hernández 2015-03-23 10:24:08 UTC
Obtaining the total number of items is unfeasible due to performance degradation.

Note You need to log in before you can comment on or make changes to this bug.