X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfacomponent%2Fplc%2Fapi.py;h=7d581b4118a46546e3c0ecc2dc85f2436e44f215;hb=3d7237fa0b5f2b4a60cb97c7fb3b6aecfd94558a;hp=8fa19d9579b80adaf239fbd1563433f21014eb24;hpb=a7750a535b81a5b9983957be45a6de87d1f076bf;p=sfa.git diff --git a/sfacomponent/plc/api.py b/sfacomponent/plc/api.py index 8fa19d95..7d581b41 100644 --- a/sfacomponent/plc/api.py +++ b/sfacomponent/plc/api.py @@ -1,5 +1,5 @@ # -# Geniwrapper XML-RPC and SOAP interfaces +# SFA XML-RPC and SOAP interfaces # ### $Id: api.py 15596 2009-10-31 21:42:05Z anil $ ### $URL: https://svn.planet-lab.org/svn/sfa/trunk/sfa/plc/api.py $ @@ -8,18 +8,7 @@ import sys import os import traceback -import string -import xmlrpclib - -from sfa.trust.auth import Auth -from sfa.util.config import * -from sfa.util.faults import * -from sfa.util.debug import * -from sfa.trust.rights import * -from sfa.trust.credential import * -from sfa.trust.certificate import * -from sfa.util.misc import * -from sfa.util.sfalogging import * +from xmlrpclib import ServerProxy from sfa.util.api import * @@ -30,11 +19,31 @@ class ComponentAPI(BaseAPI): peer_cert = None, interface = None, key_file = None, cert_file = None): BaseAPI.__init__(self, config=config, encoding=encoding, methods=methods, peer_cert=peer_cert, - interface, key_file, cert_file) + interface=interface, key_file=key_file, cert_file=cert_file) self.encoding = encoding # Better just be documenting the API if config is None: return + self.nodemanager = self.getNodeManagerShell() + + + + def getNodeManagerShell(self): + # do we need an auth ? + auth = {} + try: + nodemanager = xmlrpclib.ServerProxy('http://127.0.0.1:812') + except: + raise + + return nodemanager + + def sliver_exists(self): + sliver_dict = self.nodemanager.GetXIDs() + if slicename in sliver_dict.keys(): + return True + else: + return False