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.
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.
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
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>
fixed in rev 135355 and 135356. Changed the way we select methods to call.
Verified.
release pending
API call Enhancements for 5.1 Sat GA so Closed for Current Release.