Bug 1223494 - GET /katello/api/v2/systems/:id does not return 'organization_id' attribute
Summary: GET /katello/api/v2/systems/:id does not return 'organization_id' attribute
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: API
Version: Nightly
Hardware: Unspecified
OS: Unspecified
unspecified
medium vote
Target Milestone: Unspecified
Assignee: Justin Sherrill
QA Contact: Corey Welton
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-05-20 16:17 UTC by jaudet
Modified: 2019-09-25 20:50 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-27 08:51:35 UTC
Target Upstream Version:


Attachments (Terms of Use)
Output of foreman-debug from a Satellite 6.1 system on RHEL 6.6. (2.08 MB, application/x-xz)
2015-05-20 16:17 UTC, jaudet
no flags Details
Output of foreman-debug from a Foreman 1.9.0-develop system on RHEL 6.6. (395.02 KB, application/x-xz)
2015-05-20 16:18 UTC, jaudet
no flags Details


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:1500 normal SHIPPED_LIVE Red Hat Satellite 6.2 Base Libraries 2016-07-27 12:24:38 UTC

Description jaudet 2015-05-20 16:17:52 UTC
Created attachment 1027787 [details]
Output of foreman-debug from a Satellite 6.1 system on RHEL 6.6.

Description of problem:
An HTTP GET /katello/api/v2/systems/:id returns a hash of information about a system. The "organization_id" key is missing from this hash.

Version-Release number of selected component (if applicable):
Tested against Foreman 1.9.0-develop on RHEL 6.6 and 7.1, and Satellite 6.1.0 on RHEL 6.6. This bug manifests itself on the two foreman systems, but not the Satellite system.

How reproducible:
100%

Steps to Reproduce:
1. Issue an HTTP GET request to /katello/api/v2/systems/:id.
2. View the keys in the JSON response. Notice that 'organization_id' is missing.

Actual results:

    [
        u'activation_keys',
        u'autoheal',
        u'checkin_time',
        u'content_overrides',
        u'content_view',
        u'content_view_id',
        u'created',
        u'customInfo',
        u'description',
        u'distribution',
        u'entitlementStatus',
        u'environment',
        u'errata_counts',
        u'host',
        u'hostCollections',
        u'id',
        u'installedProducts',
        u'katello_agent_installed',
        u'katello_id',
        u'location',
        u'name',
        u'permissions',
        u'products',
        u'registered_by',
        u'release',
        u'release_ver',
        u'service_level',
        u'uuid',
    ]

Expected results:

Same as above, but with the 'organization_id' key.

Additional info:
The 'href' key is present in the response for downstream systems, but not upstream systems. The significance of this field is unknown.

Attached are foreman-debug logs for both Foreman 1.9.0-develop and Satellite 6.1.0 on RHEL 6.6.

Comment 1 jaudet 2015-05-20 16:18:23 UTC
Created attachment 1027788 [details]
Output of foreman-debug from a Foreman 1.9.0-develop system on RHEL 6.6.

Comment 2 jaudet 2015-05-20 16:22:25 UTC
Similar to these bugs:

* https://bugzilla.redhat.com/show_bug.cgi?id=1158620 (verified)
* https://bugzilla.redhat.com/show_bug.cgi?id=1202917 (new)

Comment 3 RHEL Program Management 2015-05-20 16:32:29 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 5 Justin Sherrill 2016-02-25 17:19:53 UTC
The /systems api is deprecated in favor of the /hosts api.  Satellite 6.2 embraces this in a big way by adding content and subscription attributes to the /hosts api which already includes org information.

Thus i will move this to MODIFIED to verify that /hosts returns organization attributes. The /systems api will not be updated to include it and may be removed very soon.

Comment 8 Tazim Kolhar 2016-04-03 11:19:57 UTC
VERIFIED:
# rpm -q foreman
foreman-1.11.0.9-1.el7sat.noarch


Steps:

# curl -k -H "Content-Type: application/json" -X GET -u 'admin:changeme' https://dell-pem610-01.rhts.eng.bos.redhat.com/katello/api/v2/systems/{
"total":1,
"subtotal":1,
"page":1,
"per_page":20,
"error":null,"search":null,
"sort":{"by":null,"order":null},
"results":[{"katello_id":1,"uuid":"4037cdc1-a682-46b6-8882-914bf74e04f9",
"name":"sgi-xe270-01.rhts.eng.bos.redhat.com",
"host_id":2,
"location":"None",
"content_view_id":2,
"distribution":"Red Hat Enterprise Linux Server 7.1",
"katello_agent_installed":false,
"registered_by":"Anonymous Admin",
"entitlementStatus":"valid",
"autoheal":true,
"release":null,
"checkin_time":null,
"created":"2016-04-01T12:56:43.956+0000",
"installedProducts":[{"productId":"69","productName":"Red Hat Enterprise Linux Server","version":"7.1","arch":"x86_64","status":"green","startDate":"2014-06-06T04:00:00.000+0000","endDate":"2022-01-01T04:59:59.000+0000"}],
"content_view":{"id":2,"name":"con_view","label":"con_view"},
"environment":{"library":true,"id":1,"name":"Library","label":"Library","description":null,
"organization":{"name":"Default Organization","label":"Default_Organization","id":1},"created_at":"2016-04-01 09:58:31 UTC","updated_at":"2016-04-01 09:58:31 UTC","prior":null,"successor":null,"counts":{"content_hosts":1,
"content_views":2,
"packages":10944,"puppet_modules":1,
"errata":{"security":442,"bugfix":1127,"enhancement":239,"total":1808},
"yum_repositories":4,"docker_repositories":0,"ostree_repositories":0,"products":4},"permissions":{"view_lifecycle_environments":true,
"edit_lifecycle_environments":true,
"destroy_lifecycle_environments":false,"promote_or_remove_content_views_to_environments":true}},
"activation_keys":[],"id":"4037cdc1-a682-46b6-8882-914bf74e04f9",
"errata_counts":{"security":0,"bugfix":0,"enhancement":0,"total":0}}]}


Organization id is displayed
"id":1

Comment 11 errata-xmlrpc 2016-07-27 08:51:35 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:1500


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