OPSI.web2.xmlrpc module¶
A generic resource for publishing objects via XML-RPC.
API Stability: semi-stable
Maintainer: U{Itamar Shtull-Trauring<mailto:twisted@itamarst.org>}
-
class
OPSI.web2.xmlrpc.
XMLRPC
¶ Bases:
OPSI.web2.resource.Resource
A resource that implements XML-RPC.
You probably want to connect this to ‘/RPC2’.
Methods published can return XML-RPC serializable results, Faults, Binary, Boolean, DateTime, Deferreds, or Handler instances.
By default methods beginning with ‘xmlrpc_‘ are published.
Sub-handlers for prefixed methods (e.g., system.listMethods) can be added with putSubHandler. By default, prefixes are separated with a ‘.’. Override self.separator to change this.
-
FAILURE
= 8002¶
-
NOT_FOUND
= 8001¶
-
getFunction
(functionPath)¶ Given a string, return a function, or raise NoSuchFunction.
This returned function will be called, and should return the result of the call, a Deferred, or a Fault instance.
Override in subclasses if you want your own policy. The default policy is that given functionPath ‘foo’, return the method at self.xmlrpc_foo, i.e. getattr(self, “xmlrpc_” + functionPath). If functionPath contains self.separator, the sub-handler for the initial prefix is used to search for the remaining path.
-
getSubHandler
(prefix)¶
-
getSubHandlerPrefixes
()¶
-
http_POST
(request)¶
-
putSubHandler
(prefix, handler)¶
-
render
(request)¶
-
separator
= '.'¶
-
-
exception
OPSI.web2.xmlrpc.
NoSuchFunction
(faultCode, faultString, **extra)¶ Bases:
xmlrpclib.Fault
There is no function by the given name.
-
exception
OPSI.web2.xmlrpc.
Fault
(faultCode, faultString, **extra)¶ Bases:
xmlrpclib.Error
Indicates an XML-RPC fault package.