Bug 2062774 - [RFE] hammer activation-key product-content does not have --page and --per-page
Summary: [RFE] hammer activation-key product-content does not have --page and --per-page
Keywords:
Status: NEW
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Activation Keys
Version: 6.10.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Satellite QE Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-03-10 14:59 UTC by Karishma
Modified: 2023-09-07 00:32 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker SAT-9011 0 None None None 2022-03-14 11:13:16 UTC

Description Karishma 2022-03-10 14:59:10 UTC
1. Proposed title of this feature request

==> [RFE] Add --page and --per-page flag to list hammer activation-key with product-content option

=============================================================
hammer activation-key product-content --help
Usage:
    hammer activation-key product-content [OPTIONS]

Options:
 --content-access-mode-all CONTENT_ACCESS_MODE_ALL Get all content available, not just that provided by subscriptions
                                                   One of true/false, yes/no, 1/0.
 --content-access-mode-env CONTENT_ACCESS_MODE_ENV Limit content to just that available in the activation key's content view version
                                                   One of true/false, yes/no, 1/0.
 --fields FIELDS                                   Show specified fields or predefined field sets only. (See below)
                                                   Comma separated list of values. Values containing comma should be quoted or escaped with backslash.
                                                   JSON is acceptable and preferred way for complex parameters
 --id ID                                           Id of the activation key
 --name NAME                                       Activation key name to search by
 --organization[-id|-title|-label]                 Name/Title/Label/Id of associated organization
 -h, --help                                        Print help

Predefined field sets:
  -----------------|-----|---------|-----
  FIELDS           | ALL | DEFAULT | THIN
  -----------------|-----|---------|-----
  Id               | x   | x       | x
  Name             | x   | x       | x
  Type             | x   | x       |
  Url              | x   | x       |
  Gpg key          | x   | x       |
  Label            | x   | x       |
  Default enabled? | x   | x       |
  Override         | x   | x       |
  -----------------|-----|---------|-----

=============================================================

2. What are the nature and description of the request? 
==> Customer is using anisble playbook hence looking for hammer commands to get it executed using cli

3. How would you like to achieve this? (List the functional requirements here). 

Add the option of --page and --per-page to get the details of activation-key with product-content option.

Comment 1 Benjamin Kielhold 2022-04-25 20:10:23 UTC
It should be noted that hammer will suggest these page options exist when they really don't, for example:

$ sudo hammer activation-key product-content --name <name> --organization <org_name> --fields Name,Label,Override --content-access-mode-all true --content-access-mode-env true

----------------------------------|-------------------------------------------------|----------
NAME                              | LABEL                                           | OVERRIDE
----------------------------------|-------------------------------------------------|----------
Product one                       | product_one                                     | enabled:0
...
Product 20                        | product_20                                      | enabled:1
----------------------------------|-------------------------------------------------|----------
Page 1 of 2 (use --page and --per-page for navigation).


$ sudo hammer activation-key product-content --name <name> --organization <org_name> --fields Name,Label,Override --content-access-mode-all true --content-access-mode-env true --per-page 200

Error: Unrecognised option '--per-page'.


The pagination issue can be worked around by changing the "Entries per page" setting on the Satellite webui to the desired amount which is located in Administer -> Settings -> General tab.


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