コード例 #1
0
    def delete(self, label):
        monitor = Monitor()
        monitor.load(label)

        application.info("removing monitor %s" % label)

        self.success({"monitor": monitor.get_attributes(), "destroy": monitor.destroy()})
コード例 #2
0
    def post(self):

        json_request = json_decode(self.request.body)
        monitor = Monitor(**json_request)
        monitor.save()

        self.success({"monitor": monitor.get_attributes()})
コード例 #3
0
    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()})
コード例 #4
0
    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})
コード例 #5
0
    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})
コード例 #6
0
    def delete(self, label):
        monitor = Monitor()
        monitor.load(label)

        self.success({"monitor": monitor.get_attributes(), "destroy": monitor.destroy()})