Example #1
0
class SimpleOEClient(RestClient, OEInterface):
	def __init__(self, uri, username = None, password = None, certfile = None, keyfile = None, *args, **kw):			 
		super(SimpleOEClient, self).__init__(uri = uri, username = username, password = password, content_type = "text/plain", cache = False, certfile = certfile, keyfile = keyfile, *args, **kw)
		self.serializer = ResultSerializer()
		
	def orchestrate(self, xml, operation):
		with self.post("/%s"%(operation,), xml) as answer:
			return self.serializer.load(answer)
Example #2
0
	def __init__(self, name = "reqproc", *args, **kw):
		super(LegacyRPController, self).__init__(name = name, *args, **kw)

		repo = getattr(settings, "TEAGLE_REPO", "http://localhost:8080/repository/rest")
		self.logger.info("Using %s as Repo.", repo)
		oe = getattr(settings, "TEAGLE_OE", "http://localhost:8000/teagleoe")
		tgwurl = getattr(settings, "TGW_URL", "http://localhost:8000/teaglegw")
		#oe = TeagleOE(tgwurl)

		self.logger.info("Using %s as OE.", oe)
		self.__rp = TeagleRP(repo, oe)
		self.serializer = LegacyRPRequestSerializer()
		self.result_serializer = ResultSerializer()
Example #3
0
class LegacyRPController(AbstractController):
	def __init__(self, name = "reqproc", *args, **kw):
		super(LegacyRPController, self).__init__(name = name, *args, **kw)

		repo = getattr(settings, "TEAGLE_REPO", "http://localhost:8080/repository/rest")
		self.logger.info("Using %s as Repo.", repo)
		oe = getattr(settings, "TEAGLE_OE", "http://localhost:8000/teagleoe")
		tgwurl = getattr(settings, "TGW_URL", "http://localhost:8000/teaglegw")
		#oe = TeagleOE(tgwurl)

		self.logger.info("Using %s as OE.", oe)
		self.__rp = TeagleRP(repo, oe)
		self.serializer = LegacyRPRequestSerializer()
		self.result_serializer = ResultSerializer()
	
	def _handle_request(self, request, *args, **kw):
		rprequest = self.serializer.load(request)
		result = self.__rp.handle_request(rprequest.user, rprequest.vct,rprequest.operation)
		return self.result_serializer.serialize_result(result)
Example #4
0
	def __init__(self, uri, username = None, password = None, certfile = None, keyfile = None, *args, **kw):			 
		super(SimpleOEClient, self).__init__(uri = uri, username = username, password = password, content_type = "text/plain", cache = False, certfile = certfile, keyfile = keyfile, *args, **kw)
		self.serializer = ResultSerializer()