예제 #1
0
    def post(self, poolName):
        if poolName in self.getDispatchTree().pools:
            raise HttpConflict("Pool already registered")
        else:
            tmpPool = Pool(None, poolName)
            self.getDispatchTree().pools[poolName] = tmpPool

            self.writeCallback(json.dumps(tmpPool.to_json()))
예제 #2
0
    def post(self, poolName):
        if poolName in self.getDispatchTree().pools:
            raise HttpConflict("Pool already registered")
        else:
            tmpPool = Pool(None, poolName)
            self.getDispatchTree().pools[poolName] = tmpPool

            self.writeCallback(json.dumps(tmpPool.to_json()))
예제 #3
0
 def post(self, poolName):
     if poolName in self.getDispatchTree().pools:
         return HttpConflict("Pool already registered")
     else:
         tmpPool = Pool(None, poolName)
         self.getDispatchTree().pools[poolName] = tmpPool
         if self.request.headers("Host") is not None:
             host = self.request.headers("Host")
         else:
             host = "%s:%d" % self.getServerAddress()
         self.set_header("Location", "http://%s/pools/%s/" % (host, poolName))
         self.writeCallback(json.dumps(tmpPool.to_json()))
예제 #4
0
    def post(self, poolName):
        if poolName in self.getDispatchTree().pools:
            raise HttpConflict("Pool already registered")
        else:
            tmpPool = Pool(None, poolName)
            self.getDispatchTree().pools[poolName] = tmpPool

            # JSA not necessary and old code causes an error
            # we just return the pool repr
            
            # if self.request.headers['Host'] is not None:
            #     host = self.request.headers['Host']
            # else:
            #     host = "%s:%d" % self.getServerAddress()
            # self.set_header('Location', 'http://%s/pools/%s/' % (host, poolName))
            self.writeCallback(json.dumps(tmpPool.to_json()))