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: ON_QA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hosts - Content
Version: 6.6.0
Hardware: Unspecified
OS: Unspecified
high
high vote
Target Milestone: 6.12.0
Assignee: Ian Ballou
QA Contact: Silas Pusateri
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-05-04 12:25 UTC by Vedashree Deshpande
Modified: 2022-09-23 00:26 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:
Target Upstream Version:


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

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.


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