Appendix B.RHN API AccessIn an effort to provide customers with added flexibility, RHN makes an application pro-gramming interface (API) available. This interface can be found by clicking Help at thetop-right corner of the RHN website, then clicking API in the left navigation bar. Or youmay go directly to: https://rhn.redhat.com/rpc/api/. Use this URL for your XMLRPC serverand your browser.WarningThis API should be considered experimental and used strictly for evaluation by advancedusers. Red Hat strongly discourages you from using this interface to alter productionsystems, unless you are sure your changes will not result in errors.The RHN API is based upon XML-RPC, which allows distinct pieces of software on dis-parate systems to make remote procedure calls using XML over HTTP. For this reason,any calls you make are expected to meet the constraints of XML-RPC. You can find outmore at http://www.xmlrpc.com/.Because documentation for each class and method is available via the RHN API interface,this section bypasses a list of classes and methods in favor of tips for using the API effi-ciently. These include steps for determining required values and a sample script that makessome of the calls.B.1. Using the auth Class and Getting the SessionIt is worth noting that you will almost invariably use the auth class first. This class offersa single method, login. Use this to establish an RHN session. It requires values for threeparameters: username, password, and duration. The first two come directly from your RHNaccount, while the third is the length of time the session should last in seconds, typically1200. It returns a session string than can be used in all other methods.B.2. Obtaining the system_idMany of the methods require a value for the system_id parameter. This is the uniquealphanumeric value assigned to each system when registered to RHN. It can be foundwithin the /etc/sysconfig/rhn/systemid file on each machine. In addition, you mayuse the download_system_id method within the system class to obtain the value.