Bug 654501

Summary: [RFE] subscription-manager list should accept filtering
Product: Red Hat Enterprise Linux 7 Reporter: Bryan Kearney <bkearney>
Component: subscription-managerAssignee: Carter Kozak <ckozak>
Status: CLOSED CURRENTRELEASE QA Contact: Entitlement Bugs <entitlement-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 7.0CC: bkearney, ckozak, fsharath, jgalipea, jsefler, whayutin
Target Milestone: betaKeywords: FutureFeature
Target Release: 7.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 13:28:17 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 863175    

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.