Bug 1256717 - Cannot list non-custom products and repositories from the API
Cannot list non-custom products and repositories from the API
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Content Management (Show other bugs)
Unspecified Unspecified
urgent Severity medium (vote)
: Unspecified
: --
Assigned To: satellite6-bugs
Katello QA List
: Triaged
Depends On:
Blocks: 1338516
  Show dependency treegraph
Reported: 2015-08-25 06:32 EDT by Barak Korren
Modified: 2016-12-02 04:56 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-12-02 04:56:56 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Barak Korren 2015-08-25 06:32:54 EDT
Description of problem:
Listing or searching for products in all the product APIs only shows custom products. This is despite the fact that non custom (RedHat) products show up in the UI when using the same account and organization used to access the API.
Also note that if querying the products API while specifying a product id details are returned for a non-custom product the same way they are returned for a custom product.
The above is also true for repositories.

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

How reproducible:

Steps to Reproduce:
1. Install Satellite
2. Add subscriptions
3. Create some custom products
4. Attempt to list or search products from the API

Actual results:
Only custom products are returned in search results.

Expected results:
All products should return in search results.

Additional info:
This prevents scripts from discovering non-custom products and repositories in order to link them to content views for example.
Comment 2 Brad Buckingham 2016-05-02 13:51:14 EDT
Hi Barak,

Can you confirm the APIs that you were using for the above scenario?

From some testing on Satellite 6.2 Beta, I see the following behavior; however, I want to make sure these are the same APIs you were using:

GET katello/api/v2/organizations/1/products - lists RH and custom products (PASS)

GET katello/api/v2/organizations/1/products?custom=true - lists only custom products (PASS)

GET katello/api/v2/organizations/1/products?custom=false - lists only custom products (FAIL)
Comment 3 Barak Korren 2016-05-04 04:03:52 EDT
Hi, This had been a while ago, and done via NailGun, but as far as I can gather, the API I mostly looked into was this:


(Lists only custom products on 6.1.7 which is what I have atm)

Note that this is typical to how NailGun works, it typically looks at the topmost URL for a given entity type, not the one nested inside other entities (It is hard to write a generic SDK otherwise, because you would need a lot of entity-specific nesting information).
Comment 4 Bryan Kearney 2016-07-26 11:25:24 EDT
Moving 6.2 bugs out to sat-backlog.
Comment 5 Bryan Kearney 2016-07-26 11:41:10 EDT
Moving 6.2 bugs out to sat-backlog.
Comment 9 Marek Hulan 2016-12-02 04:56:56 EST
I verified that it works as expected on 6.2.5 with queries like this

# lists all products
curl https://admin:changeme@sat.example.tst/katello/api/v2/products\?organization_id\=1

# list redhat only
curl https://admin:changeme@sat.example.tst/katello/api/v2/products\?organization_id\=1\&search\='not custom'

# list custom only
curl https://admin:changeme@sat.example.tst/katello/api/v2/products\?organization_id\=1\&search\='custom'

Barak it would be great if you could verify, please let us know if you still experience any issues in 6.2.

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