Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 851331 - REST: /api/providers/{id} returns unusable organization_id
Summary: REST: /api/providers/{id} returns unusable organization_id
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: API
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: Marek Hulan
QA Contact: Og Maciel
URL:
Whiteboard:
: 851332 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-08-23 20:09 UTC by Brad P. Crochet
Modified: 2019-09-26 15:52 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-09-19 18:10:25 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Brad P. Crochet 2012-08-23 20:09:25 UTC
Description of problem:
/api/providers/{id} returns:

{"created_at":"2012-08-23T19:53:38Z","organization_id":1,"updated_at":"2012-08-23T19:53:38Z","sync_state":"not_synced","last_sync":null,"task_status_id":null,"description":"My Provider Description","name":"My Provider5","provider_type":"Custom","repository_url":null,"id":160}

I cannot then take "organization_id" and pass it to:

/api/organizations/{organization_id}

/api/organizations requites the Candlepin key for the owner, not the numerical key.

The return should allow me to use the org id directly. Currently, one would need to get back a list of all organizations, then iterate over this list to find the right one.

Version-Release number of selected component (if applicable):
katello-1.0.4-1.el6.noarch

How reproducible:
Always

Steps to Reproduce:
1. curl -k https://localhost/katello/api/providers/1
2. Get back json, use organization_id directly in 
3. curl -k https://localhost/katello/api/organizations/{organization_id}
  
Actual results:
organization_id contains directly unusable id

Expected results:
organization_id contains directly usable id

Comment 1 Brad P. Crochet 2012-08-23 20:19:49 UTC
*** Bug 851332 has been marked as a duplicate of this bug. ***

Comment 2 Marek Hulan 2012-12-20 12:28:25 UTC
/api/organizations/{org_id} requires organization label as $org_id in order to find correct record however changing provider organization_id json attribute does not seem right to me. Wouldn't be it better to add extra json attribute called organization_label that you could use for this purpose? The reason is that we should not call label by name "id", this could bring a lot of confusion later.

Comment 3 Brad P. Crochet 2013-02-05 13:34:41 UTC
Adding an organization_label would be a reasonable addition. As long as it would then be directly usable against candlepin, aka the cpkey.

Comment 5 Mike McCune 2013-09-19 18:10:25 UTC
These bugs have been resolved in upstream projects for a period of months so I'm mass-closing them as CLOSED:UPSTREAM.  If this is a mistake feel free to re-open.


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