88 Appendix A. RHN API AccessA.4. Viewing the cidLike servers, channels have their own IDs. This value, the cid, is a required parameter for some meth-ods, including set_base_channel and set_child_channels. Also like the sid, the cid can be obtainedthrough the RHN website. Just click on the name of a channel and view the end of the URL, some-thing like, "details.pxt?cid=54".A.5. Getting the sgidSystem groups join servers and channels in having their own IDs. This value, the sgid, is a requiredparameter for the set_group_membership method, for instance. Like the sid and cid, the sgid canbe obtained through the RHN website. Just click on the name of a system group and view the endof the URL, something like, "details.pxt?sgid=334958". Note that the member parameter within theset_group_membership method requires only yes or no as input to make the association.A.6. Sample API ScriptThe following sample script depicts how an RHN API client should be constructed. Review the com-ments and links for a full discussion of the calls made.#!/usr/bin/perl -wuse strict;use Frontier::Client;use Data::Dumper;############################################################################# This is a sample script for use of the experimental RHN Management APIs. ## The API is currently available using XMLRPC only, which is described in ## depth at: ## ## http://www.xmlrpc.com/ ## ## We use the Frontier modules, available from: ## ## http://theoryx5.uwinnipeg.ca/mod_perl/cpan-search?dist=Frontier-RPC ## ########################################################################################################################################################## Defining an XMLRPC session. ############################################################################## Define the host first. This will be the FQDN of your satellite system.my $HOST = ’satellite.server.yourdomain.com’;# Now we create the client object that will be used throughout the session.my $client = new Frontier::Client(url => "http://$HOST/rpc/api");# Next, we execute a login call, which returns a session identifier that will# be passed in all subsequent calls. The syntax of this call is described at:## http://$HOST/rpc/api/auth/login/my $session = $client->call(’auth.login’, ’username’, ’password’);