Project

General

Profile

Feature #35000

API should return simple results to understand if the repositories for hosts are enabled or not.

Added by Ian Ballou 10 months ago. Updated 10 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Hosts
Target version:
Difficulty:
Triaged:
Yes
Bugzilla link:
Fixed in Releases:
Found in Releases:
Red Hat JIRA:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1830968

Description of problem:
  1. curl -k -u admin:password https://myforeman.org/api/hosts/4/subscriptions/product_content | python -m json.tool

The output will be like below:
~~~ {
"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
}

% 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

~~~

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

Version-Release number of selected component (if applicable):
All versions

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.


Related issues

Related to Katello - Feature #35141: Hammer support for /hosts/:id/subscriptions/enabled_repositoriesClosed

Associated revisions

Revision 8f791e11 (diff)
Added by Ian Ballou 10 months ago

Fixes #35000 - API endpoint to return host's enabled repositories (#10146)

  • Fixes #35000 - API endpoint to return host's enabled repositories
  • Refs #35000 - remove repository content enabled_for_host param

History

#1 Updated by Ian Ballou 10 months ago

  • Target version set to Katello 4.6.0
  • Priority changed from High to Normal
  • Assignee set to Ian Ballou
  • Subject changed from API should return simple results to understand if the repositories for hosts are enabled or not. to API should return simple results to understand if the repositories for hosts are enabled or not.

#2 Updated by The Foreman Bot 10 months ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/10146 added

#3 Updated by Samir Jha 10 months ago

  • Triaged changed from No to Yes

#4 Updated by The Foreman Bot 10 months ago

  • Fixed in Releases Katello 4.5.1 added

#5 Updated by Anonymous 10 months ago

  • Status changed from Ready For Testing to Closed

#6 Updated by Ian Ballou 9 months ago

  • Related to Feature #35141: Hammer support for /hosts/:id/subscriptions/enabled_repositories added

Also available in: Atom PDF