Bug 565450 - org.create API call not existing
org.create API call not existing
Status: CLOSED NOTABUG
Product: Red Hat Satellite 5
Classification: Red Hat
Component: API (Show other bugs)
530
All Linux
low Severity medium
: ---
: ---
Assigned To: Tomas Lestach
Red Hat Satellite QA List
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-02-15 06:27 EST by Jérôme Fenal
Modified: 2010-02-15 19:27 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-02-15 19:27:29 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Jérôme Fenal 2010-02-15 06:27:27 EST
Description of problem:

API call org.create is not implemented, or accessible.

Version-Release number of selected component (if applicable):

Satellite 5.3

How reproducible:

Always. 


Steps to Reproduce:
1. Try with the following script :

#!/usr/bin/perl
use strict;
use warnings;
use Frontier::Client;
use Data::Dumper;

my $HOST = 'sat.hash.fr';
my $user = 'rhn-admin';
my $pass = 'redhat';

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

print STDERR Dumper( \$session );

my $org = $client->call('org.create', $session, "test org", "test(admin", "redhat", "Mr.", "shadowman", "test", 'test@example.com',);

print Dumper( \$org );

2. Tailor it to your environment
3. Run
  
Actual results:

Fault returned from XML RPC Server, fault code -1: redstone.xmlrpc.XmlRpcFault: Could not find method create in class class com.redhat.rhn.frontend.xmlrpc.org.OrgHandler


Expected results:

No error message. Organisation created.

Additional info:
Comment 1 Jérôme Fenal 2010-02-15 19:27:29 EST
OK, found the bug, after searching Spacewalk code.
It turns out that we need to pass a boolean as last parameter. The script above can't work, as missing the last parameter. 
But in order to make it work, the code is still nasty :

my $org = $client->call(
    'org.create',
    $session,
    "testorg",
    "test-admin",
    "redhat",
    "Mr.",
    "shadowman",
    "test",
    'test@example.com',
    Frontier::RPC2::Boolean->new(0),  # here, the definition of a boolean :(
    );


So we can close the bug, but would need to open a RFE to get predefined booleans for API, and doc entry to point to those.

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