200
Appendix B. RHN API Access
B.3. Determining the sid
Several methods require a value for the
sid
, or server ID, parameter. Note that this is
different from the
system_id
. You may determine the
sid
of a machine in two different
ways. First, you can log into the RHN website, click the name of a system, and view
the
sid
at the end of the URL in the location bar. It follows the "=" symbol and is part
of a string that resembles the following: "index.pxt?sid=1003486534". Second, you may
use the
list_user_systems
method within the system class to obtain a list of systems
available to the user that contains the associated
sid
s.
B.4. Viewing the cid
Like servers, channels have their own IDs. This value, the
cid
, is a required parameter
for some methods, including
set_base_channel
and
set_child_channels
. Also like
the
sid
, the
cid
can be obtained through the RHN website. Just click on the name of a
channel and view the end of the URL. It follows the "=" symbol, as part of a string that
resembles the following: "details.pxt?cid=54".
B.5. Getting the sgid
System groups also have their own IDs. This value, the
sgid
, is a required parameter
for the
set_group_membership
method, for instance. Like the
sid
and
cid
, the
sgid
can be obtained through the RHN website. Just click on the name of a system group
and view the end of the URL. It follows the "=" symbol, as part of a string that resem-
bles the following: "details.pxt?sgid=334958". Note that the member parameter within the
set_group_membership
method requires only
yes
or
no
as input to make the associa-
tion.
B.6. Sample API Script
The following sample script depicts how to construct an RHN API client. Review the
comments and links for a full discussion of the calls made.
#!/usr/bin/perl -w
use 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:
#
#
#
Содержание NETWORK 4.0 -
Страница 1: ...Red Hat Network 4 0 Reference Guide...
Страница 10: ......
Страница 16: ...vi Introduction to the Guide...
Страница 24: ...8 Chapter 1 Red Hat Network Overview...
Страница 40: ...24 Chapter 2 Red Hat Update Agent Figure 2 11 Available Package Updates...
Страница 58: ...42 Chapter 2 Red Hat Update Agent...
Страница 80: ...64 Chapter 5 Red Hat Network Registration Client Figure 5 15 Text Mode Welcome Screen...
Страница 186: ...170 Chapter 7 Monitoring...
Страница 200: ...184 Chapter 8 UNIX Support Guide...
Страница 214: ...198 Appendix A Command Line Config Management Tools...
Страница 274: ...258 Appendix C Probes...
Страница 282: ...266 Glossary...