Bug 250664

Summary: RHN api for software channels inconsistent
Product: Red Hat Satellite 5 Reporter: Robin Norwood <robin.norwood>
Component: APIAssignee: Justin Sherrill <jsherril>
Status: CLOSED CURRENTRELEASE QA Contact: Brandon Perkins <bperkins>
Severity: medium Docs Contact:
Priority: medium    
Version: 510   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
URL: https://rhn.redhat.com/rhn/apidoc/
Whiteboard:
Fixed In Version: sat510 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-04-02 20:58:34 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: 248642    

Description Robin Norwood 2007-08-02 19:30:51 UTC
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 19:39:16 UTC
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 16:52:56 UTC
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 05:11:52 UTC
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 18:29:29 UTC
fixed in rev 135355 and 135356.

Changed the way we select methods to call.

Comment 6 Brandon Perkins 2008-01-14 07:09:36 UTC
Verified.

Comment 7 Preethi Thomas 2008-03-20 14:02:16 UTC
release pending

Comment 8 Brandon Perkins 2008-04-02 20:58:34 UTC
API call Enhancements for 5.1 Sat GA so Closed for Current Release.