rPath Appliance Platform Agent:XML-RPC Python Client
From rPath Wiki
Use XML-RPC methods provided by rPath Appliance Platform Agent (rAPA) to develop a an XML-RPC client that uses the functions of the rAPA plugins.
If the XML-RPC client is written in Python, the code should import xmlrpclib and create an XML-RPC proxy object using the HTTP URL to the Appliance Platform XML-RPC:
https://admin:password@localhost:8003/xmlrpc/
Replace admin and password if necessary to match the Appliance administrator credentials on the appliance. If the client does not reside on the appliance, replace localhost as necessary.
The following code is used in the Python script examples provided in the rPath Appliance Platform development kit:
import xmlrpclib server = xmlrpclib.ServerProxy('http://admin:password@localhost:8003/xmlrpc/')
If using HTTPS, m2xmlrpclib from M2Crypto python module is also needed. Here is the same code, but using HTTPS:
import xmlrpclib from M2Crypto import m2xmlrpclib, SSL server = xmlrpclib.ServerProxy('https://admin:password@localhost:8003/xmlrpc/', transport = m2xmlrpclib.SSL_Transport())
The rest of the Python code can call the XML-RPC methods as necessary. For example, the following method corresponds to a function provided by the notifications plugin:
new_emails = ['email1@domain.com','email2@domain.com'] server.configure.Notify.notifySave(",".join(new_emails))
