예제 #1
0
class PropertiesHandler(tornado.web.RequestHandler):
    def initialize(self, logger):
        self.properties = Properties()
        self.logger = logger

    def get(self, property_name=None, instance=None, enviroment=None):
        self.logger.info("properties GET property_name: " + property_name+ " instance: " + instance + " enviroment: " + enviroment)
        if property_name and instance and enviroment:
            result = self.properties.get_property(property_name, instance, enviroment)
            if result['status'] == 'ok':
                response = result['property']
            else:
                response = {'error': result['reason']}
        else:
            response = {"get": "error", "reason": "missing parameters"}
        return self.write(json.dumps(response))
예제 #2
0
class PropertiesHandler(tornado.web.RequestHandler):
    def initialize(self, logger):
        self.properties = Properties()
        self.logger = logger

    def get(self, property_name=None, instance=None, enviroment=None):
        self.logger.info("properties GET property_name: " + property_name +
                         " instance: " + instance + " enviroment: " +
                         enviroment)
        if property_name and instance and enviroment:
            result = self.properties.get_property(property_name, instance,
                                                  enviroment)
            if result['status'] == 'ok':
                response = result['property']
            else:
                response = {'error': result['reason']}
        else:
            response = {"get": "error", "reason": "missing parameters"}
        return self.write(json.dumps(response))
예제 #3
0
 def initialize(self, logger):
     self.properties = Properties()
     self.logger = logger
예제 #4
0
 def initialize(self, logger):
     self.properties = Properties()
     self.logger = logger