def delete(self, label): monitor = Monitor() monitor.load(label) application.info("removing monitor %s" % label) self.success({"monitor": monitor.get_attributes(), "destroy": monitor.destroy()})
def post(self): json_request = json_decode(self.request.body) monitor = Monitor(**json_request) monitor.save() self.success({"monitor": monitor.get_attributes()})
def post(self): application.info("creating monitor with attributes %s" % self.request.body) json_request = json_decode(self.request.body) monitor = Monitor(**json_request) monitor.save() self.success({"monitor": monitor.get_attributes()})
def get(self, label): monitor = Monitor() monitor.load(label) alive = check_alive(monitor.monitor_type, monitor.url, **monitor.data) self.success({"monitor": monitor.get_attributes(), "alive": alive})
def delete(self, label): monitor = Monitor() monitor.load(label) self.success({"monitor": monitor.get_attributes(), "destroy": monitor.destroy()})