Red Hat Satellite engineering is moving the tracking of its product development work on Satellite 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 "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. 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 "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-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 1830968 - [RFE] API should return simple results to understand if the repositories for hosts are enabled or not.
Summary: [RFE] API should return simple results to understand if the repositories for ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hosts - Content
Version: 6.6.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: 6.12.0
Assignee: Ian Ballou
QA Contact: Shweta Singh
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-05-04 12:25 UTC by Vedashree Deshpande
Modified: 2022-11-16 13:32 UTC (History)
8 users (show)

Fixed In Version: tfm-rubygem-katello-4.5.0.15-1,tfm-rubygem-katello-4.5.0.16-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-11-16 13:32:23 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 35000 0 Normal Closed API should return simple results to understand if the repositories for hosts are enabled or not. 2022-06-10 16:29:03 UTC
Red Hat Issue Tracker SAT-10725 0 None None None 2022-09-21 21:16:26 UTC
Red Hat Knowledge Base (Solution) 6114981 0 None None None 2021-06-11 13:18:40 UTC
Red Hat Product Errata RHSA-2022:8506 0 None None None 2022-11-16 13:32:35 UTC

Description Vedashree Deshpande 2020-05-04 12:25:38 UTC
Description of problem:
On satellite server CLI if we run below command: 
# curl -k -u admin:Redhat1! https://syssat65.gsslab.pnq2.redhat.com/api/hosts/4/subscriptions/product_content | python -m json.tool


The output will be like below: 
~~~

 % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3111    0  3111    0     0    232      0 --:--:--  0:00:13 --:--:--   664
{
    "error": null,
    "page": 1,
    "per_page": 6,
    "results": [
        {
            "content": {
                "content_type": "yum",
                "content_url": "/content/dist/rhel/server/7/7Server/$basearch/ansible/2.6/os",
                "gpg_url": "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release",
                "id": 9918,
                "label": "rhel-7-server-ansible-2.6-rpms",
                "name": "Red Hat Ansible Engine 2.6 RPMs for Red Hat Enterprise Linux 7 Server",
                "vendor": "Red Hat"
            },
            "enabled": false,
            "enabled_content_override": null,
            "enabled_override": "default",
            "override": "default",
            "overrides": [],
            "product": {
                "id": 446,
                "name": "Red Hat Ansible Engine"
            }
        },
        {
            "content": {
                "content_type": "kickstart",
                "content_url": "/content/dist/rhel/server/7/$releasever/$basearch/kickstart",
                "gpg_url": "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release",
                "id": 7469,
                "label": "rhel-7-server-kickstart",
                "name": "Red Hat Enterprise Linux 7 Server (Kickstart)",
                "vendor": "Red Hat"
            },
            "enabled": false,
            "enabled_content_override": false,
            "enabled_override": "0",
            "override": "0",
            "overrides": [
                {
                    "name": "enabled",
                    "value": false
                }
            ],
            "product": {
                "id": 387,
                "name": "Red Hat Enterprise Linux Server"
            }
        },
        {
            "content": {
                "content_type": "yum",
                "content_url": "/content/dist/rhel/server/7/$releasever/$basearch/os",
                "gpg_url": "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release",
                "id": 7468,
                "label": "rhel-7-server-rpms",
                "name": "Red Hat Enterprise Linux 7 Server (RPMs)",
                "vendor": "Red Hat"
            },
            "enabled": true,
            "enabled_content_override": null,
            "enabled_override": "default",
            "override": "default",
            "overrides": [],
            "product": {
                "id": 387,
                "name": "Red Hat Enterprise Linux Server"
            }
        },
        {
            "content": {
                "content_type": "yum",
                "content_url": "/content/dist/rhel/server/7/7Server/$basearch/sat-maintenance/6/os",
                "gpg_url": "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release",
                "id": 7578,
                "label": "rhel-7-server-satellite-maintenance-6-rpms",
                "name": "Red Hat Satellite Maintenance 6 (for RHEL 7 Server) (RPMs)",
                "vendor": "Red Hat"
            },
            "enabled": false,
            "enabled_content_override": null,
            "enabled_override": "default",
            "override": "default",
            "overrides": [],
            "product": {
                "id": 387,
                "name": "Red Hat Enterprise Linux Server"
            }
        },
        {
            "content": {
                "content_type": "yum",
                "content_url": "/content/dist/rhel/server/7/7Server/$basearch/sat-tools/6.5/os",
                "gpg_url": "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release",
                "id": 7741,
                "label": "rhel-7-server-satellite-tools-6.5-rpms",
                "name": "Red Hat Satellite Tools 6.5 (for RHEL 7 Server) (RPMs)",
                "vendor": "Red Hat"
            },
            "enabled": false,
            "enabled_content_override": null,
            "enabled_override": "default",
            "override": "default",
            "overrides": [],
            "product": {
                "id": 387,
                "name": "Red Hat Enterprise Linux Server"
            }
        },
        {
            "content": {
                "content_type": "yum",
                "content_url": "/content/dist/rhel/server/7/$releasever/$basearch/rhscl/1/os",
                "gpg_url": "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release",
                "id": 10429,
                "label": "rhel-server-rhscl-7-rpms",
                "name": "Red Hat Software Collections RPMs for Red Hat Enterprise Linux 7 Server",
                "vendor": "Red Hat"
            },
            "enabled": false,
            "enabled_content_override": null,
            "enabled_override": "default",
            "override": "default",
            "overrides": [],
            "product": {
                "id": 481,
                "name": "Red Hat Software Collections for RHEL Server"
            }
        }
    ],
    "search": null,
    "sort": {
        "by": null,
        "order": null
    },
    "subtotal": 6,
    "total": 6
}

~~~

In this output it is really difficult to identify if the repository is enabled or not. 

Version-Release number of selected component (if applicable):
Satellite 6.5 onwards. 

How reproducible:
As per the above command and the output. 

Actual results:
Output is difficult to understand unlike Satellite 5. 

Expected results:
Easily readable output.

Comment 10 Justin Sherrill 2021-04-05 16:39:23 UTC
I agree this is confusing, i believe you could calculate it by reading each result and asking:

if result['enabled_content_override'] == null
  result['enabled']
else
  result['enabled_content_override']
end

Comment 14 Ian Ballou 2022-06-01 19:00:20 UTC
Created redmine issue https://projects.theforeman.org/issues/35000 from this bug

Comment 15 Bryan Kearney 2022-06-01 20:02:03 UTC
Upstream bug assigned to iballou

Comment 16 Bryan Kearney 2022-06-10 16:02:01 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/35000 has been resolved.

Comment 20 Silas Pusateri 2022-10-07 14:39:05 UTC
Verified
Version tested: 6.12.0 snap 13

API returns easily readable results:
"results": [
        {
            "backend_identifier": "716918e0-a887-46d1-9850-1a08fe0ab02a",
            "relative_path": "Default_Organization/Library/content/dist/rhel8/8/x86_64/appstream/os",
            "container_repository_name": null,
            "full_path": "https://dhcp-3-86.vms.sat.rdu2.redhat.com/pulp/content/Default_Organization/Library/content/dist/rhel8/8/x86_64/appstream/os/",
            "library_instance_id": null,
            "version_href": "/pulp/api/v3/repositories/rpm/rpm/7a77b38e-ccb9-4200-88f3-00b7526aae0f/versions/0/",
            "remote_href": "/pulp/api/v3/remotes/rpm/rpm/188a276f-ff81-41de-9a80-bd071bfc95ae/",
            "publication_href": "/pulp/api/v3/publications/rpm/rpm/3e773948-146e-4770-86ec-0f5fae9c267f/",
            "content_counts": {
                "rpm": 0,
                "erratum": 0,
                "package_group": 0,
                "srpm": 0,
                "module_stream": 0
            },
            "mirroring_policy": "mirror_complete",
            "id": 4,
            "name": "Red Hat Enterprise Linux 8 for x86_64 - AppStream RPMs 8",
            "label": "Red_Hat_Enterprise_Linux_8_for_x86_64_-_AppStream_RPMs_8",
            "description": null,
            "content_view_versions": [],
            "last_sync": null,
            "content_view": {
                "id": 1,
                "name": "Default Organization View"
            },

Comment 25 errata-xmlrpc 2022-11-16 13:32:23 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: Satellite 6.12 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:8506


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