Red Hat Bugzilla – Bug 1256717
Cannot list non-custom products and repositories from the API
Last modified: 2016-12-02 04:56:56 EST
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):
Steps to Reproduce:
1. Install Satellite
2. Add subscriptions
3. Create some custom products
4. Attempt to list or search products from the API
Only custom products are returned in search results.
All products should return in search results.
This prevents scripts from discovering non-custom products and repositories in order to link them to content views for example.
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)
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).
Moving 6.2 bugs out to sat-backlog.
I verified that it works as expected on 6.2.5 with queries like this
# lists all products
# list redhat only
curl https://admin:firstname.lastname@example.org/katello/api/v2/products\?organization_id\=1\&search\='not custom'
# list custom only
Barak it would be great if you could verify, please let us know if you still experience any issues in 6.2.