Hello friends:

Could someone post a simple example of how to access the XMLRPC
interface using perl?  I'm able to do this just fine with Python but
would also like to be able to do it with Perl as well.  The example
given on this page uses a session token, which I'd like to avoid:

http://fedorahosted.org/cobbler/wiki/CobblerXmlrpc

<code>
#!/usr/bin/perl

use strict;
use XMLRPC::Lite;

# Build the connection
my $xmlrpc = XMLRPC::Lite -> proxy('https://x.x.x.x/cobbler_api_rw');

# Login to cobbler xmlrpm and get session token back.
my $token = $xmlrpc->login("cobbler-xmlrpc-user",
"cobbler-xmlrpc-pass")->result();

# Create new system object
my $object = $xmlrpc->new_system($token)->result();
$xmlrpc->modify_system($object, "name", "example", $token)->result();
$xmlrpc->modify_system($object, "profile", "F8-i386", $token)->result();

# Commit the system object
my $result = $xmlrpc->save_system($object, $token)->result();
</code>

Basically all I want to do is be able to pull distros, profiles,
systems, etc. into my Perl program. Forgive my ignorance on this
topic; my Python skills are a lot stronger, and I wasn't able to find
any documentation on using Perl with XMLRPC.

thanks

Sean
_______________________________________________
cobbler mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/cobbler

Reply via email to