Bug 1276549 - [RFE] Need candlepin API to get productid list for a specific sku.
[RFE] Need candlepin API to get productid list for a specific sku.
Product: Candlepin
Classification: Community
Component: candlepin (Show other bugs)
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: candlepin-bugs
Katello QA List
Depends On:
  Show dependency treegraph
Reported: 2015-10-30 01:57 EDT by Liu Song
Modified: 2016-09-08 15:42 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-09-08 15:42:22 EDT
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 Liu Song 2015-10-30 01:57:40 EDT
Description of problem:
Need candlepin API to get productid list for a specific sku.

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

How reproducible:

Steps to Reproduce:
I need a candlepin API to get productid list from both Stage and Prod candlepin. 

My test needs to validate "EngProductId(s)" consistency between STAGE and
PROD. While in STAGE, I can create account and add subscription pool to my created account by requirement. After that I can register/subscribe and use
the certificate in client-side to access proper product in STAGE.

However in PROD, we don't have the permission to create such account or add
subscription pools, so can't get the "EngProductId(s)" as STAGE. Then I found there is direct REST API http://jenkins-sse.devlab.redhat.com/rest-apidoc/productv3/ to get such product list from server-side, but for some issues described in https://bugzilla.redhat.com/show_bug.cgi?id=1242783, maybe the Java Edge is not the right interface on the server side for the test.

I don't see a direct API in Candlepin that exposes the product list, it will be great if we can have one.

Actual results:

Expected results:

Additional info:
Comment 1 Filip Nguyen 2015-11-16 04:55:25 EST
Liu, I want to confirm what you expect here and why.

RH2264664 product is 'Red Hat Enterprise Linux Developer Support, Enterprise'. This marketing product provides many engineering products e.g.: 
 - 293 Red Hat Container Development Kit
 - 86 Red Hat Enterprise Linux Load Balancer (for RHEL Server) - Extended Update Support

So for example is this [1] correct list that you expect to get in Stage for RH2264664?

Second question. You said you want to validate consistency. Can you explain a bit more how do you plan to use this new API for validating the consistency? My guess is that you are going to use our API to run against PROD  and STAGE  and compare the returned lists? Or are you going to run our API and then compare what is in certificate after consumption? These two tests seem to achieve different goals to me, so I just want to understand the idea behind all this.

Comment 2 Liu Song 2015-11-17 21:52:12 EST
Hi Filip,

The first question:
Yes, it is a correct list what I expect.

The second question:
From my side, it seems it returns the same results use the two tests. Is it correct? Or the two tests are totally not same, and returns entirely different lists?

BTW, if I use the second test -- run your API and then compare what is in certificate after consumption, is it possible for a common sku in PROD since there is no such test account for most of the skus in PROD?

Actually, what I am expecting is list from PROD, STAGE and certificate are all the same.  

Comment 3 Filip Nguyen 2015-11-18 01:58:38 EST
You are correct that the two tests (1) compare PROD and STAGE through API (2) compare PROD API and certs, should probably have the same results.

The thing to understand here is that STAGE and PROD do not share the same database. I don't know what are the goals of SKU STAGE testing so you must check with Dan Lah if this is what you want to verify. 

With regards to getting this RFE implemented. How important is this for you? When do you need to use this?
Comment 4 Liu Song 2015-11-18 02:24:46 EST
Hi Filip,

SKU 'Eng ID(s)' validation goal:

Goal 1:
1. Run API to get 'Eng ID(s)' from STAGE.
2. Run API to get 'Eng ID(s)' from PROD.
3. Validate the two lists are the same.

Goal 2:
1. Run API to get 'Eng ID(s)' from STAGE/PROD.
2. Get certificate after consumption.
3. Validate the two lists are the same.

Do I need to confirm with Dan Lah?

Due to the issue in https://bugzilla.redhat.com/show_bug.cgi?id=1242783, I can't achieve my goals through REST api, I really hoping this RFE API implemented soon. 

Comment 5 Kevin Howell 2016-09-08 15:42:22 EDT
Product information is scoped by organization. Existing APIs should be used to get pool information and then inspect product information on that pool.

Please look at /owners/{owner_key}/pools and /owners/{owner_key}/products. Those should be sufficient to get the SKU to products mapping. Please reach out to rhsm testing team (jmolet, jsefler, etc). if you need help.

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