Exemplo n.º 1
0
 def POST(self, uuid, cls, method):
     reply = {}
     httpcode = 200
     try:
         body = self.body()
         options = Option(body.options)
         options = options.valid()
         request = Request(body.request)
         request = request.valid()
         replyto = ReplyTo(body.replyto)
         replyto = replyto.valid()
         any = body.any
         agent = AgentImpl(uuid, options)
         reply = agent.call(cls, method, request, replyto, any)
         if replyto:
             httpcode = 202 # accepted
     except EXCEPTIONS, raised:
         httpcode = status(raised)
         reply = Return.exception()
         reply = exdict(raised, reply)
Exemplo n.º 2
0
 def POST(self, uuid, cls, method):
     reply = {}
     httpcode = 200
     try:
         body = self.body()
         options = Option(body.options)
         options = options.valid()
         request = Request(body.request)
         request = request.valid()
         replyto = ReplyTo(body.replyto)
         replyto = replyto.valid()
         any = body.any
         agent = AgentImpl(uuid, options)
         reply = agent.call(cls, method, request, replyto, any)
         if replyto:
             httpcode = 202  # accepted
     except EXCEPTIONS, raised:
         httpcode = status(raised)
         reply = Return.exception()
         reply = exdict(raised, reply)
Exemplo n.º 3
0
 def GET(self):
     try:
         status = AgentImpl.status()
     except Exception, raised:
         log.exception('all')
         return (500, [str(raised)])
Exemplo n.º 4
0
 def GET(self, uuid):
     try:
         status = AgentImpl.status([uuid])
     except Exception, raised:
         log.exception(uuid)
         return (500, str(raised))
Exemplo n.º 5
0
 def GET(self):
     try:
         status = AgentImpl.status()
     except Exception, raised:
         log.exception('all')
         return (500, [str(raised)])
Exemplo n.º 6
0
 def GET(self, uuid):
     try:
         status = AgentImpl.status([uuid])
     except Exception, raised:
         log.exception(uuid)
         return (500, str(raised))