Uploaded image for project: 'Satellite'
  1. Satellite
  2. SAT-20585

GET request on /api/fact_values and /api/hosts/:host_id/facts shows no results if using per_page=all in Satellite 6

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • 6.10.4
    • Fact
    • 0
    • False
    • Hide

      None

      Show
      None
    • False
    • CLOSED
    • 900
    • Rocket
    • Moderate
    • None

      Description of problem:

      GET request on /api/fact_values and /api/hosts/:host_id/facts shows no results if using per_page=all but works fine if we use a positive integer i.e. per_page=10 or per_page=9999

      They perhaps are part of the same underlying code as I can see both of them from https://satellite.example.com/apidoc/v2/fact_values/index.html

      This problem is not present in the /api/hosts endpoint though.

      GET on /api/v2/hosts/?per_page=all and /api/v2/hosts/?per_page=10 will print exact same set of result if you have 10 systems .

      Version-Release number of selected component (if applicable):

      Satellite 6.10 (all earlier versions of satellite)

      How reproducible:

      Always

      Steps to Reproduce:
      1. Install and configure a Satellite 6.10 and register a system with the same.

      2. Run the following APIs against the ID of the registered system e.g. here it is 117

      1. curl -ku admin:password https://`hostname -f`/api/v2/hosts/117/facts?per_page=all
      1. curl -ku admin:password https://`hostname -f`/api/v2/hosts/117/facts?per_page=5

      Actual results:

      1. curl -ku admin:RedHat1! https://`hostname -f`/api/v2/hosts/117/facts?per_page=all
        {
        "total": 331,
        "subtotal": 0,
        "page": 1,
        "per_page": 331,
        "search": " host = 117",
        "sort": { "by": null, "order": null }

        ,
        "results": {}
        }

      1. curl -ku admin:RedHat1! https://`hostname -f`/api/v2/hosts/117/facts?per_page=5
        {
        "total": 331,
        "subtotal": 1,
        "page": 1,
        "per_page": 5,
        "search": " host = 117",
        "sort": { "by": null, "order": null }

        ,
        "results": {"rhel7.example.com":{"ansible_device_links::ids":null,"ansible_device_links::uuids":null,"ansible_device_links::masters":null,"ansible_device_links":null,"ansible_default_ipv4":null}}
        }

      Expected results:

      The per_page=all should be able to list all the fact_names and values related to that host.

      Additional info:

      There's a Redmine present already i.e. https://projects.theforeman.org/issues/31897

            jira-bugzilla-migration RH Bugzilla Integration
            jira-bugzilla-migration RH Bugzilla Integration
            RH Bugzilla Integration RH Bugzilla Integration
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: