Bug 1257588 - [RFE] API routes for repositories in consistent with filter on per product and per organization
[RFE] API routes for repositories in consistent with filter on per product an...
Status: NEW
Product: Red Hat Satellite 6
Classification: Red Hat
Component: API (Show other bugs)
6.1.0
Unspecified Unspecified
medium Severity medium (vote)
: Unspecified
: --
Assigned To: satellite6-bugs
Katello QA List
: FutureFeature, Triaged
Depends On:
Blocks: 260381 1122832
  Show dependency treegraph
 
Reported: 2015-08-27 08:12 EDT by Peter Vreman
Modified: 2017-04-04 02:09 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Peter Vreman 2015-08-27 08:12:56 EDT
Description of problem:
The API routes for repositories are inconsistent there is no URL path to filter per organization and per product.

See below the difference in routes for repositories, content_views and products:
- The repositories does not have a /organizations/ route
- The repositories does not have a /products/

  api :GET, "/repositories", N_("List of enabled repositories")
  api :GET, "/content_views/:id/repositories", N_("List of repositories for a content view")
  param :organization_id, :number, :required => true, :desc => N_("ID of an organization to show repositories in")
  param :product_id, :number, :desc => N_("ID of a product to show repositories of")


For example the content_views has a route with /organizations/

    api :GET, "/organizations/:organization_id/content_views", N_("List content views")
    api :GET, "/content_views", N_("List content views")
    param :organization_id, :number, :desc => N_("organization identifier"), :required => true

And products has even more routes:

    api :GET, "/products", N_("List products")
    api :GET, "/subscriptions/:subscription_id/products", N_("List of subscription products in a subscription")
    api :GET, "/activation_keys/:activation_key_id/products", N_("List of subscription products in an activation key")
    api :GET, "/organizations/:organization_id/products", N_("List of products in an organization")
    param :organization_id, :number, :desc => N_("Filter products by organization"), :required => true


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


How reproducible:


Steps to Reproduce:
1. API Call "/organizations/:organization_id/repositories"
2. API Call "/products/:product_id/repositories"
3.

Actual results:
Error

Expected results:
Return list of repositories

Additional info:
Followup from BZ1127589 that did not address the inconsistency in the API
Comment 1 Bryan Kearney 2016-07-08 16:47:43 EDT
Per 6.3 planning, moving out non acked bugs to the backlog
Comment 3 Peter Vreman 2016-07-11 08:40:28 EDT
This is fixed in 6.2.0Beta2. The repositories controller contains already more routes:

[crash] root@li-lc-1578:/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.47/app# grep 'GET.*/repositories' controllers/katello/api/v2/repositories_controller.rb                                           api :GET, "/repositories", N_("List of enabled repositories")
    api :GET, "/content_views/:id/repositories", N_("List of repositories for a content view")
    api :GET, "/organizations/:organization_id/environments/:environment_id/repositories", _("List repositories in the environment")
    api :GET, "/products/:product_id/repositories", N_("List of repositories for a product")
    api :GET, "/environments/:environment_id/products/:product_id/repositories", N_("List of repositories belonging to a product in an environment")
    api :GET, "/repositories/repository_types", N_("Show the available repository types")
    api :GET, "/repositories/:id", N_("Show a repository")
    api :GET, "/repositories/:id/gpg_key_content", N_("Return the content of a repo gpg key, used directly by yum")
Comment 4 Peter Vreman 2016-08-08 09:55:59 EDT
Correction, this is not fully fixed in Sat6.2.0 GA.

It still requires https://github.com/Katello/katello/pull/5999

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