Bug 466195 - RHN API inconsistency and misnomers: listBaseChannels, listChildChannels, listSubscribedChildChannels
RHN API inconsistency and misnomers: listBaseChannels, listChildChannels, lis...
Product: Red Hat Satellite 5
Classification: Red Hat
Component: API (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Brad Buckingham
wes hayutin
Depends On:
Blocks: 456996
  Show dependency treegraph
Reported: 2008-10-08 21:08 EDT by Xixi
Modified: 2009-09-10 15:53 EDT (History)
3 users (show)

See Also:
Fixed In Version: sat530
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-09-10 15:53:37 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Xixi 2008-10-08 21:08:50 EDT
Description of problem:

The names of the following methods are misleading:


These two actually lists *subscribable* channels not *subscribed* channels which is contrary to the impression of their names.

They should be changed to 


2. There is the method system.listSubscribedChildChannels but no system.listSubscribedBaseChannels - this seems an oversight.

Workaround is to use channel.software.listSystemChannels

Version-Release number of selected component (if applicable):
Sat 5.1.1 and possibly earlier

How reproducible:

Steps to Reproduce:
1. See above or just go to API docs on Satellite.
Actual results:
See above.

Expected results:

Additional info:
Comment 1 Xixi 2008-10-08 21:12:44 EDT
(In reply to comment #0)
Sorry for the typo, 

> They should be changed to 
> system.listSubscribableBaseChannels
> system.listSubscribableBaseChannels

should be

> They should be changed to 
> system.listSubscribableBaseChannels
> system.listSubscribableChildChannels
Comment 2 Brandon Perkins 2008-10-09 19:08:16 EDT
Ideally we should probably split this bug up.  And also we have to deal with deprecation of we are changing functionality.  We may just need to change the docs and leave the bad names (and deprecate them).
Comment 3 Brad Buckingham 2009-03-03 15:50:45 EST
git commit: 8ca9e3b4c48c328d226c56ec748bd0a52649c9fa

deprecated: (APIs still exist, but docs define as deprecated)
- system.listBaseChannels
- system.listChildChannels

new: (code basically moved from the deprecated methods above)
- system.listSubscribableBaseChannels
- system.listSubscribableChildChannels

- channel.software.listSystemChannels - left alone for now
- for getting the current subscribed channels the following APIs currently exist;
  therefore, no changes made at this time:
  - system.getSubscribedBaseChannel
  - system.listSubscribedChildChannels
Comment 4 wes hayutin 2009-03-23 16:25:17 EDT
logged in (admin/dog8code), token: '1160xeef166b32f0da4e208c553af11d81ce6'
Processing method: activationkey.create
activation key: key=1-69a7cb93e8f0c3e92018404a1be44079, created
Processing method: registration.new_system
System Registered 1000010179  - api-test6nhP7FSNKJVC3
Reading package profile: /rhel-i386-as-5.json
[{summary=Red Hat Enterprise Linux Virtualization Environment (v. 5 for 32-bit x86 Server), arch_name=IA-32, id=122, end_of_life=, gpg_key_fp=, description=Red Hat Enterprise Linux - Server virtualization environment (v. 5 for 32-bit x86), name=RHEL Virtualization (v. 5 for 32-bit x86), parent_channel_label=rhel-i386-server-5, label=rhel-i386-server-vt-5, gpg_key_url=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release, gpg_key_id=}]
Removing system with sid - 1000010179

List<Map> list = (List<Map>) client.execute("system.list_subscribable_base_channels", securityToken, getSampleSystemId());
	    assertTrue(list.size() > 0);
	    for (Map map : list) {
	    	assertTrue(map.get("id") instanceof Integer);
	    	assertTrue(map.get("name") instanceof String);
	    	assertTrue(map.get("label") instanceof String);
	    	assertTrue( (Integer) map.get("current_base") == 0 || (Integer) map.get("current_base") == 1);

Comment 5 Miroslav Suchý 2009-08-13 08:06:16 EDT
verified in stage.

from web page:
Deprecated as of version - being replaced by listSubscribableBaseChannels(string sessionKey, int serverId) 
Deprecated as of version - being replaced by listSubscribableChildChannels(string sessionKey, int serverId) 

using script:
[root@xen5 ~]# cat api.pl
use Frontier::Client;
use Data::Dumper;

my $HOST = 'test1182.test.redhat.com';
my $user = 'msuchy';
my $pass = 'XXX';

my $client = new Frontier::Client(url => "http://$HOST/rpc/api");
my $session = $client->call('auth.login',$user, $pass);

my $systems = $client->call('system.listSubscribableBaseChannels', $session, 1000013340);
print Dumper($systems),"\n";
my $systems = $client->call('system.listSubscribableChildChannels', $session, 1000013340);
print Dumper($systems),"\n";

$client->call('auth.logout', $session);

I got:
[root@xen5 ~]# perl api.pl
$VAR1 = [
            'current_base' => '1',
            'name' => 'Red Hat Enterprise Linux (v. 5 for 32-bit x86)',
            'id' => '165',
.... snip ....

$VAR1 = [
            'has_license' => '',
            'gpg_key_url' => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release',
            'summary' => 'Red Hat Enterprise Linux Clustering Option (v. 5 for 32-bit x86 Server)',
            'name' => 'RHEL Clustering (v. 5 for 32-bit x86)',
.... snip ....
Comment 6 Brandon Perkins 2009-09-10 15:53:37 EDT
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.


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