Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 472346 - Bump up API version and make the versioning independent on web.version
Summary: Bump up API version and make the versioning independent on web.version
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: API
Version: 0.4
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Miroslav Suchý
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: space04
TreeView+ depends on / blocked
 
Reported: 2008-11-20 10:20 UTC by Miroslav Suchý
Modified: 2009-01-22 16:30 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-01-22 16:30:43 UTC


Attachments (Terms of Use)

Description Miroslav Suchý 2008-11-20 10:20:22 UTC
Description of problem:
>> According the code the the returned version is content of web.version
>> >> /etc/rhn/default/rhn_web.conf
>> >> I see as best option to create new config option web.apiversion which we
>> >> bump up independently on spacewalk version. And ideally return it back to
>> >> 5.2 at least and act as API version 0.x  never exist.
>> >> Yes maybe we can bump it to 100 or 10 to clearly state that it has nothing
>> >> to do with spacewalk versioning.
>> >>
> >
> > +1

I'm ok with this, seems like using the web_version has caused some problems with
some scripts.

So to summarize what should happen,

1) add web.apiversion to /etc/rhn/default/rhn_web.conf
2) set the initial value to be 5.2
3) change api.get_version() to to return the value of web.apiversion.
At current it returns web.version + " Java"
http://tinyurl.com/5c2egq
4) api.get_system_version() should continue to return the value of web.version.
5) if you are relying on the value of api.get_system_version() please
switch the appropriate api.get_version() method.

Mirek, feel free to make the above changes as part of your proxy changes.

jesus

Comment 1 Miroslav Suchý 2008-11-20 11:08:39 UTC
Commited as 4d7d115fbec1410251baae92ea51714c08f4d721.
Tagged and built:
spacewalk-java-0.4.2-1
spacewalk-web-0.4.2-1

Comment 2 Jan Pazdziora 2009-01-15 10:10:00 UTC
# grep version /etc/rhn/default/rhn_web.conf
# the version of this RHN install as a whole
web.version = 0.4
# the version of API
web.apiversion = 10.0

# perl get-api-version.pl
Gimme password for [admin] on [dhcp77-206.rhndev.redhat.com]: <password>
$VAR1 = [
          '10.0'
        ];
$VAR1 = [
          '0.4'
        ];
# cat get-api-version.pl 
#!/usr/bin/perl

use strict;
use warnings FATAL => 'all';

use Frontier::Client ();
use Data::Dumper;

my $idle_time;
my ($host, $username) = ( '<hostname>', 'admin' );
$| = 1;
print "Gimme password for [$username] on [$host]: ";
my $passwd = <STDIN>;
chomp $passwd;

my $client = new Frontier::Client(url => "http://$host/rpc/api");
my $session = $client->call('auth.login', $username, $passwd)
	or die "Failed to login to [$host]\n";

my @data = $client->call('api.get-version');
print Dumper \@data;

@data = $client->call('api.system-version');
print Dumper \@data;

# 

I had to add RewriteRule ^/rpc/api /rhn/rpc/api [P] to /etc/httpd/conf.d/zz-spacewalk-server.conf for the API calls to work but once it works, it does what this bugzilla wanted it to do.


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