Bug 1926836 - RFE: provide an API to get integrated subscription/repository state info
Summary: RFE: provide an API to get integrated subscription/repository state info
Keywords:
Status: NEW
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: subscription-manager
Version: 8.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.0
Assignee: candlepin-bugs
QA Contact: Red Hat subscription-manager QE Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-02-09 14:33 UTC by Michal Reznik
Modified: 2023-08-01 07:28 UTC (History)
2 users (show)

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


Attachments (Terms of Use)

Description Michal Reznik 2021-02-09 14:33:58 UTC
Use case:

Leapp (RHEL in-place upgrades) is frequently using RHSM to get various info about subscriptions and repositories. In order to limit number of RHSM calls and avoid parsing the test output, it would be nice to have a one place our tool could call, to get the info in machine consumable format.

E.g.

# subcription-manager summary --json

{
  "list": [
    1,
    2,
    3
  ],
  "repos": [
    1,
    2,
    3
  ],
  "is_sca": true,
  "release": "8.2",
  “purpose”: “...”,
  ...
}

Comment 1 Rehana 2021-02-12 14:50:19 UTC
Hi Michal , 

Can you please let us know what are the subscription manager commands that leapp tool is currently using ? We would also like to know does the leapp tool preserve the consumer details after the upgrades ? 

thanks,
Rehana

Comment 3 Petr Stodulka 2021-02-17 11:12:05 UTC
Hi Rehana,
here is the list of rhsm commands we are actually using:
----- (to get some data)
  # subscription-manager list --consumed
  # subscription-manager status
  # subscription-manager repos --list-enabled
  # subscription-manager release

----- (to "configure" system as needed)
  # subscription-manager refresh
  # subscription-manager release --unset
  # subscription-manager release --set ...
  # subscription-manager repos --enable .... 

----------------

I guess you asked just about the first set of commands, which we use to get the data about system.
From that commands we get right now this info:
  - The release the subscription-manager is set to
  - SKUs the system is attached to
  - Repositories that are available to the current system through the subscription-manager
  - Repositories that are enabled on the current system through the subscription-manager
  - Whether the SCA is used or not

And separately out-of rhsm utility, we get info about the installed product certificate(s).

I am not sure what exactly are you asking about the preservation of consumer details. Can you elaborate on that a little bit? I will try to answer, that expactation is that the upgraded system is still subscribe and user can use it. If this is what you are asking about.


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