2 # Geniwrapper XML-RPC and SOAP interfaces
4 ### $Id: api.py 15596 2009-10-31 21:42:05Z anil $
5 ### $URL: https://svn.planet-lab.org/svn/sfa/trunk/sfa/plc/api.py $
11 import xmlrpclib.ServerProxy
12 from sfa.util.api import *
15 class ComponentAPI(BaseAPI):
18 def __init__(self, config = "/etc/sfa/sfa_config", encoding = "utf-8", methods='sfacomponent.methods',
19 peer_cert = None, interface = None, key_file = None, cert_file = None):
21 BaseAPI.__init__(self, config=config, encoding=encoding, methods=methods, peer_cert=peer_cert,
22 interface, key_file, cert_file)
23 self.encoding = encoding
25 # Better just be documenting the API
29 self.nodemanager = self.getNodeManagerShell()
33 def getNodeManagerShell(self):
34 # do we need an auth ?
37 nodemanager = xmlrpclib.ServerProxy('http://127.0.0.1:812')
43 def sliver_exists(self):
44 sliver_dict = self.nodemanager.GetXIDs()
45 if slicename in sliver_dict.keys():