+++ 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).
The XML schema used by the RESTAPI already has a "total" element associated to collections that could be used for this purpose:
<vms>
<vm id="...">...</vm>
<vm id="...">...</vm>
...
<total>123456</total>
</vms>
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.