sat5-xmlrpc
This is a library that provides a client interface to the XML-RPC API exposed
by Red Hat's Satellite 5. The methods of the client match those of
the API namespaces. For example, the login method would be:
client.auth.login(username, password)
.
Any API method that has multiple signatures, e.g. one with a date parameter and one without a date parameter, are defined only once within the sat5-xmlrpc client. The signature with the fewest parameters is defined. The single method will handle all variations of the method. Simply pass the parameters in the order defined in the documentation.
Installing is simple:
$ npm install --save sat5-xmlrpc
Example
'use strict'; const ty = ;const SatClient = ;const client = host: 'rhn.example.com'; { let message = ''; try // Login and get a session key const key = clientauth; // Get the details for an errata release const details = clienterrata; message += detailssynopsis + '\n\n'; // Determine which systems are affected by the errata const affectedSystems = clienterrata; const affectedSysIds = affectedSystems; // Get the systems in a system group named "PROD" const prodSystems = clientsystemgroup; // List the "PROD" systems that are affected by the errata message += 'Affected systems:\n\n'; prodSystems; message += `\n`; console; // End the API session clientauth; catch e console; } ty;
Options
The SatClient
constructor requires an options parameter to be supplied. That
parameter has the following form:
host: 'fqdn.to.satellite.server' port: 80 // optional path: '/rpc/api' // optional secure: false // optional