RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 654501 - [RFE] subscription-manager list should accept filtering
Summary: [RFE] subscription-manager list should accept filtering
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: subscription-manager
Version: 7.0
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: beta
: 7.0
Assignee: Carter Kozak
QA Contact: Entitlement Bugs
URL:
Whiteboard:
Depends On:
Blocks: rhsm-rhel70
TreeView+ depends on / blocked
 
Reported: 2010-11-18 02:34 UTC by Bryan Kearney
Modified: 2014-09-15 00:08 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-13 13:28:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Bryan Kearney 2010-11-18 02:34:15 UTC
Also allow some kind of filtering, so "s-m list RH1050830" shows
just the RHEL subscription (doing filtering on product name/id is needed, on poolId would be nice too).

Comment 2 John Sefler 2011-03-05 06:20:47 UTC
If this RFE is implemented, syntax usage with wildcards like the following is what I think would be useful:
subscription-manager list --available --productId=RH105*
subscription-manager list --consumed --productName="Awesome OS*"
subscription-manager list --consumed --contractNumber=1234* --productName="*Server*"
subscription-manager list --installed --status="Not Subscribed" 

However, the more I think about how to filter the subscription-manager list results, the more I believe piping the list results through grep gives the querying admin user what they really want.

Comment 8 RHEL Program Management 2012-07-10 06:04:59 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 9 RHEL Program Management 2012-07-11 02:07:05 UTC
This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development.  This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4.

Comment 11 Carter Kozak 2013-09-11 16:21:14 UTC
Adding filter options to only list --available to mirror the gui.

Comment 12 Carter Kozak 2013-09-30 16:58:53 UTC
commit 756fbabe8262a18df054c8ee50431d82d9aa765f
Author: ckozak <ckozak>
Date:   Mon Sep 16 12:38:55 2013 -0400

    654501: add some filtering to list available

Comment 14 Sharath Dwaral 2013-10-17 20:30:28 UTC
Version:
# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 0.8.29-1
subscription-manager: 1.10.4-1.el7
python-rhsm: 1.10.3-1.el7


Verification:
# subscription-manager list --help
Usage: subscription-manager list [OPTIONS]

List subscription and product information for this system

Options:
  -h, --help            show this help message and exit
  --proxy=PROXY_URL     proxy URL in the form of proxy_hostname:proxy_port
  --proxyuser=PROXY_USER
                        user for HTTP proxy with basic authentication
  --proxypassword=PROXY_PASSWORD
                        password for HTTP proxy with basic authentication
  --installed           list shows those products which are installed
                        (default)
  --available           show those subscriptions which are available
  --all                 used with --available to ensure all subscriptions are
                        returned
  --ondate=ON_DATE      date to search on, defaults to today's date, only used
                        with --available (example: 2013-10-17)
  --consumed            show the subscriptions being consumed by this system
  --servicelevel=SERVICE_LEVEL
                        shows only subscriptions matching the specified
                        service level; only used with --available and
                        --consumed
  --no-overlap          shows pools which provide products that are not
  ^^^^^^^^^^^^^         already covered; only used with --available
  --match-installed     shows only subscriptions matching products that are
  ^^^^^^^^^^^^^^^^^     currently installed; only used with --available



The new filtering options perform as they are meant to be. They filter out content based on the option used and mimic the GUI.

They only work when used along with --available.

They bash-complete/tab-complete

They are listed in help options as shown above

No man page entry bug 1020522 opened


VERIFIED

Comment 15 Ludek Smid 2014-06-13 13:28:17 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


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