Bug 1645007 - Foreman response is limited to 20 entries per call
Summary: Foreman response is limited to 20 entries per call
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ovirt-4.3.0
: 4.3.0
Assignee: Moti Asayag
QA Contact: Petr Kubica
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-11-01 08:39 UTC by Moti Asayag
Modified: 2019-05-08 12:39 UTC (History)
4 users (show)

Fixed In Version: ovirt-engine-4.3.0_alpha
Doc Type: Bug Fix
Doc Text:
Previously, making an API call to the foreman (hosts, hostgroups, compute resources) returned only 20 entries. The current release fixes this issue and displays all of the entries.
Clone Of:
Environment:
Last Closed: 2019-05-08 12:38:47 UTC
oVirt Team: Infra
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2019:1085 0 None None None 2019-05-08 12:39:02 UTC
oVirt gerrit 95280 0 None None None 2018-11-06 11:14:37 UTC
oVirt gerrit 95281 0 master MERGED core: Increase page size for foreman requests 2018-11-08 14:15:23 UTC

Description Moti Asayag 2018-11-01 08:39:03 UTC
Description of problem:
Only 20 entries per call are retrieved from foreman (hosts, hostgroups, compute resources).

The default api call to foreman returns the following details:

$ curl -s  -k -u admin:miFWnEsYMXD5iZPP http://node01:5000/api/v2/hostgroups | python -m json.tool
{
    "page": 1,
    "per_page": 20,
    "results": [
        {
          ...
        }
     ]
}

This seems to be common for other foreman resources fetched by ovirt-engine (except for Katello where pagination was implemented).

Version-Release number of selected component (if applicable):
master (but should exist since ovirt-foreman integration was introduced)

How reproducible:
100%

Steps to Reproduce:
1. Have satellite with over 20 host groups
2. Show the full list of host groups on RHV UI (hosts --> new host)

Actual results:
The list of hostgroups is limited to 20.

Expected results:
The entire list of hostgroups should be shown

Additional info:


Note for the develop that will fix the limited response size:
https://github.com/oVirt/ovirt-engine/blob/master/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/host/provider/foreman/ForemanHostProviderProxy.java#L44

Calls to foreman are done without 'per_page=99999' to simulate unlimited page size (all entries in one call) therefore the queries/urls should be changed to include it, i.e.:

http://node01:5000/api/v2/hostgroups?per_page=99999
and the response will reflect it:
{
    "page": 1,
    "per_page": 99999,
    "results": [
        {
        }
     ]
}

Comment 1 Petr Kubica 2019-01-30 11:12:26 UTC
Verified in ovirt-engine-4.3.0.2-0.1.el7.noarch

Comment 3 errata-xmlrpc 2019-05-08 12:38:47 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2019:1085


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