Bug 250664 - RHN api for software channels inconsistent
RHN api for software channels inconsistent
Status: CLOSED CURRENTRELEASE
Product: Red Hat Satellite 5
Classification: Red Hat
Component: API (Show other bugs)
510
All Linux
medium Severity medium
: ---
: ---
Assigned To: Justin Sherrill
Brandon Perkins
https://rhn.redhat.com/rhn/apidoc/
:
Depends On:
Blocks: 248642
  Show dependency treegraph
 
Reported: 2007-08-02 15:30 EDT by Robin Norwood
Modified: 2008-04-02 16:58 EDT (History)
0 users

See Also:
Fixed In Version: sat510
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-04-02 16:58:34 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Robin Norwood 2007-08-02 15:30:51 EDT
When referring to a software channel in the RHN API, some parts of the API
require that you use channel ID, and other parts require that you use a channel
label.  To make matters worse, there doesn't appear to be a way to 'convert'
between label and ID.  So various parts of the RHN API are impossible to use
together.

For instance:

https://rhn.redhat.com/rhn/apidoc/channel/software/ChannelSoftwareHandler.jsp#listSystemChannels

Refers to channel label.  While this page:

https://rhn.redhat.com/rhn/apidoc/system/SystemHandler.jsp#setChildChannels

Refers to channel id.

The channel details page:

https://rhn.redhat.com/rhn/apidoc/channel/software/ChannelSoftwareHandler.jsp#getDetails

takes a channel label to get channel details, but does not divulge the id.

There are various other problems with the RHN api - the names of the fields are
inconsistent, the coverage of of RHN features is poor, the documentation is
lacking (and currently gives a 404 in production).  However, this particular
issue has caused at least one developer to yell bad words at his monitor.
Comment 2 Máirín Duffy 2007-08-02 15:39:16 EDT
Justin, I'm moving this over to you because I know you've been working on the
API lately and I figured you'd know where it belonged or if it could make 5.1 at
this point.
Comment 3 Justin Sherrill 2007-08-17 12:52:56 EDT
For now, we've added getDetails(label) and getDetails(id) both of which return a
map containing the label and id.  Is this sufficient in both of your eyes?¿

- Justin
Comment 4 Brandon Perkins 2008-01-05 00:11:52 EST
Fails QA.  getDetails(label) works, but getDetails(id) does not appear to work.
 Pasting my test with debugging turned on to verify that its passing an int:

$ ./test_channel.software.get_details.id.pl --host rlx-3-14.rhndev.redhat.com
--user bdperkin --pass redhat --target 170
---- request ----
<?xml version="1.0"?>
<methodCall>
<methodName>auth.login</methodName>
<params>
<param><value><string>bdperkin</string></value></param>
<param><value><string>redhat</string></value></param>
</params>
</methodCall>
---- response ----
<?xml version="1.0"
encoding="UTF-8"?><methodResponse><params><param><value><string>8631x6f4233dc8b255cb7c2bf83cc7936b43f</string></value></param></params></methodResponse>----
request ----
<?xml version="1.0"?>
<methodCall>
<methodName>channel.software.get_details</methodName>
<params>
<param><value><string>8631x6f4233dc8b255cb7c2bf83cc7936b43f</string></value></param>
<param><value><i4>170</i4></value></param>
</params>
</methodCall>
---- response ----
Fault returned from XML RPC Server, fault code -1: redstone.xmlrpc.XmlRpcFault:
unhandled internal exception: User 1 does not have access to channel 170 or the
channel does not exist
<?xml version="1.0"
encoding="UTF-8"?><methodResponse><fault><value><struct><member><name>faultCode</name><value><int>-1</int></value></member><member><name>faultString</name><value><string>redstone.xmlrpc.XmlRpcFault:
unhandled internal exception: User 1 does not have access to channel 170 or the
channel does not
exist</string></value></member></struct></value></fault></methodResponse>


And yes, the channel does exist... if I do the label call of this same channel,
it returns the channel ID in the struct:

<member><name>id</name><value><i4>170</i4></value></member>

Comment 5 Justin Sherrill 2008-01-08 13:29:29 EST
fixed in rev 135355 and 135356.

Changed the way we select methods to call.
Comment 6 Brandon Perkins 2008-01-14 02:09:36 EST
Verified.
Comment 7 Preethi Thomas 2008-03-20 10:02:16 EDT
release pending
Comment 8 Brandon Perkins 2008-04-02 16:58:34 EDT
API call Enhancements for 5.1 Sat GA so Closed for Current Release.

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