Bug 468320

Summary: A wrong key name in API documentation (satellite.listEntitlements).
Product: Red Hat Satellite 5 Reporter: Satoru SATOH <ssato>
Component: APIAssignee: Brad Buckingham <bbuckingham>
Status: CLOSED CURRENTRELEASE QA Contact: John Matthews <jmatthew>
Severity: medium Docs Contact:
Priority: high    
Version: 511CC: cperry, dparker
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: sat530 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-10 19:53:42 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 456996    

Description Satoru SATOH 2008-10-24 03:44:34 UTC
Description of problem:

There is a typo in "API Overview: satellite" web page (*1).

It says "Method: listEntitlements" returns a struct consist of array "system"
and array "channels". This does not look correct; should be s/channels/channel/.


 *1. https://SATELLITE_HOST/rhn/apidoc/satellite/SatelliteHandler.jsp


Version-Release number of selected component (if applicable):
satellite-5.1.1-28 (ISO image)


How reproducible: always


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Here is a sample ipython session to try accessing this api.

$ ipython
...
In [1]: import xmlrpclib

In [2]: server = xmlrpclib.ServerProxy('https://%s/rpc/api' % 'satellite-1')

In [3]: (user, pwd) = ('foo','xxxxxx')

In [4]: sid = server.auth.login(user, pwd)

In [5]: res = server.satellite.listEntitlements(sid)

In [6]: res.keys()
Out[6]: ['system', 'channel']       # ! 'channels'
...
In [16]: server.api.getVersion()
Out[16]: '5.1.1 Java'

In [18]: res.get('channel')[:3]     # ! 'channels'
Out[19]: 
[{'free_slots': 0,
  'label': 'private-channel-family-22',
  'name': 'private-group-1 (22) Channel Family',
  'total_slots': 0,
  'used_slots': 0},
...

Comment 1 Clifford Perry 2008-11-20 17:47:25 UTC
Sat 5.1.1 - good chance we have already addressed this within Spacewalk code. Assigning to review for Sat 5.3.0 cycles.

Comment 2 Brad Buckingham 2009-01-09 16:34:09 UTC
An issue still appears to exist in spacewalk as well.  Reference Spacewalk BZ 479440 for details.

Comment 3 Brad Buckingham 2009-01-09 16:38:27 UTC
Modifications made to Spacewalk 0.4. Refer to Spacewalk BZ 479440 for details.

Comment 4 John Matthews 2009-02-17 16:32:45 UTC
ISO:  Satellite-5.3.0-RHEL5-re20090213.1-i386-embedded-oracle.iso

python
>>> import xmlrpclib
>>> server = xmlrpclib.ServerProxy('https://testsat/rpc/api')
>>> sid = server.auth.login("user", "password")
>>> res = server.satellite.listEntitlements(sid)
>>> res.keys()
['system', 'channel']
>>> 



Method: listEntitlements
Description:
Lists all channel and system entitlements for the organization associated with the user executing the request.

Parameters:

    * string sessionKey

Returns:

    * struct - channel/system entitlements
          o array "system"
                + struct - system entitlement
                      # string "label"
                      # string "name"
                      # int "used_slots"
                      # int "free_slots"
                      # int "total_slots"
          o array "channel"
                + struct - channel entitlement
                      # string "label"
                      # string "name"
                      # int "used_slots"
                      # int "free_slots"
                      # int "total_slots"

Comment 5 Brandon Perkins 2009-09-10 19:53:42 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2009-1434.html