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

Katello API activation_key/:id/product_content does not expose per_page

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done-Errata
    • Icon: Normal Normal
    • 6.13.0
    • 6.12.0
    • API
    • Moderate
    • None

      Description of problem:

      Katello's API documentation doesn't expose paging in /katello/api/activation_keys/:id/product_content [1]. This limits the theforeman.foreman.activation_key Ansible module [2] to a maximum of 20 products - in case you have more, the module doesn't know about all products and is no longer idempotent. The same is true for hammer, it shows about additional pages, but doesn't accept to page or increase the page size. This becomes painful when creating keys for Library, Organization View on a Red Hat Satellite with Simple Content Access enabled.

      [1] https://theforeman.org/plugins/katello/3.17/api/apidoc/v2/activation_keys/product_content.html
      [2] https://docs.ansible.com/ansible/latest/collections/theforeman/foreman/activation_key_module.html

      From my understanding it's sufficient to announce the per_page and page parameters in the API documentation to make apypie aware of the parameters. I'm not sure if hammer needs special treating.

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

      Red Hat Satellite >= 6.12

      How reproducible:

      always

      Steps to Reproduce:
      1. Make sure the Satellite has more then 20 active Red Hat repositories
      2. Create an ActivationKey following the example in https://docs.ansible.com/ansible/latest/collections/theforeman/foreman/activation_key_module.html
      3. Rerun the Ansible play

      Actual results:

      The module isn't idempotent since it is not capable of fetching more then 20 product entries from the existing ActivationKey

      Expected results:

      The module fetches all product entries and is idempotent

      Additional info:

      The same issue exists in hammer:

      1. hammer -d activation-key product-content --id=1 --organization=Default --content-access-mode-all true --content-access-mode-env false

      ----|---------------------------------------------------------------------|----------------------------------------|----------------|---------
      ID | NAME | LABEL | DEFAULT ENABLED? | OVERRIDE
      ----|---------------------------------------------------------------------|----------------------------------------|----------------|---------
      4822 | Red Hat Enterprise Linux 7 Server (Kickstart) | rhel-7-server-kickstart | no |
      4848 | Red Hat Enterprise Linux 7 Server (RPMs) | rhel-7-server-rpms | yes | enabled:0
      3015 | Red Hat Enterprise Linux 8 for x86_64 - AppStream (Kickstart) | rhel-8-for-x86_64-appstream-kickstart | no |
      ----|---------------------------------------------------------------------|----------------------------------------|----------------|---------
      Page 1 of 2 (use --page and --per-page for navigation).

              egolov@redhat.com Evgeni Golov
              jira-bugzilla-migration RH Bugzilla Integration
              Lukas Hellebrandt Lukas Hellebrandt
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: