Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1230873

Summary: GET /katello/api/organizations/:id returns an incomplete set of attributes
Product: Red Hat Satellite Reporter: jaudet
Component: APIAssignee: Eric Helms <ehelms>
Status: CLOSED DUPLICATE QA Contact: Jitendra Yejare <jyejare>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.1.0CC: bkearney, mmccune
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/12445
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-02 20:07:00 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Output of foreman-debug from a Satellite 6.1 system on RHEL 6.6. none

Description jaudet 2015-06-11 16:35:02 UTC
Created attachment 1037777 [details]
Output of foreman-debug from a Satellite 6.1 system on RHEL 6.6.

Description of problem:
An organization can be associated with zero or more realms. Unfortunately, the API does not provide information about this organization → realm relationship.

Version-Release number of selected component (if applicable):
Tested against Satellite 6.1.0 GA 8. Foreman-debug is attached.

How reproducible:
100%

Steps to Reproduce:
1. Create an organization and associate it with a realm.
2. Get information about the organization with an HTTP GET request to /katello/api/v2/organizations/:id
3. Inspect the returned JSON payload. No mention of associated realms is made.

Actual results:

    >>> from nailgun import entities
    >>> org = entities.Organization().create(create_missing=True)
    >>> org_attrs = org.read_json()
    >>> org_attrs.keys()
    [
        u'compute_resources',
        u'config_templates',
        u'created_at',
        u'default_content_view_id',
        u'default_info',
        u'description',
        u'domains',
        u'environments',
        u'hostgroups',
        u'id',
        u'label',
        u'library_id',
        u'locations',
        u'media',
        u'name',
        u'owner_details',
        u'parameters',
        u'redhat_docker_registry_url',
        u'redhat_repository_url',
        u'select_all_types',
        u'service_level',
        u'service_levels',
        u'smart_proxies',
        u'subnets',
        u'title',
        u'updated_at',
        u'users',
    ]

Expected results:
Information about realms is included.

Additional info:
n/a

Comment 1 RHEL Program Management 2015-06-11 16:52:56 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 3 Mike McCune 2015-06-12 16:50:19 UTC
This API should optimally be removed as we believe nothing is using it currently.

Going to propose we remove this API entirely in a future release instead of fixing this specific issue.

Comment 4 jaudet 2015-06-17 16:56:25 UTC
Gah. Please don't remove `/katello/api/v2/organizations/:id`. Sure, *satellite* may not be using this API path. But the point of an API is to make sure that customers you don't even know about can fiddle with Satellite. Removing this path would really make life worse for API users.

Comment 5 jaudet 2015-06-17 16:57:58 UTC
I've changed the title for this bug to reflect what GET /katello/api/organizations/:id actually returns. "realm" isn't the only missing attribute:

    >>> org = entities.Organization(id=436)
    >>> expected = set(org.get_fields().keys())
    >>> actual = set(org.read_json().keys())
    >>> expected - actual
    set([
        'compute_resource',
        'config_template',
        'domain',
        'environment',
        'hostgroup',
        'realm',
        'smart_proxy',
        'subnet',
        'user',
    ])

Comment 6 Ondřej Pražák 2015-11-11 14:31:07 UTC
Created redmine issue http://projects.theforeman.org/issues/12445 from this bug

Comment 7 Bryan Kearney 2015-12-02 20:07:00 UTC
Closing as a dupe per notes upstream.

*** This bug has been marked as a duplicate of bug 1216234 ***