Bug 2218501 - Hammer commands does not support --per-page options and --help would not have it listed.
Summary: Hammer commands does not support --per-page options and --help would not have...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hammer
Version: 6.11.0
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Satellite QE Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-06-29 12:33 UTC by Vedashree Deshpande
Modified: 2023-06-30 10:46 UTC (History)
2 users (show)

Fixed In Version: katello-4.7.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-06-30 10:46:36 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 35633 0 Normal Closed Activation Keys "product_content" API doesn't expose the "per_page" parameter 2023-06-30 10:46:36 UTC

Description Vedashree Deshpande 2023-06-29 12:33:21 UTC
Description of problem:
Hammer commands does not support --per-page options and --help would not have it listed. 

The older bug, https://bugzilla.redhat.com/show_bug.cgi?id=1583318 was fixed only for specific command it seems. 

But one of the customers is facing same issue with different command in Satellite 6.11. 

]# hammer activation-key product-content --content-access-mode-all 1 --organization-id 1 --name "RHEL8_DevTest" --per-page 20
Error: Unrecognised option '--per-page'.

See: 'hammer activation-key product-content --help'.

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

Options:
 --content-access-mode-all BOOLEAN              Get all content available, not just that provided by subscriptions
 --content-access-mode-env BOOLEAN              Limit content to just that available in the activation key's content view
                                                version
 --fields LIST                                  Show specified fields or predefined field sets only. (See below)
 --id VALUE                                     Id of the activation key
 --name VALUE                                   Activation key name to search by
 --organization[-id|-title|-label] VALUE/NUMBER 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       |
  -----------------|-----|---------|-----

Option details:
  Here you can find option types and the value an option can accept:

  BOOLEAN             One of true/false, yes/no, 1/0
  DATETIME            Date and time in YYYY-MM-DD HH:MM:SS or ISO 8601 format
  ENUM                Possible values are described in the option's description
  FILE                Path to a file
  KEY_VALUE_LIST      Comma-separated list of key=value.
                      JSON is acceptable and preferred way for such parameters
  LIST                Comma separated list of values. Values containing comma should be quoted or escaped with backslash.
                      JSON is acceptable and preferred way for such parameters
  MULTIENUM           Any combination of possible values described in the option's description
  NUMBER              Numeric value. Integer
  SCHEMA              Comma separated list of values defined by a schema.
                      JSON is acceptable and preferred way for such parameters
  VALUE               Value described in the option's description. Mostly simple string



Version-Release number of selected component (if applicable):
satellite 6.11 and may be all below versions. 

How reproducible:
easily. 

Steps to Reproduce:
1.
2.
3.

Actual results:
option not valid. 

Expected results:
should be able to control --per-page number. 

Additional info:

Fixed issue for the only command: 
~~~
]# hammer recurring-logic list --help
Usage:
    hammer recurring-logic <list|index> [OPTIONS]

Options:
 --fields LIST                           Show specified fields or predefined field sets only. (See below)
 --location[-id|-title] VALUE/NUMBER     Set the current location context for the request
 --order VALUE                           Sort and order by a searchable field, e.g. '<field> DESC'
 --organization[-id|-title] VALUE/NUMBER Set the current organization context for the request
 --page NUMBER                           Page number, starting at 1
 --per-page VALUE                        Number of results per page to return, 'all' to return all results
 --search VALUE                          Filter results
 -h, --help                              Print help

Predefined field sets:
  ----------|-----|--------
  FIELDS    | ALL | DEFAULT
  ----------|-----|--------
  Id        | x   | x
  Cron line | x   | x
  Iteration | x   | x
  End time  | x   | x
  State     | x   | x
  ----------|-----|--------

Option details:
  Here you can find option types and the value an option can accept:

  BOOLEAN             One of true/false, yes/no, 1/0
  DATETIME            Date and time in YYYY-MM-DD HH:MM:SS or ISO 8601 format
  ENUM                Possible values are described in the option's description
  FILE                Path to a file
  KEY_VALUE_LIST      Comma-separated list of key=value.
                      JSON is acceptable and preferred way for such parameters
  LIST                Comma separated list of values. Values containing comma should be quoted or escaped with backslash.
                      JSON is acceptable and preferred way for such parameters
  MULTIENUM           Any combination of possible values described in the option's description
  NUMBER              Numeric value. Integer
  SCHEMA              Comma separated list of values defined by a schema.
                      JSON is acceptable and preferred way for such parameters
  VALUE               Value described in the option's description. Mostly simple string


~~~

Comment 1 Adam Ruzicka 2023-06-30 10:46:36 UTC
This is already fixed in Satellite 6.13.


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