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 736716 - Api for listing products returns two ids per product
Summary: Api for listing products returns two ids per product
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: API
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: Unspecified
Assignee: Tomas Strachota
QA Contact: Garik Khachikyan
URL:
Whiteboard:
Depends On:
Blocks: katello-blockers
TreeView+ depends on / blocked
 
Reported: 2011-09-08 13:47 UTC by Tomas Strachota
Modified: 2019-09-25 21:06 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-08-22 17:56:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Tomas Strachota 2011-09-08 13:47:22 UTC
Description of problem:

Api for listing products returns two ids per product. One of them is Active Record id, the second one is candlepin product id.

curl -H Content-Type: application/json -H Accept: application/json -#  -k -u admin:admin http://localhost:3000/api/organizations/ACME_Corporation/products

[
  {
    "last_sync": "2011-09-07T10:21:56+02:00",
    "name": "prod_a1",
    "created_at": "2011-09-07T08:21:28Z",
    "productContent": [

    ],
    "provider_id": 7,
    "multiplier": 1,
    "attributes": [

    ],
    "multiplier": 1,
    "updated_at": "2011-09-07T08:21:28Z",
    "sync_plan_id": 25,
    "id": 14,
    "provider_name": "prov_a1",
    "description": null,
    "sync_state": "not_synced",
    "id": "1315383688377"
  }
]


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


How reproducible:
always

Steps to Reproduce:
1. clean katello
2. add a product
3. list products in an organization via api
  
Actual results:
Returned json contains candlepin and activerecord id, both under key "id".

Expected results:
There should be only the candlepin product id.


Additional info:

Comment 1 Tomas Strachota 2011-09-12 10:16:06 UTC
Fixed, added :exclude constraint in Product#serializable_hash

commit 7eee0f4cbe040295d2e98ad6e29f34df2b2b2f93
Author: Tomas Strachota <tstrachota>
Date:   Mon Sep 12 12:10:51 2011 +0200

    736716 - product api was returning 2 ids per product

Comment 2 Garik Khachikyan 2011-09-23 13:32:40 UTC
# VERIFIED

fixed. now there is one id (candlepin_id) is returning back:

---
[
  {
    "name": "bz1",
    "created_at": "2011-09-23T12:38:33Z",
    "productContent": [

    ],
    "provider_id": 13,
    "attributes": [

    ],
    "updated_at": "2011-09-23T12:38:33Z",
    "multiplier": 1,
    "sync_state": "finished",
    "sync_plan_id": 25,
    "id": "1316781513084",
    "provider_name": "bz1",
    "last_sync": "2011-09-23T08:42:38-04:00",
    "description": null
  }
]
---

Checked against: katello-0.1.83-1.git.48.02111ba.fc15.noarch


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